Page 1 of 1

Semi Colon in SQL String

Posted: Tue Mar 26, 2013 12:21 pm
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

Posted: Tue Mar 26, 2013 12:32 pm
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') ;

Posted: Tue Mar 26, 2013 1:09 pm
by chulett
What happens when you leave off the semi-colon?

Posted: Tue Mar 26, 2013 1:41 pm
by Azzuri
If I remove the ; from the string it works fine.

Posted: Tue Mar 26, 2013 1:44 pm
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?

Posted: Tue Mar 26, 2013 1:52 pm
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.

Posted: Tue Mar 26, 2013 1:58 pm
by Azzuri
Works fine in Teradata Assistant. I only get the error in DataStage.

Posted: Tue Mar 26, 2013 2:07 pm
by Azzuri
Craig, unfortnately the semi-colon is part of the source data.

Posted: Tue Mar 26, 2013 3:23 pm
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.

Posted: Tue Mar 26, 2013 4:06 pm
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.

Posted: Wed Mar 27, 2013 5:35 am
by Azzuri
Hey Craig. I tried to escape it without any luck. I might open a ticket with IBM. Thanks for your help.