msnews.microsoft.com
2008-10-31 09:25:09 UTC
Hello,
Iam trying to pass parameters to Oracle via SSIS data flow task but Iam
getting "Invalid SQL command" Oracle error. This is what I have done:
1. Declare three variables in SSIS - user::Commandsql (having
EvaluateAsExpression=true ), user::date1 and user::date2
2. Store the below statement in user::Commandsql
'SELECT fname,lname,city FROM details WHERE
TO_CHAR(Trxdate,''mm/dd/yyyy'') >= '+[user::date1]+ ' and
TO_CHAR(Trxdate,''mm/dd/yyyy'') <= '+[user::date2]
3.Set the default values for user::date1 as 3/27/2007 and user::date2 as
4/27/2008
4. In data flow task source editor, I connect to my Oracle instance and
select "sql command from variable" as data access mode. Then select
'user::Commandsql' as the variable.
When I click 'preview', its giving me this error:
TITLE: Microsoft Visual Studio
------------------------------
There was an error displaying the preview.
------------------------------
ADDITIONAL INFORMATION:
ORA-00900: invalid SQL statement
(Microsoft OLE DB Provider for Oracle)
------------------------------
BUTTONS:
OK
------------------------------
When I just execute the statement without giving pamaters and give the dates
directly, its working fine. What am I missing here? Its been three days
since Iam stuck with this.
TIA,
Abba
Iam trying to pass parameters to Oracle via SSIS data flow task but Iam
getting "Invalid SQL command" Oracle error. This is what I have done:
1. Declare three variables in SSIS - user::Commandsql (having
EvaluateAsExpression=true ), user::date1 and user::date2
2. Store the below statement in user::Commandsql
'SELECT fname,lname,city FROM details WHERE
TO_CHAR(Trxdate,''mm/dd/yyyy'') >= '+[user::date1]+ ' and
TO_CHAR(Trxdate,''mm/dd/yyyy'') <= '+[user::date2]
3.Set the default values for user::date1 as 3/27/2007 and user::date2 as
4/27/2008
4. In data flow task source editor, I connect to my Oracle instance and
select "sql command from variable" as data access mode. Then select
'user::Commandsql' as the variable.
When I click 'preview', its giving me this error:
TITLE: Microsoft Visual Studio
------------------------------
There was an error displaying the preview.
------------------------------
ADDITIONAL INFORMATION:
ORA-00900: invalid SQL statement
(Microsoft OLE DB Provider for Oracle)
------------------------------
BUTTONS:
OK
------------------------------
When I just execute the statement without giving pamaters and give the dates
directly, its working fine. What am I missing here? Its been three days
since Iam stuck with this.
TIA,
Abba