Showing posts with label recordset. Show all posts
Showing posts with label recordset. Show all posts

Wednesday, March 7, 2012

Assign Aggregate count results to variable

I have an aggregate transform that outputs two columns, a group by (DT_STR) and a count(column name) (DT_UI8). The results are put into a Recordset Destination. When I attempt to map these columns to variables in a Foreach Loop Container (using a Foreach ADO Enumerator), I get the error:

Error: 0xC001F009 at ExtractNNRPersonUpdates: The type of the value being assigned to variable "User::NNRPersonCount" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.

Error: 0xC001C012 at Foreach Household Loop Container: ForEach Variable Mapping number 2 to variable "User::NNRPersonCount" cannot be applied.

The variable mentioned in the error message is setup as a UInt64. I've tried all other integer data types and nothing works. I also tried changing the data type of the count coming out of the Aggregate transform but received a warning stating this isn't possible.

Any idea what I may be doing wrong?

I had a lot of trouble with this error, and ended up doing explicit casts in a script where I was doing my comparison, using the CType function.

eg:

Row.newid = rowIndex + CType(Me.Variables.MyCounter, ULong)

Dylan.

|||Out of desperation, I began trying all of the data types. When I set it to DBNull, it worked. I was then able to cast it to an integer in a Script Task. Doesn't seem right though because the values are never null.

Assign Aggregate count results to variable

I have an aggregate transform that outputs two columns, a group by (DT_STR) and a count(column name) (DT_UI8). The results are put into a Recordset Destination. When I attempt to map these columns to variables in a Foreach Loop Container (using a Foreach ADO Enumerator), I get the error:

Error: 0xC001F009 at ExtractNNRPersonUpdates: The type of the value being assigned to variable "User::NNRPersonCount" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.

Error: 0xC001C012 at Foreach Household Loop Container: ForEach Variable Mapping number 2 to variable "User::NNRPersonCount" cannot be applied.

The variable mentioned in the error message is setup as a UInt64. I've tried all other integer data types and nothing works. I also tried changing the data type of the count coming out of the Aggregate transform but received a warning stating this isn't possible.

Any idea what I may be doing wrong?

I had a lot of trouble with this error, and ended up doing explicit casts in a script where I was doing my comparison, using the CType function.

eg:

Row.newid = rowIndex + CType(Me.Variables.MyCounter, ULong)

Dylan.

|||Out of desperation, I began trying all of the data types. When I set it to DBNull, it worked. I was then able to cast it to an integer in a Script Task. Doesn't seem right though because the values are never null.

Sunday, February 19, 2012

ASP/ODBC/Win2k - TCP Connections

Is it normal to see a new TCP connection for every SQL statement
executed [via ADODB.Recordset.Open] when connection pooling is
switched on?
When my ASP application is running there seems to be 1 constant
connection open, and 3 or 4 separate and continually opening/closing
connections. On examining the packets, it seems that each SQL gets
its own connection to the server.
Thanks
()z
If you are using ODBC this is not uncommon. ODBC determines when it needs
to spawn a new connection and does so. This can occur if a connection has
not finished processing all records and another request is sent. A new
connection has to be spawned to service this request.
Rand
This posting is provided "as is" with no warranties and confers no rights.
|||Thanks Rand
I'll not worry about them in that case.
rboyd@.onlinemicrosoft.com (Rand Boyd [MSFT]) wrote in message news:<L71m5yREEHA.3244@.cpmsftngxa06.phx.gbl>...
> If you are using ODBC this is not uncommon. ODBC determines when it needs
> to spawn a new connection and does so. This can occur if a connection has
> not finished processing all records and another request is sent. A new
> connection has to be spawned to service this request.
> Rand
> This posting is provided "as is" with no warranties and confers no rights.