1

我是骆驼 sql 存储组件的新手。目前我正在使用 Camel 2.17.5。我正在尝试从骆驼路线调用 oracle 存储过程。这是我的路线:

<setHeader headerName="test">
                        <simple>John</simple>
                    </setHeader>
                    <log loggingLevel="INFO" message="value: ${headers.test}" />
                    <to uri="sql-stored:HELLO(VARCHAR ${headers.test},OUT  VARCHAR outparam1)?dataSource=oracleDataSource"/>
                    <log loggingLevel="INFO" message="SP result: ${body}" />

这是我的存储过程:

CREATE OR REPLACE PROCEDURE hello(param1 IN varchar2, outparam1 OUT varchar2)
AS
BEGIN 
select password INTO outparam1 from dbuser WHERE USERNAME=param1;
END;

但是当我运行我的路线时,它给了我错误:

    org.apache.camel.component.sql.stored.template.ast.ParseRuntimeException: org.apache.camel.component.sql.stored.template.generated.ParseException: Encountered " " " "  "" at line 1, column 35.
Was expecting one of:
    <NUMBER> ...
    <IDENTIFIER> ...
    at org.apache.camel.component.sql.stored.template.TemplateParser.parseTemplate(TemplateParser.java:36)
    at org.apache.camel.component.sql.stored.CallableStatementWrapperFactory.getTemplateStoredProcedure(CallableStatementWrapperFactory.java:71)

你能帮我吗,这里有什么问题?

4

1 回答 1

2

正如克劳斯上面所指出的,这是我的语法错误。我刚刚删除了双空格,它可以工作!所以调用行应该是这样的:

<to uri="sql-stored:hello(VARCHAR ${headers.test},OUT VARCHAR outparam1)?dataSource=oracleDataSource"/>
于 2017-03-06T18:13:35.860 回答