Closed felipenoris closed 3 years ago
Hi @anthony-tuininga ! Do you mind adding this API to your lib?
Thanks for the ping! If I were to add such a function, I would do the following:
int dpiLob_getType(dpiLob *lob, dpiOracleTypeNum *oracleTypeNum)
This is to ensure that you can determine if the function succeeded -- which it will if the LOB value you supply is valid, but won't if it is NULL or invalid in some other way. You can determine if that type refers to character data by simply checking to see if it matches one of DPI_ORACLE_TYPE_CLOB
or DPI_ORACLE_TYPE_NCLOB
. Another possibility is to add an additional parameter to the function above:
int dpiLob_getType(dpiLob *lob, dpiOracleTypeNum *oracleTypeNum, int* containsCharacterData)
Comments?
@anthony-tuininga thanks for your reply! Sorry for the delay.
So for the interface:
int dpiLob_getType(dpiLob *lob, dpiOracleTypeNum *oracleTypeNum)
*lob
is the input
*oracleTypeNum
is the output
the function result is for error handling
If what I understand is correct, then this solution will surely work for me.
I took the time to look at my code and definitely I don't need the extra parameter. I can implement it as checking wether it is a DPI_ORACLE_TYPE_CLOB
or DPI_ORACLE_TYPE_NLOB
as you suggested.
Many thanks!
@felipenoris, I've pushed changes to implement this function. Please let me know if this resolves your request. Thanks!
@anthony-tuininga Thanks for the patch! I just tested it and it solves this issue.
ODPI-C 4.2 has just been released which includes this enhancement. Thanks for the suggestion!
Hi!! I would like to request some additional lob API, if this is not available.
I'm currently applying a patch in odpi to add these functions, since I can't directly deref this data from the caller.