Abba
2008-11-20 09:22:22 UTC
Hello,
I am facing an error while retrieving data from Oracle into a variable. This
is the scenario:
1. I have table in Oracle and SQLServer with the same structure as below. My
SSIS package is to sync data from Oracle to SQLServer
CREATE TABLE [dbo].[ZipCode_TEST]
(
[ZipCode] [char](5) NOT NULL,
[Upd] [datetime] NOT NULL
)
2. The first "Execute SQL Task" runs against SQLServer and runs the T-SQL:
SELECT ISNULL(CONVERT(VARCHAR,MAX(upd),101),0) As Upd from ZipCode_TEST and
stores the resultset to a parameter [User::sqldtecnt] that has valuetype as
'object'
3. The second "Execute SQL Task" runs against Oracle and executes the
command "select count(*) AS Count from datahq_am.am_zipcode_staging where
TO_CHAR(update_date,'mm/dd/yyyy') > "+ @[User::sqldtecnt] which is stored in
a variable. The query parsed correctly. And I have set the resultset to a
parameter orclcnt which is of valuetype 'single'
4. When I execute the package, it gives me the error - [Execute SQL Task]
Error: Executing the query ""select count(*) AS Count from ZipCode_TEST
where TO_CHAR(upd,'mm/dd/yyyy') > "+ @[User::sqldtecnt]" failed with the
following error: "An error occurred while extracting the result into a
variable of type (DBTYPE_I4)". Possible failure reasons: Problems with the
query, "ResultSet" property not set correctly, parameters not set correctly,
or connection not established correctly.
I tried changing variable orclcnt to int32,int64 but all in vain. Can anyone
help?
TIA,
Abba
I am facing an error while retrieving data from Oracle into a variable. This
is the scenario:
1. I have table in Oracle and SQLServer with the same structure as below. My
SSIS package is to sync data from Oracle to SQLServer
CREATE TABLE [dbo].[ZipCode_TEST]
(
[ZipCode] [char](5) NOT NULL,
[Upd] [datetime] NOT NULL
)
2. The first "Execute SQL Task" runs against SQLServer and runs the T-SQL:
SELECT ISNULL(CONVERT(VARCHAR,MAX(upd),101),0) As Upd from ZipCode_TEST and
stores the resultset to a parameter [User::sqldtecnt] that has valuetype as
'object'
3. The second "Execute SQL Task" runs against Oracle and executes the
command "select count(*) AS Count from datahq_am.am_zipcode_staging where
TO_CHAR(update_date,'mm/dd/yyyy') > "+ @[User::sqldtecnt] which is stored in
a variable. The query parsed correctly. And I have set the resultset to a
parameter orclcnt which is of valuetype 'single'
4. When I execute the package, it gives me the error - [Execute SQL Task]
Error: Executing the query ""select count(*) AS Count from ZipCode_TEST
where TO_CHAR(upd,'mm/dd/yyyy') > "+ @[User::sqldtecnt]" failed with the
following error: "An error occurred while extracting the result into a
variable of type (DBTYPE_I4)". Possible failure reasons: Problems with the
query, "ResultSet" property not set correctly, parameters not set correctly,
or connection not established correctly.
I tried changing variable orclcnt to int32,int64 but all in vain. Can anyone
help?
TIA,
Abba