Semi Colon in SQL String

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Azzuri
Premium Member
Premium Member
Posts: 122
Joined: Tue May 13, 2008 11:42 am

Semi Colon in SQL String

Post by Azzuri »

Hi All, trying to pass a SQL statement to DataStage job to execute:

INSERT INTO TABLEA (Col1) VALUES('This ; is a test' ;

Doesn't like the semi colon in the string
teraTargetTable: RDBMS code 3707: Syntax error, expected something like ',' or ')' between a string or a Unicode character literal and the word


Any ideas on how to get around this error


Thanks In Advance
Azzuri
Premium Member
Premium Member
Posts: 122
Joined: Tue May 13, 2008 11:42 am

Post by Azzuri »

Sorry, forgot to mention it's in the After SQL of the teradata Connector.

Also I missed the the closing braket in my previous post.

INSERT INTO TABLEA (Col1) VALUES('This ; is a test') ;
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What happens when you leave off the semi-colon?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Azzuri
Premium Member
Premium Member
Posts: 122
Joined: Tue May 13, 2008 11:42 am

Post by Azzuri »

If I remove the ; from the string it works fine.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you insert this string using Teradata SQL Assistant, or some other client?

That is, is it a Teradata restriction or a DataStage problem?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's more of a DataStage thing it would seem. Found out long ago that (for Oracle in my case) it didn't want the trailing semi-colon that Toad would add and didn't mind if it was there. People would "user define" something that wouldn't run simply because of the semi-colon.

I don't see the issue here, take it out and you're fine.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Azzuri
Premium Member
Premium Member
Posts: 122
Joined: Tue May 13, 2008 11:42 am

Post by Azzuri »

Works fine in Teradata Assistant. I only get the error in DataStage.
Azzuri
Premium Member
Premium Member
Posts: 122
Joined: Tue May 13, 2008 11:42 am

Post by Azzuri »

Craig, unfortnately the semi-colon is part of the source data.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Other than fiddling around with escaping either the quote characters or the semi-colon character I have no suggestions. Perhaps you should involve your official support provider - this seems to me like incorrect behaviour.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Oh heck, I thought we were talking about the trailing semi-colon, not the one in your data... sorry. What happens if you escape it? Definitely involve your support provider as it certainly does seem like bad behaviour and perhaps there is a fix/patch for it out there.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Azzuri
Premium Member
Premium Member
Posts: 122
Joined: Tue May 13, 2008 11:42 am

Post by Azzuri »

Hey Craig. I tried to escape it without any luck. I might open a ticket with IBM. Thanks for your help.
Post Reply