Page 1 of 1

Problems with Return value PL/SQL Index Table

Posted: Tue 05 Feb 2008 15:37
by SarahC
Hi,

I am trying to call an oracle function which returns a PL/SQL Index Table. (I would like to display the result set into a grid using Delphi 7) When using the OraStoredProc component I get an error message saying Unknown Datatype.

Is there any way using the OraStoredProc or OraQuery to do this.

NOTE: I do not have any problems returning REF_CURSORS.


PL/SQL Declaration
TYPE SALARY_REC IS RECORD
(From_Year VARCHAR2(4),
To_Year VARCHAR2(4),
Salary NUMBER,
Salary_Increase_factor NUMBER,
Adjusted_Salary NUMBER
);

Type SALARY_TAB IS TABLE OF SALARY_REC
INDEX BY BINARY_INTEGER;

Function Salary_Adjustment(Employee_ID VARCHAR2
RETURN SALARY_TAB;

Thanks
Sarah

Posted: Wed 06 Feb 2008 10:27
by Plash
ODAC does not support stored procedures with PL/SQL table parameters because such type is not supported by OCI.
You can use global nested table type (not from a package):

Code: Select all

CREATE TYPE SALARY_OBJ AS OBJECT 
(From_Year VARCHAR2(4), 
To_Year VARCHAR2(4), 
Salary NUMBER, 
Salary_Increase_factor NUMBER, 
Adjusted_Salary NUMBER 
); 

CREATE TYPE SALARY_TAB AS TABLE OF SALARY_OBJ;