February 4, 2008 at 7:55 pm
I have an Execute SQL task on an Oracle database that I want to perform the following (Note:This SQL query works fine in a Oracle environment).
update MILESTONE_DATA x
set LASTMONTHSACTUAL =
(select ACTUAL from MILESTONE_DATA
where PROGRAM = 'abcdef' and
NODE_NAME = x.node_name and
G_COLLECTDATE = ADD_MONTHS(x.g_collectdate,-1))
where LASTMONTHSACTUAL is null;
I create the SQL statement as a string and pass it in as a variable to the Execute SQL Task. The Execute SQL Task is set up as follows:
ResultSet: None
Connection Type: OLE DB
Connection: ->Points to my database
SQLSourceType: Variable
SourceVariable: User::MPostSQLString
BypassPrepare: True
Whenever the task runs it generates the following error:
[Execute SQL Task] Error: Executing the query "update MILESTONE_DATA x set LASTMONTHSACTUAL = (select ACTUAL from MILESTONE_DATA where PROGRAM = 'abcdef' and NODE_NAME = x.node_name and G_COLLECTDATE = ADD_MONTHS(x.g_collectdate,-1)) where LASTMONTHSACTUAL is null;" failed with the following error: "ORA-00911: invalid character". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
If I copy the SQL Statement from the error message and run it in TOAD for ORACLE it works fine.
How do I run a SQL statement like this using the Execute SQL Task?
February 5, 2008 at 1:38 pm
It ended up being the OLE Provider.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy