Dynamic Sql Limitation
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Dynamic Sql Limitation

  1. #1
    Join Date
    Aug 2004
    Posts
    26

    Dynamic Sql Limitation

    Hi,

    Is there any String length limitation. I have this block, but when I run it I get the error :
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.DBMS_OUTPUT", line 57
    ORA-06512: at line 28

    Please help me....

    DECLARE

    v_sql VARCHAR2 (4000) := ' ';

    CURSOR c_sub IS
    (SELECT distinct meta_columns
    FROM C_SUB_temp
    -- WHERE ROWNUM < 2
    );

    BEGIN

    FOR c_rec IN c_sub LOOP

    v_sql := ' UPDATE C_grp_f_temp A SET ( ' ||c_rec.meta_columns || ' ) = ';
    v_sql := v_sql || ' ( SELECT ' || c_rec.meta_columns || ' FROM C_grp_temp B WHERE ';
    v_sql := v_sql || ' A.CUSTOMER_GROUP_DIM_ID = B.CUSTOMER_GROUP_DIM_ID AND ';
    v_sql := v_sql || ' A.SALES_OFFICE_DIM_ID = B.SALES_OFFICE_DIM_ID AND ';
    v_sql := v_sql || ' A.ACCOUNT_TYPE_DIM_ID = B.ACCOUNT_TYPE_DIM_ID AND ';
    v_sql := v_sql || ' A.REGION_DIM_ID = B.REGION_DIM_ID AND ';
    v_sql := v_sql || ' A.SUB_REGION_DIM_ID = B.SUB_REGION_DIM_ID AND ';
    v_sql := v_sql || ' A.COST_CATEGORY_DIM_ID = B.COST_CATEGORY_DIM_ID AND ';
    v_sql := v_sql || ' A.COMPANY_CODE_DIM_ID = B.COMPANY_CODE_DIM_ID AND ';
    v_sql := v_sql || ' A.FISCAL_YEAR_DIM_ID = B.FISCAL_YEAR_DIM_ID AND ';
    v_sql := v_sql || ' A.ROW_DIM_ID = B.ROW_DIM_ID) ; ';
    DBMS_OUTPUT.put_line(v_sql);
    --execute immediate (v_sql);

    END LOOP;
    END;

  2. #2
    Join Date
    Jan 2004
    Posts
    162
    > ORA-06512: at "SYS.DBMS_OUTPUT", line 57

    Read the error message - which package is the error occuring in?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width