String Conversion - SqlServer Target ODBC

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
WarehouseMan
Participant
Posts: 2
Joined: Fri Dec 22, 2006 9:14 am

String Conversion - SqlServer Target ODBC

Post by WarehouseMan »

Hello All,

I currently have a DStage job that simply reads a flat file and inserts the data into an SQLServer database, via an ODBC Stage. The problem that I am having is that SQLSever expects all string datatype values to be enclosed with single quotes (').....while DStage, by default, encloses all string values with double quotes (") when inserting into a table.

The question is how, if at all possible, can I specify in DStage to use single quotes instead of double quotes?

Your response will be greatly appreciated.

HAPPY HOLIDAYS!!!!!
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Welcome Aboard :P
By specifying (') in the quote character box in seqential file stage properties.
Last edited by DSguru2B on Fri Dec 22, 2006 9:38 am, edited 1 time in total.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Welcome Aboard, matey! :D

Did you try clicking on the 'Get SQLInfo' button on the General tab of the ODBC stage? That should query the database and set that option automatically for you based on what it finds the target needs.

Failing that, you should be able to manually change the Quote character there to a single quote, I would think.
Last edited by chulett on Fri Dec 22, 2006 9:39 am, edited 1 time in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

DSguru2B wrote:By specifying (') in the quote character box in seqential file stage properties.
Bzzzt... thanks for playing! Was an ODBC question, my friend, not a flat file question. :lol:
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Re: String Conversion - SqlServer Target ODBC

Post by DSguru2B »

Either way, now he has both the answers. Can work/play with both the options :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is it really a single quote, or a back tick ( ` )? Anyway clicking the GetSQLInfo button in the ODBC stage will load the correct character and, as a useful side effect, prove connectivity to the data source. Error-free (silent) execution equals good connection.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply