September 16, 2009 at 3:52 pm
I have 2 global variables DMNSTATUS and DMN_ID
I get the values from a script task
Im running an SQL TASK using expressions to pass these variables into an sql statement:
"UPDATE TB_DMNSTAGE SET DMN_STATUS = " + @[User::DMNSTATUS] + " WHERE DMN_ID = " + @[User::DMNID]
My problem is if DMNSTATUS = waiting for verification
the sql statement fails because of syntax error:
UPDATE TB_DMNSTAGE SET DMN_STATUS = waiting for verification WHERE DMN_ID = 21
How do i get it parse the query as
UPDATE TB_DMNSTAGE SET DMN_STATUS ="waiting for verification" WHERE DMN_ID = 21
September 16, 2009 at 4:57 pm
Just add the single quotes in ...
"UPDATE TB_DMNSTAGE SET DMN_STATUS = '" + @[User::DMNSTATUS] + "' WHERE DMN_ID = " + @[User::DMNID]
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
September 16, 2009 at 6:59 pm
Once again i mix up my vb with my sql... single quotes not double quotes!!! BAH!
September 17, 2009 at 12:41 am
🙂 happens to us all
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
September 17, 2009 at 8:52 am
"UPDATE TB_DMNSTAGE SET DMN_STATUS = '" + @[User::DMNSTATUS] + "' WHERE DMN_ID = '" + @[User::DMNID] + "'"
Gives me error:
Error: Incorrect syntax near '18'.
[Execute SQL Task] Error: Executing the query "UPDATE TB_DMNSTAGE SET DMN_STATUS = 'Waiting for rework notification'' WHERE DMN_ID = '18'" failed with the following error: "Unclosed quotation mark after the character string ''.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
September 17, 2009 at 9:00 am
Removing the single qoutes near DMNID as such:
"UPDATE TB_DMNSTAGE SET DMN_STATUS = '" + @[User::DMNSTATUS] + "' WHERE DMN_ID = " + @[User::DMNID]
Gives me this error:
Error: Unclosed quotation mark after the character string 'Waiting for rework notification' WHERE DMN_ID = 18 '.
[Execute SQL Task] Error: Executing the query "UPDATE TB_DMNSTAGE SET DMN_STATUS = 'Waiting for rework notification'' WHERE DMN_ID = 18 " failed with the following error: "Incorrect syntax near 'Waiting for rework notification' WHERE DMN_ID = 18 '.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
September 17, 2009 at 9:02 am
AAAANDD... I found another boo boo of mine....
i had the ' being assigned in my script...
I think I need a vacation...
Ignore my previous question...
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply