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