Closed camillehuot closed 5 years ago
As you noted, this is only for dynamic binds, which are generally quite large. Setting the value_sz
parameter to INT_MAX
simply permits that amount of data to be tranferred. It does not allocate any space on either the client or server. If the actual length was used, then you would have to ensure that the bind was performed before every execution -- since the actual length can change for each execution -- so I avoid that necessity by simply setting an arbitrarily large value.
Thanks for this insight. It helps a lot.
Hi Anthony
Thanks for this very clean wrapper. I have one question about a specific case.
I see that you set the maximum size of the data to INT_MAX here: https://github.com/oracle/odpi/blob/master/src/dpiOci.c#L797
The documentation states: "OCI_DATA_AT_EXEC - When this mode is selected, the value_sz parameter defines the maximum size of the data that can be provided at run time." https://docs.oracle.com/en/database/oracle/oracle-database/19/lnoci/bind-define-describe-functions.html#GUID-D28DF5A7-3C75-4E52-82F7-A5D6D5714E69
I would expect the client to count and set the maximum size of the data to be sent. I'm very interested to know why do you set INT_MAX? And is it dangerous for the client or server? (memory exhaustion, etc)
Thank you! Camille