[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



Hi Deborah, 
In dynamic select statements, you have to specify the data type for the
variable you are getting your value  from the database into.
This gave me a tough time too :)

Try this:
        [$startdatesql] &start_date=DATE

Hope this helps,

Dèv Rishi Sahani
--------------------
FESCo DB Systems
Fidelity Investments

-----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