[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
Sam, you don't need to separate quoted quote marks from the rest of your
text. You could write:
let $where_date_clause = ' D.DATE_OC_RECEIVED between ''' ||
$start-date || ''' and ''' || $ending-date || ''''
''''
-----Original Message-----
From: Harris, Sam [mailto:SVH@cdrh.fda.gov]
Sent: Wednesday, October 22, 2003 7:58 AM
To: 'sqr-users@sqrug.org'
Subject: RE: [sqr-users] HELP.. Creating Dynamic Select/SQL Statement
When you create dynamic sql in SQR the concatenation of the string is more
involved than
just making a string. Take a look at the following working example.
let $where_date_clause = ' D.DATE_OC_RECEIVED between ' || '''' ||
$start-date || '''' || ' and ' || '''' || $ending-date ||
''''
It is used in the where clause as:
WHERE [$where_date_clause]
-----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
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users