[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
[sqr-users] HELP.. Creating Dynamic Select/SQL Statement
I am trying to create a dynamic select statement to be generated in
SQR.. I have tried using begin-sql and begin-select and I still get
an error message. I need to assign the value from the select statement
to a variable..
Where am I going wrong.
Here is my code.
Begin-Procedure Get_Start_Date
Let $numdays = '-'||$_Num_Days
Let $startdatesql = 'current timestamp '||$numdays||' from
sysibm.sysdummy1'
Begin-select
[$startdatesql] &start_date
end-select
End-Procedure
I get this error message.
Error on line 189:
(SQR 7740) Invalid &pseudonym or 'TYPE=' data-type specified
for a begin-select column-variable. Valid types are:
CHAR, TEXT, DATE, NUMBER
[$startdatesql] &start_date
Errors were found in the program file.
SQR: Program Aborting.
Deborah Harris
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users