/*
I have created a sequences named 'S1' and 'S2'.
it is a requirement to change the sequence names at runtime based
on some conditions and not to be hard-coded.
I was wondering if I could succesfully run the below query.
Any help in this regard will be highly appreciated.
*/
DEF VAR A AS CHAR.
A = 'DM'.
DISP STRING ( NEXT-VALUE ( STRING(A))).
/*Following code works for me.
Dyanmic-next-value works with database name*/
DEF VAR A AS CHAR.
A = 'S1'.
DISP string(DYNAMIC-NEXT-VALUE(A,'dbname')).
Thanks Mike ... Much appreciated ...
DISP DYNAMIC-NEXT-VALUE(A,LDBNAME(1)) .