Returning an Oracle generated GUID through an out parameter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jerico1313
    New Member
    • May 2009
    • 2

    Returning an Oracle generated GUID through an out parameter

    I am returning the following error when i try to pass an oracle generated GUID through an out parameter. Here is the following error message from SQL+ worksheet:

    BEGIN Project.spm_Dat aInsertTest ( ' ', :out_PPLorgGUID , :out_SubNo); END;

    *
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 1

    Below is the Test Stored Procedure code:

    (
    in_PPLorgGUID IN VARCHAR2,
    out_SubNO OUT NUMBER,
    out_PPLorgGUID OUT VARCHAR2
    )
    IS

    pplGUID VARCHAR2(38);
    subno NUMBER;
    checksum NUMBER;
    newsubno NUMBER;

    BEGIN

    SELECT Project.seq_Sub No.nextval INTO subno FROM dual;
    SELECT Project.fnm_get checksum(subno) INTO checksum FROM dual;
    newsubno := subno || checksum;

    -- SAVE contact and subscriber
    SELECT sys_guid() INTO pplGUID FROM dual;
    DBMS_OUTPUT.put _line (pplGUID);

    out_SubNo := newsubno;
    out_PPLorgGUID := RAWTOHEX(pplGUI D);

    RETURN;
    end spm_DataInsertT est;

    Any help would be greatly appreciated. thanks in advance for your time and insights.
  • Jerico1313
    New Member
    • May 2009
    • 2

    #2
    SOLVED!

    the error was not in the stored procedure. It was how i was initilaizing the out parameters in the SQL+ worksheet command.

    Comment

    Working...