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


  • Subject: Re: Create an SQL function
  • From: bmorris@xxxxxxxxxx
  • Date: Thu, 31 Aug 2000 17:11:33 -0400
  • Importance: Normal


>Date: Wed, 30 Aug 2000 14:27:58 -0500
>From: "Leland, David" <dleland@Harter.com>
>
>Okay, back to trying to create an SQL function (at V4R5M0).  I have a
>service program with an RPGLE module which has the following prototype:
>D CENTER          PR          2000A   OPDESC
>D                             2000A   OPTIONS(*VARSIZE)
> ...
>create function utilities/center (varchar(2000))
>returns char(2000)
> ...
> parameter style general
> no external action
>
>When I try to use the function, I receive the sql error: "Query cannot be
>run.  See lower level messages." and when I look at the lower level
>messages, I see: CEE0502 - "Missing operational descriptor.".

Dave, there's nothing in your create-function to say that
operational descriptors are required (OPDESC keyword on your
prototype).

(I don't know if it's possible to use a function that requires
an operational descriptor.  I couldn't see anything about it
with a quick glance at the UDF section of the manual.)

Are you sure varchar(2000) means OPTIONS(*VARSIZE)?  I'd have thought
it meant the same as RPG's VARYING.  Maybe you could rewrite your CENTER
function to have a CONST VARYING parameter and drop the OPDESC.  Or,
assuming you have existing code that calls the CENTER function, you
could move your centering code to a new function, say CENTERVAR, and
change CENTER to just do this:
C    ceedod stuff
C    return  centervar(%subst(parm : ceedod_len))

Sorry, I don't know much about UDF, but since I didn't see any other
responses I thought I might as well give you my guesses.

Barbara Morris


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.