Page 1 of 1

cannot insert clob in 7.0.2

Posted: Mon 19 Jun 2017 10:10
by albourgz
Hi,
using unidac 7.0.2, direct mode, c++ builder xe10 seattle, vcl win32.
My computer is win10x64.
I have an oracle table (server is 12c SE2) :

Code: Select all

SQL> desc cec.messagesservice
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 DTMESS                                    NOT NULL TIMESTAMP(6)
 PRIORITY                                  NOT NULL NUMBER(1)
 MESSAGE                                   NOT NULL CLOB
 ID                                        NOT NULL NUMBER(20)
 STATUS                                             VARCHAR2(20)
(dtmess has a default value)
And I try to insert a row in it:

Code: Select all

...
int iSeq=200000, iPriority=5;
GDB->StartTransaction();
TUniSQL *qq=new TUniSQL(Application);
qq->Connection=GDB;
qq->SQL->Clear();
qq->SQL->Add("INSERT INTO MessagesService(priority, ID, message) VALUES (:1,:2,empty_clob()) returning message into :3");
qq->Prepare();
qq->SpecificOptions->Values["TemporaryLOBUpdate"] = "False";
qq->Params->Items[0]->AsInteger=iPriority;
qq->Params->Items[1]->AsInteger=iSeq;
qq->Params->Items[2]->DataType=ftOraClob;
qq->Params->Items[2]->ParamType=ptInput;
qq->Params->Items[2]->AsBlobRef->AsString = "<coucou></coucou>";
qq->Execute();
GDB->Commit();
delete qq;
...
The insert works (no error) but clob is garbage. When I read it I get all question marks, instead of "<coucou></coucou>". It worked with unidac 6.xxxxxxxx. Any hint?

Re: cannot insert clob in 7.0.2

Posted: Mon 19 Jun 2017 14:13
by MaximG
We have tested the work of UniDAC according to your description. Unfortunately, we could not reproduce the described problem. We successfully wrote the "<coucou> </ coucou>" value in the MESSAGE field and successfully read it after that. Please clarify, the meaning of "<coucou> </ coucou>" entirely consists of the characters of the English alphabet. For further investigation, compose and send us
a small complete project, execution of which causes the problem. You can do this using the e-support form (https://www.devart.com - the "Support" \ "Request Support" menu)

Re: cannot insert clob in 7.0.2

Posted: Tue 27 Jun 2017 13:48
by albourgz
I sent a sample. I need urgent help, please.

Re: cannot insert clob in 7.0.2

Posted: Wed 28 Jun 2017 13:39
by albourgz
Investigations:
in direct mode: Using TUniSQL: INSERT INTO MessagesService(priority, message) VALUES (:1,:2)
and settings TemporaryLobUpdates to false work.

But this fails in non-direct mode, and I couldn't find any way to make it work if direct mode is NOT used, even when using the "returning" syntax (client is oracle 11.2.0.1.0, server is oracle 12.1.0.2 RAC).

Re: cannot insert clob in 7.0.2

Posted: Tue 04 Jul 2017 07:47
by MaximG
We continue investigating the problem. By now we have not detected any difference in ODAC behavior between OCI Mode and Direct Mode. We will inform you about the results in the nearest future.