如题。

解决方案 »

  1.   

    CREATE PROCEDURE PRO_LENTH(LEN OUT NUMBER)
    AS 
    BEGIN
    select LENGTH(COL) INTO LEN FROM TAB;
    EXECPTION 
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUTLINE('ERROR');
    END;
      

  2.   

    没听懂你的意思。
    如果是在查询语句中的话直接
    SELECT LENGTH(C1) FROM T;
    如果你说的是存储过程中的话:
    declare
        v_length_c1 number;
    begin
        select length(c1) into v_length_c1 from t;
        dbms_output.put_line(v_length_c1);
    end;
      

  3.   


    m constant integer := 5;  begin
        select INSTR(bar,(select 条码 from BOMKABAIRBAG where 条码 like substr(bar,1,m)),1,1) into x2 from dual;
        if (x2 = 1 and barchk = 0) then -- x2<>2
        begin
          --insert into KABOPTABLE(barcode2) values(bar);
          rchk := 2;
          goto endofproc;
        end;
        end if;
      exception
        when others then
        rchk := 0;
      end;上面是原来存储的一部分代码。其中m是固定的条码长度。现在我想做成可变的长度
    就是怎么把select length(条码) from BOMKABAIRBAG;这个获取的长度在这个存储中付给m那?
    注现在的条码长度是可变的。
      

  4.   

    我想你需要一个数组变量,不知道你是不是这个意思,呵呵type type_arr is table of integer index by binary_integer;
    arr_aa type_arr;
    select length(条码) into aa from BOMKABAIRBAG;
      

  5.   

    select length(col) from tb
      

  6.   

    (bar in varchar2,barchk in integer,rchk out integer)
    ism number;
    x1 integer;
    x2 integer;
    x3 integer;  begin
      select length(条码) into m from BOMKABAIRBAG;
      select INSTR(bar,(select 条码 from BOMKABAIRBAG where 条码 like substr(bar,1,m)),1,1) into x2 from dual;
      if (x2 = 1 and barchk = 0) then -- x2<>2
      begin
      --insert into KABOPTABLE(barcode2) values(bar);
      rchk := 2;
      goto endofproc;
      end;
      end if;
      exception
      when others then
      rchk := 0;
      end;
      

  7.   

    (bar in varchar2,barchk in integer,rchk out integer)
    ism number;
    x1 integer;
    x2 integer;
    x3 integer;  begin
      select length(条码) into m from BOMKABAIRBAG;
      select INSTR(bar,(select 条码 from BOMKABAIRBAG where 条码 like substr(bar,1,m)),1,1) into x2 from dual;
      if (x2 = 1 and barchk = 0) then -- x2<>2
      begin
      --insert into KABOPTABLE(barcode2) values(bar);
      rchk := 2;
      goto endofproc;
      end;
      end if;
      exception
      when others then
      rchk := 0;
      end;