SAVE long text (XML code) to CLOB field.

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ovanet
Posts: 2
Joined: Thu 21 Apr 2011 06:10

SAVE long text (XML code) to CLOB field.

Post by ovanet » Thu 21 Apr 2011 06:29

Hi all,

I have this problem. I need save very long text (xml code) to my oracle 10g database. My delphi code is:

Code: Select all

qrySave.SQL.Text := 'insert into APP_HOVORY_SABLONY(id,nazev,xml_kod) values (SEQ_APP_HOVORY_SABLONY.nextval,:temp_name,:templ_xml_kod)';
            qrySave.ParamCheck := true;
            qrySave.ParamByName('temp_name').ParamType :=  ptInput;
            qrySave.ParamByName('temp_name').DataType := ftString;
            qrySave.ParamByName('temp_name').Value := lsTemplName;
            qrySave.ParamByName('templ_xml_kod').ParamType :=  ptInput;
            qrySave.ParamByName('templ_xml_kod').DataType := ftOraClob;
            qrySave.ParamByName('templ_xml_kod').Value := lwsXmlCode;

            qrySave.ParamByName('templ_xml_kod')
           qrySave.ExecSQL;
Exception: Lob locator should be inited or

Please help me. Thank you very nuch

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 21 Apr 2011 07:18

Hello,

To resolve the problem, you should set the TemporaryLobUpdate option to true like:

qrySave.Options.TemporaryLobUpdate:= true;

ovanet
Posts: 2
Joined: Thu 21 Apr 2011 06:10

Post by ovanet » Thu 21 Apr 2011 07:22

Tahank you very much!!! Application run.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 21 Apr 2011 07:30

Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.

Post Reply