Single Quotes is getting replaced in ODBC stage
Job structure is
ODBC - transformer - file
select query is like - select * from Sqlserver_tablename where condition - the whole query is passes from parameter #SQLQuery#
#SQLQuery# is getting value from
Trim(Convert(@FM," ",#Command_Execute.$CommandOutput#)) passed from the sequencer.
#Command_Execute.$CommandOutput#)) is getting value from a cat command
$cat Sql.txt
we had an issue when sql string is select * from table where column = 'FIRST'
THE QUOTES is getting replaced it is executed as - select * from table where column = FIRST and was giving error in datastge
I made the string as select * from table where column = \'FIRST\' and executed sequencer job executed successfully with desired results
The problem here this sql command is executed by client we cannot ask then to give slash before quotes we need to handle this in datastage
Can anyone please help me in this.
Thanks
Aneesh
Single quotes getting replaced in ODBC stage
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 15
- Joined: Wed Feb 11, 2009 11:41 am
- Location: Chennai
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
-
- Premium Member
- Posts: 15
- Joined: Wed Feb 11, 2009 11:41 am
- Location: Chennai
-
- Premium Member
- Posts: 15
- Joined: Wed Feb 11, 2009 11:41 am
- Location: Chennai
That backslash is an escape character.aneesh5142 wrote:Not able to figure out how quotes are getting replaced and when we are giving '\' how it is working.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers