Warning: Undefined array key "birthday_search" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 173
Warning: Undefined array key "joindate" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 190
Warning: Undefined array key "posts" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 191
Warning: Undefined array key "posts" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 197
Warning: Undefined array key "userid" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 6509
Warning: Undefined array key "userid" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 212
Warning: Undefined array key "privacy_options" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 251
Warning: Undefined array key "userid" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/library/user.php on line 4998
Warning: Undefined array key "userid" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/library/user.php on line 1585
Warning: Undefined array key "lastactivity" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/library/user.php on line 1601
Warning: Trying to access array offset on value of type bool in /home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb5/route/profile.php on line 74
Get the Day of the Week, Full Text Date Values, and More Within RPG Using SQL -
MC Press Online Forums
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
Get the Day of the Week, Full Text Date Values, and More Within RPG Using SQL
Is there a reason you would not have used the SQL value retrieval instead of referencing SYSIBM/SYSDUMMY1?
Exp. exec sql values week(:argDate) into :svWoy;
** This thread discusses the article: Get the Day of the Week, Full Text Date Values, and More Within RPG Using SQL **
Tom, I think a simpler way to take advantage of SQL functions is to make your program SQLRPGLE and embed the statement directly in it. Also, you don't have to use SYSDUMMY1 to get the result. Yes, it's a very useful table for certain times but unnecessary here. My example just uses the SET statement - as you can see, you can put several together in one statement. I think this is simpler than invoking a service pgm to replace essentially one line of code.
I don‘t see any reason why you couldn‘t use values instead. I‘ve used values in statements before, but never like that. I think it‘s a great alternative and I‘ll be using it. Thanks!
R.Khoury
You are absolutely right. For programmers that are used to using embedded SQL it would be easier to just code it in the statement. For situations where you‘re in a staff that is early in adoption of embedded SQL then using procedures could let programmers who do not feel comfortable with embedded SQL programs to access the functionality without dealing with the details or changes in the way they compile. And if for some reason you put your functions in a service program it could be like a code repository for code snippets that embedded SQL programmers, like yourself, could use to copy and paste juicy pieces of code.
Thanks a lot for the posts! Happy Coding!
Tom
Last edited by Guest; 01-19-2012, 02:39 PM.
Reason: HTML Editing
** This thread discusses the article: Get the Day of the Week, Full Text Date Values, and More Within RPG Using SQL **
Tom, thanks for taking the time to write your articles. I already knew about the using SQL SET but sometimes your articles teach me something new and then at times you get to learn something new too. We all improve our skills.
** This thread discusses the article: Get the Day of the Week, Full Text Date Values, and More Within RPG Using SQL **
And Thank You Chris! You‘re so right, that‘s what it‘s all about. Thanks everyone for the alternatives. You took the article a step beyond what I put out there and taught me some new tricks. Thank You!
Thanks for introducing me to set R.Khoury. Nice use of it Chris!
Comment