× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.