|
Oops, SET is valid for host variables. Hey, cool. How about using the SQL special register CURRENT DATE or CURRENT_DATE instead of :TODAY? At 19:30 11/28/2000, I wrote: >At 14:17 11/28/2000, Al Mac wrote: >>Does SQL's SET DayofWeek Scalar Function work in RPG/400? >>If so, what am I doing wrong? >>C MOVEL *DATE TODAY 8.0 >>& I also defined WKDAY as 1.0 >> >>C/EXEC SQL >>C+ SET :WKDAY = DayOfWeek(:TODAY) >>C/END-EXEC >> >>Error message from SEU >>Token : was not valid. Valid Tokens: OPTION RESULT CONNECTION TRANSACTION > >SET isn't valid for a host variable. Try using a VALUES INTO statement. >I've never used it, but the documentation says "The VALUES INTO statement >produces a result table consisting of at most one row and assigns the >values in that row to host variables." You'd need an expression something like: > > C/EXEC SQL VALUES DayOfWeek(:TODAY) INTO :WKDAY > C/END-EXEC > >hth >Pete >Pete Hall >pbhall@execpc.com >http://www.execpc.com/~pbhall/ > >+--- >| This is the Midrange System Mailing List! >| To submit a new message, send your mail to MIDRANGE-L@midrange.com. >| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. >| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. >| Questions should be directed to the list owner/operator: david@midrange.com >+--- Pete Hall pbhall@execpc.com http://www.execpc.com/~pbhall/ +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.