Page 1 of 1

SAVE long text (XML code) to CLOB field.

Posted: Thu 21 Apr 2011 06:29
by ovanet
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

Posted: Thu 21 Apr 2011 07:18
by AlexP
Hello,

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

qrySave.Options.TemporaryLobUpdate:= true;

Posted: Thu 21 Apr 2011 07:22
by ovanet
Tahank you very much!!! Application run.

Posted: Thu 21 Apr 2011 07:30
by AlexP
Hello,

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