Get order arrangement

Source: Internet
Author: User

CREATE OR REPLACE PROCEDURE campaignprize_range (Campaignidd number,prizetypeidd number,serverindex VARCHAR2, RETVAL out   VARCHAR2) is hashcoded VARCHAR2 (8);   Prizetypenum number (6);   Prizetypenumold number (6);   PRIZETYPENUMC VARCHAR2 (6);   TotalCount number (6);   Flag number (1); Single number (6);  BEGIN flag:=0;  RETVAL: = ";  single:=0; SELECT count (1) into TotalCount from Mkt_campaignprize a WHERE A.campaignid=campaignidd and A.issend=0 and a.prizetypeid=p Rizetypeidd and a.hashcode like ' | | serverindex| | '  % ' ORDER by a.campaignprizeid ASC;  DECLARE CURSOR C1 is SELECT A.hashcode,a.campaignprizeid from Mkt_campaignprize a WHERE A.campaignid=campaignidd and A.issend=0 and A.prizetypeid=prizetypeidd and a.hashcode like ' | | serverindex| | '  % ' ORDER by a.campaignprizeid ASC;         BEGIN for R1 in C1 LOOP single:=single+1;          If Flag=0 then prizetypenumold:= to_number (substr (r1.hashcode,3,6));           RETVAL: =prizetypenumold; If Totalcount=siNgle then RETVAL: =retval| | ', ' | | prizetypenumold| | '             $ ';          End If;          Flag:=1;             else prizetypenum:=prizetypenumold+1;             Prizetypenumc:=lpad (prizetypenum,6, ' 0 '); hashcoded:=serverindex| |             PRIZETYPENUMC;             If Hashcoded=r1.hashcode then prizetypenumold:=prizetypenum; else RETVAL: =retval| | ', ' | | prizetypenumold| | '               $ ';               prizetypenumold:= To_number (substr (r1.hashcode,3,6)); RETVAL: =retval| |             Prizetypenumold;             End If; If Totalcount=single then RETVAL: =retval| | ', ' | | prizetypenumold| | '             $ ';          End If;       End If;    END LOOP;  END; Exception when others then RETVAL: = ' E ' | | SUBSTR (SQLERRM, 1, 600); END Campaignprize_range;

Get order arrangement

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.