Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / June 2006

Tip: Looking for answers? Try searching our database.

Single Quote

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shsandeep - 29 Jun 2006 07:34 GMT
I am trying to construct this query in a function:

SELECT CONCAT('SEQ=',CHAR(NEXTVAL FOR MYSCHEMA.LOAD_ID)) FROM
SYSIBM.SYSDUMMY1

Here is what I use to construct it but I am unable to get the single
quotes for SEQ. How do I get them?

set vsql =  'SELECT CONCAT(' || 'SEQ' || ',CHAR(NEXTVAL FOR MYSCHEMA.' ||
SEQNAME || ')) FROM SYSIBM.SYSDUMMY1';  

Cheers,
San.
Purple-D - 29 Jun 2006 19:48 GMT
This will work:

set vsql = 'SELECT CONCAT(''SEQ='',CHAR(NEXTVAL FOR MYSCHEMA.LOAD_ID))
FROM SYSIBM.SYSDUMMY1'

U need to 'escape' the single quote by another single quote. and so a
single quote should be ''

> I am trying to construct this query in a function:
>
[quoted text clipped - 9 lines]
> Cheers,
> San.
Will Honea - 29 Jun 2006 20:19 GMT
> I am trying to construct this query in a function:
>
[quoted text clipped - 9 lines]
> Cheers,
> San.

Try:

set vsql =  'SELECT CONCAT(' || 'SEQ' || ''',CHAR(NEXTVAL FOR
MYSCHEMA.' || SEQNAME || ''')) FROM SYSIBM.SYSDUMMY1';

Basically, you have to escape the ' character to get the literal.

Signature

Will Honea

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.