[ruby-oci8-devel] Issue of binding nil element for Array DML

Liming Lian liming.lian at oracle.com
Thu Dec 27 21:14:41 EST 2007


Hi,

Open this thread to discuss issue of binding nil element for  Array DML.

An example of normal insert:

cursor = conn.parse("INSERT INTO test_table VALUE (:str)")
cursor.bind_param(1, nil , String)
cursor.exec

The result of above example is inserting a row of "nil" to test_table. 
Let's turn to array insert example:

cursor = conn.parse("INSERT INTO test_table VALUE (:str)")
cursor.max_array_size = 3
cursor.bind_param(1, nil , String)
cursor.exec_array

For this binding "nil" elements for array insert, I have several 
optional results:

1) insert an array of "nil"

2) insert single row of "nil"

3) raise an error

Personally, I prefer option 1). Any idea?



More information about the ruby-oci8-devel mailing list