× 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.




On 03/12/2009, at 10:59 AM, Scott Klement wrote:

I can't imagine that it reads your program's source code to determine
this. There's no way from outside of the procedure to know what
parameters it can potentially take.

(Yes, I know about the ability to generate PCML and store it in a
module, but SQL isn't using that functionality because that
functionality is MUCH newer than UDF capability, and it's not always
there, so that support is clearly not used.)

Since SQL can't know about this extra parameter, it can't know that it
has to set the pointer to zeros... I can't see how Birgitta could be
right. The only way it would make sense is if SQL always sets a
predefined number of pointers (maybe 399?) to *NULL... but that doesn't
seem likely to me, as that 24k of x'00' would be a fairly expensive
operation, and it's inconsistent with the way this parameter info is
filled in everywhere else.

If SQL does determine the maximum number of parameters then I would expect it does so by interrogating the information in SYSPROCS. This has the function name and number of parameters. It would be possible to query this file for the maximum number of parameters for a given function name and ensure at least that many parameters were passed by supplying a null pointer for any missing ones. That would be a far more likely approach than relying on source code (which likely is not on the production system anyway) or using PCML information.

However, I strongly doubt SQL does any such thing and that the presence of a null pointer for omitted parameters is simply happenstance.

It would be nice to know definitively whether SQL does handle this in a predictable manner because the ability to have a single program or procedure implement overloaded functions would be useful.

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.