Closed Andreas741 closed 2 years ago
Hi, This is not a bug but rather an oracle limitation. Oracle varchar/varchar2 types are limited in length in both PL/SQL and SQL engines. It cannot be greater than 4k or 32k depending on oracle versions and database init settings. OCI API uses an unsigned short for specifying bind host variable size for strings. Thus, you cannot do what was exposed in your message.
Regards,
Vincent
Hello,
many thanks for the quick response.
Specifying the length is optional with the bind function; without this length specification, a string of any length up to the final 0 byte is transmitted. We use this feature to insert and modify long and clob columns via bind variables. As far as I know there aren't many ways to handle long and clob columns with data longer than 64k. Using the bind variable is a very powerful option. This feature would make it extremely easy to replace other Oracle interfaces with ocilib.
Greetings from Germany
Hi,
binding host variables for clob columns shall not use strings but ocilib::clob (despite it works for clob content that is less than varchar max size)
Best regards,
Vincent
Hello,
I think I found a bug in ocilib 4.7.4. The problem also occurred in ocilib 4.5.1. The String Bind variables are always bound by specifying a length. Since the length specification type only has 16 bits, the length is limited to 64k. If you bind variables without specifying the length, you can use strings any number of characters up to the final '\0' byte. I fixed this temporarily, see the code below. It would be nice if this feature could be included in the next release.
Kind regards
File bind.c line 540:
/ ---------------------------------------------------------------------------------------------
static boolean OcilibBindPerformBinding ( OCI_Bind bnd, unsigned int mode, unsigned int index, unsigned int exec_mode, boolean plsql_table ) { ENTER_FUNC ( / returns / boolean, FALSE, / context */ OCI_IPC_BIND, bnd )
File bind.h line 106:
// akh 02.05.2022 OCI_SYM_LOCAL int OcilibBindGetUseLengthArray ( OCI_Bind* bnd );
File lcilib.c line 216:
// akh 02.05.2022 int OCI_API OCI_BindGetUseLengthArray ( OCI_Bind* bnd ) { CALL_IMPL(OcilibBindGetUseLengthArray, bnd) }
File api.h line 4054:
// akh 02.05.2022 OCI_SYM_PUBLIC int OCI_API OCI_BindGetUseLengthArray ( OCI_Bind* bnd );
File BindObjectAdaptor.hpp line 62: