Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Execute SQL Task Warning

$
0
0

Hi

I have a Execute SQL Task that has a SQL statement to count total number of records from a table in Oracle. Once the SQL statement is executed I want the count to returned and put into a variable that I have declared SSIS.

This is what I have done so far in order to achieve the above -

1. Execute SQL Task -  Connection type is OLE DB

2. Execute SQL Task - Connection is using OLE DB Provider for Oracle

3. Execute SQL Task - Result set is Single row

4. Execute SQL Task - SQL looks like this - select count (*) as myvar from mytable

5. Execute SQL Task (Result Set page) - variable name - myvar has been selected and name given as myvar to

6. Variable myvar has been declared as datatype int32 and scope is Package Level

Now when I run this with all of the above the Execute SQL Task fails and I get the following error -

[Execute SQL Task] Error: An error occurred while assigning a value to variable "myvar": "The type of the value being assigned to variable "User::myvar" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.
".

If I then change the datatype for variable myvar to anything else but for string or object I receive the error above.

The count(*) function from Oracle returns a 4 byte integer and I have determined the equivalent for this in the SSIS variable datatype drop down list is UInt32.

The only thing I can think of is the connector (OLE DB Prodvider for Oracle) is changing the datatype from the Oracle source to a string. I have changed this connector to use the Microsoft OLE DB Provider for Oracle but I still receive the same error.

I have added a breakpoint on the next component in the control flow after this Execute SQL task and I can see on the watch window the value the variable contains is correct - if I change the variable datatype to be string or object.

I would like to keep the variable as an integer datatype however, anybody have any ideas? I am happy to go with an alternative approach if someone can recommend another way I can just get the total record count from a source table to?

One last thing, no matter how whatever datatype I use I still receive this Warning -

Warning: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

Any ideas of how to get rid of this warning to?

Thanks for any replies in advance


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>