存储过程:
PROCEDURE AEPR_SPLITARGUMENT ( in_value         IN    sp_noma.parameter_str%TYPE,
                               out_value        OUT   ae_generalfuncsheet.argument%TYPE,
                               out_value_ext    OUT   ae_generalfuncsheet.argument_ext%TYPE
                             )
IS
v_temp                      VARCHAR(255);
v_pos                       SMALLINT;
v_len                       SMALLINT;
BEGIN
    v_len := LENGTHB(in_value);
    IF v_len > 254
    THEN
        v_temp := SUBSTRB(in_value,1,v_len/2);
        v_pos := INSTRB(v_temp,'|',-1,1);
        out_value := SUBSTRB(in_value,1,v_pos);
        if v_len - v_pos > 255
        then
            out_value_ext := SUBSTRB(in_value,v_pos +1,255); -- v_pos
        else
            out_value_ext := SUBSTRB(in_value,v_pos +1);
        end if;
    ELSE
        out_value := in_value;
        out_value_ext := NULL;
    END IF;END;
参数信息:
sp_noma.parameter_str   VARCHAR2(500)
ae_generalfuncsheet.argument  VARCHAR2(255)
ae_generalfuncsheet.argument_ext  VARCHAR2(255)
例子:
输入参数值-login=330382766419542@wzgs|password=419542|homeid1=57700|homeid2=57703|taxno=330382766419542|namec=温州市瓯丽斯出口产品国际展贸中心有限公司雁荡山购物中心|idtype=200|idno=330382766419542|companytype=1300|contactname=苏立文|contactphone=1|contactaddress=不祥|contactpostcode=不祥|connectiontype=100|usertype=100|createt=2005-10-25|expirationtime=0|paymenttype=300|agenttaxno=330323725234015|agreementno=3302|paytaxtype=200|address=温州市瓯丽斯出口产品国际展贸中心有限公司雁荡山购物中心|.执行后出错:ORA-20000: ORU-10028: line length overflow, limit of 255 bytes per line测试:如果将out_value_ext := SUBSTRB(in_value,v_pos +1);改为
out_value_ext := SUBSTRB(in_value,1,240);可以,而且不同的oracle数据库240这个值变化,即有的可以是250.不知什么原因?怎么解决?

解决方案 »

  1.   

    执行结果信息:
    9:45:04  Starting execution of PL/SQL block...
    out_value = login=330382766419542@wzgs|password=419542|homeid1=57700|homeid2=57703|taxno=330382766419542|namec=温州市瓯丽斯出口产品国际展贸中心有限公司雁荡山购物中心|idtype=200|idno=330382766419542|companytype=1300|contactname=苏立文|contactphone=1|
    Error -20000: ORA-20000: ORU-10028: line length overflow, limit of 255 bytes per line
    9:45:04  Execution failed: ORA-20000: ORU-10028: line length overflow, limit of 255 bytes per line
    9:45:04  ORA-06512: at line 16
    9:45:04  End Executing PL/SQL block
      

  2.   

    我是用 SQL Navigator执行后输出东西DECLARE
    out_value VARCHAR2(255);
    out_value_ext VARCHAR2(255);
    BEGIN-- Now call the stored program
      aepr_splitargument('login=330382766419542@wzgs|password=419542|homeid1=57700|homeid2=57703|taxno=330382766419542|namec=温州市瓯丽斯出口产品国际展贸中心有限公司雁荡山购物中心|idtype=200|idno=330382766419542|companytype=1300|contactname=苏立文|contactphone=1|contactaddress=不祥|contactpostcode=不祥|connectiontype=100|usertype=100|createt=2005-10-25|expirationtime=0|paymenttype=300|agenttaxno=330323725234015|agreementno=3302|paytaxtype=200|address=温州市瓯丽斯出口产品国际展贸中心有限公司雁荡山购物中心|',out_value,out_value_ext);-- Output the results
    dbms_output.put_line(SubStr('out_value = '||out_value,1,255));
    dbms_output.put_line(SubStr('out_value_ext = '||out_value_ext,1,255));EXCEPTION
    WHEN OTHERS THEN
      dbms_output.put_line(SubStr('Error '||TO_CHAR(SQLCODE)||': '||SQLERRM, 1, 255));
    RAISE;
    END;