oracle 0x80040e51 描述:“提供程序无法导出参数信息并且尚未调用 SetParameterInfo。”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10416875/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
0x80040e51 Description: "Provider cannot derive parameter information and SetParameterInfo has not been called."
提问by slipsec
I am trying to execute a query against oracle with the where clause including
我正在尝试使用 where 子句对 oracle 执行查询,包括
BETWEEN date AND date2
First round of research shows that the oracle OLEDB provider does not allow for parameterized queries, and these should be set in variables. So I have created 3 variables. 2 to hold my dates that are populated correctly, and one to hold the query with the expression ending in:
第一轮研究表明,oracle OLEDB 提供程序不允许参数化查询,这些应该设置在变量中。所以我创建了 3 个变量。2 保存我正确填充的日期,还有一个保存以表达式结尾的查询:
BETWEEN to_date('" + (DT_WSTR, 30)@[User::lastRun] + "','DD/MM/YYYY HH:MI:SS AM') AND to_date('" + (DT_WSTR, 30) @[User::thisRun] + "','DD/MM/YYYY HH:MI:SS AM')"
When I click "Evaluate Expression" in the expression builder, it evaluates correctly to
当我在表达式构建器中单击“评估表达式”时,它正确评估为
BETWEEN to_date('1/1/1900','DD/MM/YYYY HH:MI:SS AM') AND
to_date('1/1/2010','DD/MM/YYYY HH:MI:SS AM')
And I am able to run this against oracle successfully using other tools.
我能够使用其他工具成功地针对 oracle 运行它。
But when I try to run the package, I receive:
但是当我尝试运行包时,我收到:
[mySource 1] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E51. An OLE DB record is available. Source: "OraOLEDB" Hresult: 0x80040E51 Description: "Provider cannot derive parameter information and SetParameterInfo has not been called.".
[mySource 1] 错误:SSIS 错误代码 DTS_E_OLEDBERROR。发生 OLE DB 错误。错误代码:0x80040E51。OLE DB 记录可用。来源:“OraOLEDB” Hresult:0x80040E51 描述:“Provider 无法导出参数信息,并且尚未调用 SetParameterInfo。”。
Where mySource is the OLE DB Source. It has it's AccessMode set to "SQL Command From Variable" and SQLCommandVariable set to my query variable.
其中 mySource 是 OLE DB 源。它的 AccessMode 设置为“来自变量的 SQL 命令”,并将 SQLCommandVariable 设置为我的查询变量。
I also tried manually setting all of the Output external columns, and changing some of the values I was selecting in the query to cast away the oracle DATE datatype:
我还尝试手动设置所有输出外部列,并更改我在查询中选择的一些值以丢弃 oracle DATE 数据类型:
to_char(PT.CREATED_DTTM,'DD/MM/YYYY HH:MI:SS AM')
I'm still pretty new to SSIS, so I am not even sure I am looking in the correct place for the root of this error. Anyone have ideas where to go from here?
我对 SSIS 还是很陌生,所以我什至不确定我是否在正确的地方寻找这个错误的根源。任何人都有想法从这里去哪里?
Screenshots as requested. As you can see the "from variable" query works as expected in preview mode, but when I try to execute it I get the error.
根据要求截图。正如您所看到的,“来自变量”查询在预览模式下按预期工作,但是当我尝试执行它时出现错误。
采纳答案by slipsec
I ended up setting this in the "expressions" on the DataFlow, and NOT on the OLD DB source, making sure the variable still has "EvaluateAsExpression" = True.
我最终在 DataFlow 的“表达式”中进行了设置,而不是在 OLD DB 源中,确保变量仍然具有“EvaluateAsExpression”= True。
You can also see that I have updated from OLE DB to using the Attunity Oracle connector.
您还可以看到我已从 OLE DB 更新为使用Attunity Oracle 连接器。