[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] HELP.. Creating Dynamic Select/SQL Statement
Trying doing this first to see what's even getting into your variable (it
may not be what you think).
Begin-Procedure Get_Start_Date
Let $numdays = '-'||$_Num_Days
Let $startdatesql = 'current timestamp '||$numdays||' from
sysibm.sysdummy1'
DISPLAY '$startdatesql = ' NOLINE
DISPLAY $startdatesql
!Begin-select
![$startdatesql] &start_date
!end-select
End-Procedure
Depending upon what you get in the display, precede that with select and run
it in SQLPlus (or other tool) and see what error you get. (It doesn't look
like it should because there's no table referenced.)
-----Original Message-----
From: Deborah Harris [mailto:dharris@activeinterest.com]
Sent: Wednesday, October 22, 2003 10:39 AM
To: sqr-users@sqrug.org
Subject: [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
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users