Oracle Development Common functions

Source: Internet
Author: User

Max Maximum number auto plus 1

Create or Replace function Fun_getmaxlot (       vend in varchar2,       domain in VARCHAR2,       tag in varchar2) RETURN Varch AR2 as  maxval     VARCHAR2 (40); NEWIQC     VARCHAR2 (40); TT         VARCHAR2 (12); Begin     Begin      Select MAX (xsld_lot) into Maxval from     Xsld_det     where xsld_lot like     Upper (tag) | | to_ char (sysdate, ' yyMMdd ') | | Upper (vend) | | ' % ' and      UPPER (xsld_domain) = UPPER (domain);      if (Maxval is null) then         return upper (tag) | | To_char (sysdate, ' yyMMdd ') | | Upper (vend) | | ' 001 ';      End If;      NEWIQC: = replace (maxval, Upper (tag) | | To_char (sysdate, ' yyMMdd ') | | Upper (Vend), ");        TT: = (newiqc*1 + 1) | | ";        For M in LENGTH (TT): (2) Loop            TT: =  ' 0 ' | | TT;        End Loop;        return upper (tag) | | To_char (sysdate, ' yyMMdd ') | | Upper (vend) | | TT;     EXCEPTION when No_data_found and then         RETURN ';     END; END;

Oracle Development Common functions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.