Problems with Return value PL/SQL Index Table

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
SarahC
Posts: 1
Joined: Tue 05 Feb 2008 15:14

Problems with Return value PL/SQL Index Table

Post by SarahC » Tue 05 Feb 2008 15:37

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 06 Feb 2008 10:27

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; 

Post Reply