zoukankan      html  css  js  c++  java
  • 通过发票编号取凭证编号,返回多行值,拼接到一起

    function GET_DOC_SEQUENCE_VALUE(P_INVOICE_NUM varchar2) return varchar2 is
    V_DOC_SEQUENCE_VALUE varchar2(2000);
    cursor cur_doc (l_invoice varchar2 )is
    select doc_sequence_value
    from ap_invoices_all
    where invoice_num = l_invoice
    and cancelled_date is null;
    l_count number:=0;
    begin
    begin
    select count(*)
    into l_count
    from ap_invoices_all
    where invoice_num = P_INVOICE_NUM
    and cancelled_date is null;
    exception
    when others then
    V_DOC_SEQUENCE_VALUE := '';
    end;
    for l_cur_doc in cur_doc(P_INVOICE_NUM) loop
    if l_count = 1 then
    V_DOC_SEQUENCE_VALUE:=l_cur_doc.doc_sequence_value;
    else
    if V_DOC_SEQUENCE_VALUE is null then
    V_DOC_SEQUENCE_VALUE:=l_cur_doc.doc_sequence_value;
    else
    V_DOC_SEQUENCE_VALUE:=V_DOC_SEQUENCE_VALUE||','||l_cur_doc.doc_sequence_value;
    end if ;
    end if ;
    end loop ;
    RETURN V_DOC_SEQUENCE_VALUE;
    END;

  • 相关阅读:
    easyui好例子,值得借鉴
    DDL 和DML 区别
    兼容IE的文字提示
    搭代理
    美国服务器
    跟随滚动条滚动
    JS Array对象
    JS 内置对象 String对象
    JS 对象
    JS 二维数组
  • 原文地址:https://www.cnblogs.com/lanminghuai/p/11082003.html
Copyright © 2011-2022 走看看