First of all I wanted to say a big thank you to the author of OCILIB for
creating such a useful and intuitive library! I'm currently working on a
project where OCILIB makes my daily work much easier.
Currently I encountered one issue that I wanted to ask help for.
I use following PL/SQL block to get table DDL:
declareh1NUMBER;--handlereturnedbyOPENthNUMBER;--handlereturnedbyADD_TRANSFORMforDDLddlCLOB;--DDLbeginh1:=DBMS_METADATA.OPEN(:object_type);DBMS_METADATA.SET_FILTER(h1,'NAME',:object_name);DBMS_METADATA.SET_FILTER(h1,'SCHEMA',:owner);th:=DBMS_METADATA.ADD_TRANSFORM(h1,'DDL');if:p_pretty='y'thenDBMS_METADATA.SET_TRANSFORM_PARAM(th,'PRETTY',TRUE);elsif:p_pretty='n'thenDBMS_METADATA.SET_TRANSFORM_PARAM(th,'PRETTY',FALSE);endif;/*rest of transformations similar to above if statement*/ddl:=DBMS_METADATA.FETCH_CLOB(h1);DBMS_METADATA.CLOSE(h1);open:rs_outforselectddlfromdual;end;
to get CLOB as a string (toQString is my function that converts the string to
QString).
On Linux everything works right, but on Windows it crashes approximately every
3 times out of 5. When I run it in debugger it crashes every time. Debugger
says there is a heap corruption and visual studio shows some assembly code
inside OCI_GetString. Also when I change CLOB to VARCHAR2 in PL/SQL block it
works right both on Linux and Windows. Because of this I thought if it works
with VARCHAR2 may be it is a bug related to CLOB handing on Windows. If you
encountered this issue or know the solution any help would be of great use for
me. If I'm asking a dummy question please, direct me in the right direction (I
tried with OCILIB 3.9.2 with Unicode build)
Thanks in advance!
Rovshan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
First of all I wanted to say a big thank you to the author of OCILIB for
creating such a useful and intuitive library! I'm currently working on a
project where OCILIB makes my daily work much easier.
Currently I encountered one issue that I wanted to ask help for.
I use following PL/SQL block to get table DDL:
Then in OCILIB I use
to get the resultset (:rs_out).
After this I use a loop and call
to get CLOB as a string (toQString is my function that converts the string to
QString).
On Linux everything works right, but on Windows it crashes approximately every
3 times out of 5. When I run it in debugger it crashes every time. Debugger
says there is a heap corruption and visual studio shows some assembly code
inside OCI_GetString. Also when I change CLOB to VARCHAR2 in PL/SQL block it
works right both on Linux and Windows. Because of this I thought if it works
with VARCHAR2 may be it is a bug related to CLOB handing on Windows. If you
encountered this issue or know the solution any help would be of great use for
me. If I'm asking a dummy question please, direct me in the right direction (I
tried with OCILIB 3.9.2 with Unicode build)
Thanks in advance!
Rovshan
hi,
I'll hve a loot this evening and let you know.
regards,
vince
Hi,
I found the problem. I'll make fix asap.
Send me your email that i can send you a win32 package to test.
vince
Hi,
in lob.c, comment or remove the lines 433-436 :
// if (OCILib.nls_utf8 == FALSE)
// {
// byte_offset *= sizeof(odtext);
// }
it will work then as expected...
Regards
vince
My email address is: rovshanb at gmail dot com
I will compile it and post the outcome here.
Thank you very very much!!!
Yes it worked!
Thank you very much for your time and efforts and for giving this great
library to us for free!