That does not makes any sense!
The date format to be used for "real" date fields returned by an SQL SELECT
statement or an stored procedure or user defined function, depends on the
date format and the date separators set within the current environment.
The default value for the date format and separator is *JOB.
The date format can be set in STRSQL using F13 option 1 and DATFMT
Within the IBM i Navigator by clicking on the JDBC-setup task and selecting
Format.
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: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von tim.dclinc@xxxxxxxxx
Gesendet: Monday, 21.1 2013 20:28
An: Midrange Systems Technical Discussion
Betreff: create function that excepts and returns a date
Im trying to create a function that will accept a date field and a constant
and return a date field. So
sq_getdate(dateplaced,'*mtdf')
When i try to execute my sql, i get a "note found" message. I believe it has
to do with parameter types, but not sure how to fix it.
Here is my create command:
CREATE FUNCTION MYLIB/SQ_GETDATE(
date,
CHARACTER(6)
)
RETURNS date
SPECIFIC SQ_GETDATE
DETERMINISTIC
LANGUAGE RPGLE
NO SQL
NO EXTERNAL ACTION
RETURNS NULL ON NULL INPUT
SCRATCHPAD
NO FINAL CALL
ALLOW PARALLEL
EXTERNAL NAME 'MYLIB/SQLUDF02(SQ_GETDATE)'
PARAMETER STYLE DB2SQL
Prototype:
d SQ_GETDATE...
d Pr
d datein D
d datefmt 6
d dateout D
D NullIndIn 4B 0
D NullIndOut 4B 0
D SQLState 5A
D FunctionName 517A CONST OPTIONS(*VARSIZE) VARYING
D SpecificName 128A CONST OPTIONS(*VARSIZE) VARYING
D DiagMessage 70A OPTIONS(*VARSIZE) VARYING
D ScratchPad 104A OPTIONS(*VARSIZE) VARYING
D CallType 4B 0
D DBInfo 1024A OPTIONS(*VARSIZE:*NOPASS)
D CONST VARYING
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.