IIB v10:将局部变量传递给ESQL select语句

时间:2019-01-21 11:48:41

标签: ibm-integration-bus extended-sql

我不熟悉IIB,尝试使用ESQL连接到Oracle DB。尝试将局部参数传递给简单SELECT语句中的where子句。执行错误时遇到错误。谁能帮我

ESQL:
    BROKER SCHEMA com.project


CREATE COMPUTE MODULE MainFlow_Compute
    CREATE FUNCTION Main() RETURNS BOOLEAN
    BEGIN
        DECLARE var REFERENCE TO Environment.Variables;
        DECLARE username CHAR;

        SET username = InputRoot.JSON.Data.userid;

        --SET OutputRoot.XML.Invoice[] = SELECT E.EMPLOYEE_ID,E.FIRST_NAME FROM Database.HR.EMPLOYEES AS E WHERE E.EMPLOYEE_ID=username;
        SET OutputRoot.XML.Invoice[] = PASSTHRU('SELECT E.EMPLOYEE_ID,E.FIRST_NAME FROM Database.HR.EMPLOYEES AS E WHERE E.EMPLOYEE_ID=?' VALUES(username));
        SET OutputRoot.JSON.Data.user_id=username;
        --SET OutputRoot.JSON.Data.user_name=var.profile.FIRST_NAME;        

        RETURN TRUE;
    END;
END MODULE;

日志:

Error: BIP3113E: Exception detected in message flow com.project.MainFlow
         http://localhost:7800/users/getUserDetails
         Exception. BIP2230E: Error detected whilst processing a message in node 'com.project.MainFlow.Compute'. : F:\build\slot2\S1000_P\src\DataFlowEngine\SQLNodeLibrary\ImbComputeNode.cpp: 515: ImbComputeNode::evaluate: ComIbmComputeNode: com/project/MainFlow#FCMComposite_1_4
BIP2488E:  ('com.project.MainFlow_Compute.Main', '14.4') Error detected while executing the SQL statement ''SET OutputRoot.XML.Invoice[] = DEFAULTPASSTHRU('SELECT E.EMPLOYEE_ID,E.FIRST_NAME FROM Database.HR.EMPLOYEES AS E WHERE E.EMPLOYEE_ID=?', username);''. : F:\build\slot2\S1000_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp: 767: SqlStatementGroup::execute: : 
BIP2321E: Database error: ODBC return code '-1' using ODBC driver manager ''odbc32.dll''. : F:\build\slot2\S1000_P\src\DataFlowEngine\MessageServices\ImbOdbc.cpp: 3814: ImbOdbcStatement::checkRcInner: : 
BIP2322E: Database error: SQL State ''IM001''; Native Error Code '0'; Error Text ''[Microsoft][ODBC Driver Manager] Driver does not support this function''. : F:\build\slot2\S1000_P\src\DataFlowEngine\MessageServices\ImbOdbc.cpp: 4035: ImbOdbcStatement::checkRcInner: :

注意:我已经提到了以下链接

IIB: Passing local variable to ESQL select statement

0 个答案:

没有答案