[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
Dynamic columns and dynamic sql need to be seperate.
Dynamic columns need to be "typed" for each column that's dynamic.
The dynamic sql is best put after a literal "from" clause.
Plus (as suggested already) check the strings that you make and test the
sql that you're trying to create.
HTH,
Don
On Wed, 22 Oct 2003, Deborah Harris wrote:
> 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
>
-----------------------------------------------------------------------
Donald Mellen | Ray Ontko & Co. - Richmond, IN - http://www.ontko.com/
donm@ontko.com | "In the beginning, there was nothing, which exploded"
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users