Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call Oracle function returning Table of record

I have to get data from a function which returns a table of record. For example

Package is pkg1

Record defined inside package is:

type rec is record(id number,name varchar2(40));

Table of Record defined inside package is:

type rec_tbl is table of rec;

Function defined inside package is :

FUNCTION get_rec_tbl() RETURN rec_tbl;

Now What I need to do is: Using spring jdbc or spring jdbctemplate get values from function and process it. I am not sure how to do this.

Can some one help?

like image 547
Ankur Nema Avatar asked Oct 08 '22 10:10

Ankur Nema


1 Answers

RECORD type is not directly supported by Oracle JDBC drivers.

There is an ugly workaround, as an official JDBC reference states. Never used it myselft, thought.

like image 59
Łukasz Rżanek Avatar answered Oct 13 '22 12:10

Łukasz Rżanek