|
Hi,
Just add a SET OPTION - Statement to your embedded SQL program to specify
the time format and time separators:
C/EXEC SQL
C+ SET OPTION DATFMT = *ISO, TIMSEP = *COLON, TIMFMT = *HMS
C******... Other Options
C/END-EXEC
The SQL precompiler creates additional variables for each host variable
used
in an SQL statement.
In case of date and time fields, neither the date or time format in the D-
or H-Specs is used, but the options (DATFMT, DATSEP, TIMFMT, TIMSEP)
specified in the compile command.
Instead of specifiying these options in the compile command, a SET OPTION
command can be used to determine these formats.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training
them
and keeping them!"
-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
Im
Auftrag von Neil Taylor
Gesendet: Thursday, April 10, 2008 18:43
An: RPG programming on the AS400 / iSeries
Betreff: Embedded and %TIME
Hello
I have a question that I hope some one can help with please.
I have a procedure in a service program that has input parameter of type
TIME
When called from a standard RPG module, the time arrives in the format
'17:33:00'. It is then happily written to a file.
However, I have written a new RPG module with embedded SQL. After the SQL,
the same procedure is called, but now the time has arrived in the format
'17.33.00' and refuses to be written to the file.
I have tried assorted tactics, but I can't see an obvious solution.
I'd be very grateful if anyone could help.
Regards
Neil
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or
change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
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.