How to pass a map to Oracle PL / SQL functions?

I would like to create an equivalent if this Java method as a PL / SQL function in Oracle 10g:

String myMethod(int par1, Map<String, Object> par2);

Is it possible to pass a map (or some simillar structure) to Oracle PL / SQL functions? I have to somehow call this function from Java.

+3
source share
3 answers

There is an interesting AskTom discussion about passing Java objects to Oracle. More specifically IMO, this great tip from Tom Kyte :

Me i will juse

create a global temporary table gtt (fname varchar2 (20), lname varchar2 (20)) by fixing the rows delete;

BATCH Java , , .

, , "" "" "

i-e: , java pl/sql . , ( ), .

+5

. .

+2

JDBC Oracle

JPublisher, Java . oracle.sql.ARRAY.

Note that you also need to create the appropriate PL / SQL objects, read this article . You do not need to implement any MEMBER methods to easily exchange data between Java and Oracle.


Edit 1: Unfortunately, PL / SQL does not have a Map concept such as Java. However, you can model the map as a special one (Key, Value object) or as an Index-by table for a simple class (for example, a hash map).

+1
source

Source: https://habr.com/ru/post/1715889/


All Articles