1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

function of 'to_clob'.,

Discussion in 'SQL PL/SQL' started by Vicky, Apr 1, 2014.

  1. Vicky

    Vicky Forum Advisor

    Messages:
    261
    Likes Received:
    11
    Trophy Points:
    260
    Location:
    Chennai
    Can any 1 xplain me the func of the followng procedure.,.?!

    PROCEDURE p_assign_xml_result(o_result_xml OUT CLOB)
    IS
    BEGIN
    o_result_xml := o_result_xml || to_clob('');
    END p_assign_xml_result;
     
  2. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    626
    Likes Received:
    129
    Trophy Points:
    810
    Location:
    Russian Federation
    This

    1) to_clob('') this ALWAYS returned NULL ,because '' == NULL

    As a result we will receive:

    o_result_xml := o_result_xml || NULL => o_result_xml

    See link :
    to_clob
     
    Vicky likes this.
  3. Vicky

    Vicky Forum Advisor

    Messages:
    261
    Likes Received:
    11
    Trophy Points:
    260
    Location:
    Chennai
    Tnx, Krasnoslobodtsev.,

    But 1 question., Then Y they hav added "|| to_clob('')", it's better to write 'o_result_xml' alone, right?!
     
  4. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    626
    Likes Received:
    129
    Trophy Points:
    810
    Location:
    Russian Federation
    Yes, concatenation execution in this expression with NULL - unnecessary action.
    It is correct to return variable value o_result_xml
     
  5. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Honestly this appears to be a useless procedure; I expect it's part of a package that uses this to insert a NULL CLOB value into a table. Again, on its own it seems to be wasted work.