node-oracledb icon indicating copy to clipboard operation
node-oracledb copied to clipboard

Support for PL/SQL Object Types

Open dom-atom opened this issue 11 years ago • 5 comments

Hi Guys,

are there any plans to support PL/SQL object types and their tables as IN/IN OUT/OUT parameters in PL/SQL procedures and functions ? If yes - maybe the very rough date is known?

Thanks and regards, Domas

dom-atom avatar Nov 12 '15 21:11 dom-atom

why would you like something like that ? You just have to build a JSON Array with the data object from the oracle object type.

nelreina avatar Nov 15 '15 08:11 nelreina

We are using pl/sql procedures based SOAP web services which use oracle objet types as procedure input and output parameters. The idea is to move to REST using node.js and node-oracle driver, but we need to be able to ivoke our pl/sql procedures which use oracle object types and they should remain intact.

dom-atom avatar Nov 15 '15 12:11 dom-atom

Ok ok I got it.

My suggestion will be the same I think.

Just override the procedure with json / and create a utility function/procedure to transform json to an oracle object types.

nelreina avatar Nov 16 '15 04:11 nelreina

I guess this approach would work only with Oracle 12c as JSON features were introduced in this version. Unfortunatelly we are using 11g and upgrading to 12c is not considered in the short term.

dom-atom avatar Nov 16 '15 09:11 dom-atom

@dom-atom your initial request is being tracked in https://github.com/oracle/node-oracledb/issues/147 Follow that for updates. In the meantime you might look at writing your own PL/SQL wrapper to compose/decompose the complex types to scalar values that can be bound in node-oracledb calls. I think @nelreina is saying this, but using JSON as an intermediate type.

Regarding JSON, you can convert the output from many queries to JSON even without 12c: https://github.com/oracle/node-oracledb/issues/265#issuecomment-153150678

cjbj avatar Nov 16 '15 10:11 cjbj