cannot insert clob in 7.0.2

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

cannot insert clob in 7.0.2

Post by albourgz » Mon 19 Jun 2017 10:10

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?

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: cannot insert clob in 7.0.2

Post by MaximG » Mon 19 Jun 2017 14:13

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)

albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

Re: cannot insert clob in 7.0.2

Post by albourgz » Tue 27 Jun 2017 13:48

I sent a sample. I need urgent help, please.

albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

Re: cannot insert clob in 7.0.2

Post by albourgz » Wed 28 Jun 2017 13:39

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).

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: cannot insert clob in 7.0.2

Post by MaximG » Tue 04 Jul 2017 07:47

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.

Post Reply