Kirkpatrick, in your original example you were using the SQL parameter
style, so perhaps you're referring to that, not GENERAL? I ask because I
don't see how GENERAL parameter style would work in this case.
The reason I think GENERAL won't work with CL is that it requires a service
program function that RETURNs a value (it cannot use an output argument).
Since I know of no way that CL can RETURN a value, I don't think GENERAL is
possible.
Can you show an example with GENERAL parameter style?
Charles, regarding
How does this work?
This is simply the way external UDFs work. I don't think any HLLs have
native data types for DATE, TIMESTAMP, TIME etc. data types. That means the
system needs to provide some sort of mapping for the external UDFs and SPs.
Mapping/Conversion/Casting is done automatically by DB2 between character
representations of a DATE, TIMESTAMP, TIME etc. because it knows that we've
specified DATE as a return type.
BTW, I prefer Kirkpatrick's use of SQL parameter style over DB2SQL. It's
simpler and easier to work with than DB2SQL, although DB2SQL parms give you
more info about the UDF (i.e. if you're going to write commercial apps).
Elvis
Celebrating 11-Years of SQL Performance Excellence on IBM i, i5/OS and
OS/400
www.centerfieldtechnology.com
-----Original Message-----
Subject: RE: Retrieve JOB (not SYSTEM) date in SQL
GENERAL style parameters worked also.
midrange-l-bounces@xxxxxxxxxxxx wrote on 06/05/2008 12:16:13 PM:
Ok Elvis,
How does this work?
How can you return a date from a CL program???
Aahh, I see DB2SQL style parameters work that way. Cool, learned
something new.
Charles Wilt
As an Amazon Associate we earn from qualifying purchases.