Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass PB7 string array to ORACLE 8i stored proc ?

Status
Not open for further replies.

PANTLORD

Programmer
Aug 28, 2001
49
EU
Hi there,

Am trying to pass a string array to an ORACLE 8i stored procedure, I have tested the procedure on the server and know it works, PB7 is giving me any error though when trying to save ;

'variable reference in database statement has unsupported data type'

My PB code is;

dec{0} ld_sys_ed_key
STRING lsa_inp_key[],lsa_inp_val[]

//Initialise
lsa_inp_key[1] = '1900000137'
lsa_inp_key[2] = '1900000139'
lsa_inp_val[1] = 'ORCLEVAL'
lsa_inp_val[2] = 'YES'

ld_sys_ed_key = 0123456789
DECLARE insert_into_system_inputs PROCEDURE FOR cameng.sms.insert_into_system_inputs(
:ld_sys_ed_key,
:lsa_inp_key[],
:lsa_inp_val[]) USING SQLCA;
EXECUTE insert_into_system_inputs;
CLOSE insert_into_system_inputs;

The procedure uses a table of SCALARS defined as a type in a package i.e.

type strArray is table of VARCHAR2(255) index by binary_integer;

procedure insert_into_system_inputs(sys_ed_key_in in NUMBER, inp_key_in in strArray,
inp_val_in in strArray);

procedure insert_into_system_inputs(sys_ed_key_in in NUMBER, inp_key_in in strArray,
inp_val_in in strArray)
IS
sys_inp_key_in NUMBER := 0;

BEGIN
/*Insert all sys_inputs values to system_inputs*/
for i in 1 .. inp_key_in.count loop
INSERT INTO CAMENG.SYSTEM_INPUTS VALUES (sys_inp_key_in, inp_key_in(i), inp_val_in(i));
end loop;
EXCEPTION
WHEN OTHERS then
ROLLBACK;
END insert_into_system_inputs;

Not sure if the DECLARE method will allow me to pass arrays of values to a stored procedure, any ideas ?

Also very hard to find any info on Powerbilder -> ORACLE datat type mappings has anyone got a reference for this info ?

Many thanks,
Mully
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top