Sunday, February 26, 2012

Error in execute sql task

I get the following error when trying to execute an sql statement in oracle and returning the results into an object variable with the execute sql task.

Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "select <columnlist> from <tablename>" failed with the following error: "The SelectCommand property has not been initialized before calling 'Fill'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

It executes fine if I select no results or first row but I can't get full result set to work. The query and connection string are valid. Any ideas?

Hi,

Have you selected the "Full Result Set" in the ResultSet option? If so, then create a variable of datatype "Object" and link that variable in the ResultSet tab. In that, enter "0" in the Result Name and in the Variable Name, select the variable you created as Object.

Pls try this and let me know if you have any issues.

Sorry for the delayed response. I just gone thru this issue.

Prakash Srinivasan

|||I have the same issues with the Script task in the control flow. I have the result set to full and assigned to a datatype of object. I also have 0 for the name of the result set but it still give me the same error. " selectcommand was in initialized before Fill" It would be a paid to enter 300 column names in the script component in the data flow side just because this the Script task isnt work. I will be glad if someone could help me.|||

How are you doing this? The Script Task isn't really supposed to be used for extracting SQL data. Why does Execute SQL Task not work for you?

-Jamie

|||

I am pulling data through an ado.net connection connected to a DB/C 4 database (odbc database). I needed to pull data based on the last date run so i need a way to insert a date into my sql command where clause. I am using an expression to set the sqlcommand of the Script task to "select .....from tableA where timestamp > = " @.[datetime::mydate] ". I have the resultset set to Full result set. I also have my resultset variable as Object::rs_data and the name set to 0 for Full resultset. I still get the error so I am think its probably the fact that the script task does not work for ado.net odbc connnections.

|||

I am still left wondering why you are not doing this in an Execute SQL Task. And yet you say "I have the resultset set to Full result set." Are you really using a script task?

-Jamie

|||Sorry, i wasnt paying attention. I meant to say Execute SQL Task instead of Script task. With that said, is there any ideas for fixing the situation and once to assign a resultset to a variable. How do you use that resultset(variable) as datasource in a Data flow.|||Hi,
does anyone have the solution to the error:
The SelectCommand property has not been initialized before calling 'Fill'."
for Execute SQL Task problem? I am also stuck there...
Daren
|||

I'm facing the same problem while I'm extracting data from an "SQL Task" using a result set "full result set".

Also can someone tell me how to read the temp result set created by the SQL task ? The documentation found is very poor for a novice like me and doesn't explain how to read the System.Data.Dataset in order to feed a SQL server destination table.

Thanks

No comments:

Post a Comment