Scott,
I was using the OPDESC to retrieve the current length of the varying
parm passed in using CEEGSI. I removed that and replaced it with the
%LEN BIF and now it at least calls my procedure. Unfortunately when my
procedure returns, I get this cryptic message from SQL (I am testing
using STRSQL):
Function error X'0306' in machine instruction. Internal dump identifier
(ID) 0100A758.
There is nothing else in my joblog, but this message. This is how I
defined my UDF:
Create Function RMULLIS/RmvNonAlph(VarChar(1000),VarChar(1))
Returns VarChar(1000)
Language RPGLE
External Name 'RMULLIS/SYSRVUTL(REMOVE_NON_ALPHANUMERIC)'
Deterministic
No SQL
Parameter Style General
Allow Parallel
No External Action
Any ideas on what might cause this error?
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Thursday, September 26, 2013 6:03 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Creating a SQL UDF
Robert,
SQL does not support operational descriptors.
Looking at your prototype, I don't see why you would need an operational
descriptor, here? Your fields are all fixed-sizes, and you have no
optional field. Can you explain what OPDESC is used for?
If you do need OPDESC (for calls from ILE languages.. it can't be used
from SQL) I'd suggest creating an RPG wrapper that can be invoked
without OPDESC, but calls the original procedure. Something like
D Remove_Non_AlphaNumeric_sql...
P B export
D pi 65535a varying opdesc
D inData 65535a const varying
D inCompress n const
/free
return Remove_Non_AlphaNumeric(inData: inCompress);
/end-free
P E
So this merely calls the regular routine... the advantage is that it
doesn't have an OPDESC, so it can be called from SQL. If you wanted to,
you could use overloading (by having multiple wrappers like this, each
would have a different 'external name', but the same SQL name) that pass
different sized strings or passed optional parameters, etc.
I could explain that better if I understood what the opdesc was used
for.
-SK
On 9/26/2013 3:08 PM, Robert Mullis wrote:
That worked Chuck. I changed the second parm to a VARCHAR(1) and now
it finds the UDF. Now the UDF is failing with "Missing operational
descriptor." in the joblog. Apparently the OPDESC on my procedure is
a problem.
--
This is the RPG programming on the IBM i (AS/400 and 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.