K2InformaticsGmbH / erloci

Erlang Oracle native driver - DEPRECATED, see https://github.com/K2InformaticsGmbH/oranif instead
Apache License 2.0
37 stars 11 forks source link

Add support to edit CLOBS #69

Open acautin opened 5 years ago

acautin commented 5 years ago

when trying to edit/insert a CLOB the driver returns Unsupported type in bind which I see is defined on https://github.com/K2InformaticsGmbH/erloci/blob/7b9d2fd1111b5b01c52111e50194cb5451d3f9f4/c_src/erloci_drv/marshal.cpp#L503

and I don't see SQLT_CLOB in the switch case, would it be possible to support this type ?.

cc @stoch

c-bik commented 5 years ago

Writing LOB (CLOB, BLOB and NCLOBs) through DDErl requires implementation of OCI LOB edit APIs as defined here https://docs.oracle.com/cd/B28359_01/appdev.111/b28395/oci17msc002.htm#i541721

LOBs requires special streaming API calls to insert them through bind variables (which probably inst current requirement for DDErl support). This is a non-trivial implementation so postponed / skipped in favor of NIF project!

@acautin For dderl please construct the insert statements as follows:

insert into tab1(clob_column) values (to_clob(:SQLT_STR_CLOBBIN))

Update statements should have similar to_clob function calls.

c-bik commented 5 years ago

To be tried : https://docs.oracle.com/cd/B12037_01/appdev.101/b10779/oci05bnd.htm#420895