I have an RPGLE program set up this way.
dcl-pr CallTheProgram extpgm('HROLL') ;
p_Client char(2); // Input
p_employee zoned(7); // Input
p_planyear zoned(4); // Input
p_RoLLin zoned(7: 2) dim(8); // InputOutput
p_RoLLou zoned(7: 2) dim(8); // InputOutput
p_eavL zoned(7: 2) dim(8); // InputOutput
p_year1 zoned(4); // InputOutput
end-pr;
I am trying to write a Stored Procedure to consume it.

This was one attempt:
CREATE TYPE myLib.INTARRAY4 AS NUMERIC(4,0) ARRAY[8] ;
CREATE TYPE myLib.INTARRAY7 AS NUMERIC(7,2) ARRAY[8] ;
CREATE OR REPLACE PROCEDURE myLib.sp_HROLL2 (
IN Client CHAR(2)
,IN ENum numeric(7,0)
,IN PlanYr numeric(4,0)
,INOUT Category cafteria.intarray4
,INOUT ROLL_IN cafteria.intarray7
,INOUT ROLL_OUT cafteria.intarray7
,INOUT Year4 cafteria.intarray4
)
LANGUAGE RPGLE
specific cafteria.sp_hRoll2
not deterministic
no sql
called on null input
EXTERNAL NAME myLib.HROLL
parameter style general with nulls
This will not compile I get a message:
SQL State: 42710
Vendor Code: -601
Message: [SQL0601] INTARRAY4 in CAFTERIA type *SQLUDT already exists. Cause
. . . . . : An attempt was made to create INTARRAY4 in CAFTERIA or to
rename a table, view, alias, or index to INTARRAY4, but INTARRAY4 already
exists. All tables, views, aliases, indexes, SQL packages, sequences,
global variables, masks, permissions, constraints, triggers, user-defined
types, and XSR objects in the same schema must have unique names. -- If
INTARRAY4 is a temporary table, it cannot be replaced unless the WITH
REPLACE clause is specified. -- If the schema name is *N, this is a CREATE
SCHEMA statement. If this is a CREATE TABLE or ALTER TABLE statement and
the type is *N, INTARRAY4 is a constraint. Recovery . . . : Change
INTARRAY4 to a name that does not exist, or delete, move, or rename the
existing object. If this is a temporary table, use the WITH REPLACE clause.
If creating an SQL package, specify REPLACE(*YES) on CRTSQLPKG. Try the
request again.

Then I tried
CREATE OR *REPLACE* PROCEDURE cafteria.sp_HROLL3 (
IN Client *CHAR*(*2*)
,IN ENum *numeric*(*7*,*0*)
,IN PlanYr *numeric*(*4*,*0*)
,OUT Category *numeric*(*32*)
,OUT ROLL_IN *numeric*(*56*)
,OUT ROLL_OUT *numeric*(*56*)
,OUT Year4 *numeric*(*32*)
)
LANGUAGE RPGLE
specific cafteria.sp_hroll3
not deterministic
no sql
called on null input
EXTERNAL NAME cafteria.HROLL
parameter style general with nulls
This will return values but the arrays are all messed up.

How would you write the stored procedure command?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 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.