MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » November 2012

RE: Why won't this CREATE FUNCTION command work?



fixed

Yes. It worked for me on our v7 box AND our v5r4 box, but then failed on a
client's v5r4 box. Must be a PTF difference?

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Michael Schutte
Sent: Monday, November 26, 2012 9:12 AM
To: Midrange Systems Technical Discussion
Subject: Re: Why won't this CREATE FUNCTION command work?

That's interesting because this works fine for me.

CREATE FUNCTION &LIB/RETRIEVECALLERSQL ()
RETURNS CHAR(65)
LANGUAGE RPGLE
SPECIFIC RTVCALLER1
NOT DETERMINISTIC
NOT FENCED
NO SQL
CALLED ON NULL INPUT
EXTERNAL NAME RTVCALLER(RETRIEVECALLER)
PARAMETER STYLE GENERAL ;

V7R1 using Aldon Promotion process.



On Mon, Nov 26, 2012 at 9:33 AM, Thomas Garvey <tgarvey@xxxxxxxxxx> wrote:

Wow. Thanks so much, Chuck. That indeed worked. I never saw that in
any manual.

I'm not going to waste time trying to figure out why it worked without
the library reference and the apostrophes on our v7 and v5 boxes.

Thanks again.

Tom Garvey


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Sunday, November 25, 2012 5:03 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: Why won't this CREATE FUNCTION command work?

I am too lazy presently to locate any specifics [beyond to suggest
reviewing second level text from DSPMSGD SQL0449 QSQLMSG], but the
solution is likely both to ensure the proper PATH is established
before issuing the CREATE request and\or to specify the external name
within apostrophes [as delimiters] along with including the library
name. Thus on the second-to-last line, specifying the following should
resolve:
EXTERNAL NAME 'TheLibraryName/DATE2ISO(DATE2ISO)'

Or as an old-release copy of the text for the -449 sqlcode
suggests, "The external program name for a procedure or function must
be of the form 'library-name/program-name' or
'library-name/program-name(entry-point-name)'."

--
Regards, Chuck

On 25 Nov 2012 15:46, Thomas Garvey wrote:
We have this function, which is written in RPGLE in the form of a
module in a service program. The following CREATE FUNCTION works
fine on our v7r1 system and our v5r4 system. However, when we run it
on our client alpha test site (also v5r4), it fails.

CREATE FUNCTION LIBRARY/DT2ISOSRV (
TESTVALUE VARCHAR(50) ,
DATEFMT VARCHAR(4) )
RETURNS DATE
LANGUAGE RPGLE
SPECIFIC LIBRARY/DT2ISOSRV
NOT DETERMINISTIC
NO SQL
CALLED ON NULL INPUT
NO EXTERNAL ACTION
NOT FENCED
EXTERNAL NAME DATE2ISO(DATE2ISO)
PARAMETER STYLE GENERAL ;

Here's the error...
Token ( was not valid. Valid tokens: IS NO NOT NULL ALLOW FINAL READ

The cursor is positioned on the left paren in the second to last
line of the command.

This specification is necessary to identify the procedure and
service program name when the parameter style is general. The
service program is named DATE2ISO and the procedure in that service
program is DATE2ISO. The function, when used in embedded SQL
statements, is DT2ISOSRV. Like I said, it works on two different
systems. But not on our alpha site.

Any ideas what could be different between the systems? This is a
showstopper for us.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at http://archive.midrange.com/midrange-l.



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.








Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact