oracle / node-oracledb

Oracle Database driver for Node.js maintained by Oracle Corp.
http://oracle.github.io/node-oracledb/
Other
2.24k stars 1.07k forks source link

What is the limit on the number of items in Array #1639

Closed nimah99 closed 3 months ago

nimah99 commented 5 months ago

Supposed, there is array bind like this :

binds = ['Christopher', 'Hazel', 'Samuel'];

For this bind example has 3 items in array.

What is limit number of items in array?
expected limit item is up to 50K or maybe 100K and more with each item has 8 digit string.

then can be execute using this query : 
sql = "select first_name, last_name from employees where first_name in (";
for (var i=0; i < binds.length; i++) sql += (i > 0) ? ", :" + i : ":" + i;
sql += ")"; 

Thank you...
sosoba commented 5 months ago

IMHO the number of bound variables is limited to 256.

See ODCIVARCHAR2LIST in doc.

nimah99 commented 5 months ago

So, i need to use ODCIVARCHAR2LIST?

like this : const inlist = ['Christopher', 'Hazel', 'Samuel', ....100K more]; const binds = { bv: { type: 'SYS.ODCIVARCHAR2LIST', val: inlist } };

sql = "select first_name, last_name from employees where first_name in (:bv)";

? @sosoba

sosoba commented 5 months ago

You can use any VARCHAR2 table. SYS.ODCIVarchar2List are built-in and public:.

sharadraju commented 3 months ago

Closing this as there is no update.