Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

0x80040e51 Description: "Provider cannot derive parameter information and SetParameterInfo has not been called."

Tags:

oracle

ssis

I am trying to execute a query against oracle with the where clause including

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:

 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.

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.".

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.

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:

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?

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.

Control FlowData SourceDebug error

like image 387
slipsec Avatar asked Nov 13 '22 06:11

slipsec


1 Answers

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.

You can also see that I have updated from OLE DB to using the Attunity Oracle connector.

DataFlowSource

like image 78
slipsec Avatar answered Jan 01 '23 02:01

slipsec