-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support PL/SQL and SQL types like Oracle Spatial SDO #147
Comments
@bmulcahy there's no support for complex data types. It's on the long list of things to look at but hasn't been prioritized. You could write a wrapper PL/SQL block to decompose the SDO into simple types and call the PL/SQL code. |
What data-types are supported? If i have a stored function on the server to return a string will that work? Thanks for the help. |
@bmulcahy You can use string, date and number OUT binds from PL/SQL blocks. Binding in node-oracledb as string lets a wider range of scalar PL/SQL types be returned. |
I am seeing "Error: NJS-010: unsupported data type in select list" when I do "SELECT *" from various tables that I am looking at. I am not sure which column / field type that node-oracledb is having trouble accessing.. Is there a way to enable more verbose output - to show which column and which field type is not supported? |
@soichih I agree that it would be nice if the column name was provided. However, for this type of ad-hoc exploration, I'd recommend using a tool like SQL Developer. It's free and a lot more productive than using the Node.js driver for that type of task. |
If anyone lands here and needs an example of how to bind record types and/or arrays of record types until there's built-in support for this, here you go: https://jsao.io/2017/01/plsql-record-types-and-the-node-js-driver/ |
@dmcghan Thanks for the example. For a function I have
In my bind variable, do I still have to have a type attribute?
EDIT: In my case the PLSQL is returning a user defined type. I have it working by returning a SYS_REFCURSOR from my PLSQL but wondering if that is the correct way. |
@smtl Whether a SYS_REFCURSOR is right for you depends on what you're doing. If you want a cursor, then that should be fine. But if you wanted, say, an array of record type variables, then you'd have to do the reverse of what I do in my example. In other words, rather than assign the result of the function call to a bind variable, you'd assign the result to a locally declared variable in the PL/SQL block. Then you'd have to break the single array up into multiple arrays of type number or varchar2. Those arrays would be the out binds. When the arrays make it to the JavaScript context, you could reformat them as needed. Does that make sense? |
Yep, I get what you mean. Thanks. |
Is the ability to bind complex types (record types and/or arrays of record types) anywhere in the roadmap? |
There are a lot of different users who prioritize different features. Hearing feedback helps us judge which way to head, so thanks for updating this issue. At this stage we are focused on 1.13 and 2.0 beta (which have effectively the same feature set, see #601). We can then do a review of priorities and decide what we should look at next. There will always be this option too, a point I hope is taken in good spirit since I know not everyone will be able to contribute! |
@ahummel25 it is 'closer' because the ODPI-C layer in node-oracledb v2 has this. ODPI-C replaced the DPI layer which didn't have it. |
Hi all, just stopping by to express my interest in supporting complex datatypes, such as record types (and arrays) in the node-oracldb driver. |
@cjbj Any progress on this regarding being able to bind a PL/SQL table structure to a procedure argument? |
Not yet, unfortunately. It is still under consideration, though! |
@cjbj Any news on custom type support? |
@lkiii Nothing's on paper yet. It's not going to be a small project. |
The first, major drop of code to support binding named Oracle types is on the dev-4.0 branch. See #1053 (comment) |
Node-oracledb 4.0 has been released with an enhancement for querying and binding of objects. See https://oracle.github.io/node-oracledb/doc/api.html#objects. A specific Spatial demo is at https://github.com/oracle/node-oracledb/blob/master/examples/selectgeometry.js The 4.0 release announcement is at https://blogs.oracle.com/opal/oracle-db-named-objects-and-advanced-queuing-support-new-in-node-oracledb-40 |
I keep getting NJS-010: unsupported data type in select list, when I try to retrieve sdo geometries from a database.
I then tried running a stored function(SDO2GEOJSON) but received the same NJS-010 error but didn't know if that was do to functions not being supported or geometries.
Or this could all be user error on my part.
The text was updated successfully, but these errors were encountered: