delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

    '<test><something>some value</something></test>';
  dbms_lob.writeappend(
    lob_loc => p_xml,
    amount  => length(lv_xml),
    buffer  => lv_xml
  );
end p_xml_test_2;
I'm wondering if the first method will cause any problems for me down the road. Is it ok to do it that way? What is the advantage, if any, to the second method? Thanks!


I would like to create some PL/SQL procedures that return XML as CLOB parameters. I want to just do this (which works fine with simple tests):
Code:
  1. create or replace procedure p_xml_test_1(
  2.   p_xml out nocopy clob
  3. ) is
  4. begin
  5.   p_xml := '<?xml version="1.0" encoding="utf8" ?>' ||
  6.     '<test><something>some value</something></test>';
  7. end p_xml_test_1;
Copy Code
But I have access to some other source code that basically does this:
Code:
  1. create or replace procedure p_xml_test_2(
  2.   p_xml out nocopy clob
  3. ) is
  4.   lv_xml clob;
  5. begin
  6.   dbms_lob.createtemporary(
  7.     lob_loc => p_xml,
  8.     cache   => true
  9.   );
  10.   lv_xml := '<?xml version="1.0" encoding="utf8" ?>' ||
  11.     '<test><something>some value</something></test>';
  12.   dbms_lob.writeappend(
  13.     lob_loc => p_xml,
  14.     amount  => length(lv_xml),
  15.     buffer  => lv_xml
  16.   );
  17. end p_xml_test_2;
Copy Code
I'm wondering if the first method will cause any problems for me down the road. Is it ok to do it that way? What is the advantage, if any, to the second method? Thanks!

TOP

you need to use the second approach.



    '<test><something>some value</something></test>';
  dbms_lob.writeappend(
    lob_loc => p_xml,
    amount  => length(lv_xml),
    buffer  => lv_xml
  );
end p_xml_test_2;
I'm wondering if the first method will cause any problems for me down the road. Is it ok to do it that way? What is the advantage, if any, to the second method? Thanks!

TOP

Back Forum