sql2 1510

sql2 1510



FUNCTION tot sales

(company_id_in IN company.company_id%TYPE, status_in IN order .status_code%TYPE:=NUr,l.)

RETURN NUMBER IS

/♦Internal upper-cased version of status codę */ status_int order.status_codc%TYPE:=UPPER(status_in);

Declaration


/♦Paramclcrizcd cursor returns total discounicd sales. ♦/ CURSOR sales cur {status in IN status code%TYPE) 1S SELECT SUM (amount*discount)

•—

FROM item

WHERE EXISTS {SELECT 'X' FROM order WHFRE order.order_id=i tem.order_id AND company id=company id in AND status_codc LIKE status_in) ;

/♦Return valuc for function*/ return value NUMBER;

BEGIN

OPFN sales_cur {status_int);

FETCH sales_cur INTO return_value;

Execution


IF sales_cur%NOTFOUND

THEN

CLOSE salcs_cur;

RETURN NULL;

ELSE

CLOSE sales cur;

RETURN return_value;

END IF;

END tot_sales;


Wyszukiwarka

Podobne podstrony:
sql2 1507 PROCEDURĘ update_management (company_id_in IN NUMBER) IS BEGIN BEGIN ____ UPDATE employee
sql2 1507 PROCEDURĘ update_management (company_id_in IN NUMBER) IS BEGIN BEGIN ____ UPDATE employee
5.    Cognitive functions and level of stress in schizophrenia-like psychoses before
Proof of Theorem 1. Fix K G In order to show (4) we introduce the function g(z) = 1 — 1 k(z)- We ado
sql2 0402 BEGIN DECLARE emp_id emp.empno%TYPE; new_emp emp_id%TYPE; Data Dictionary EMP Tabie -
I INEWTON WIELOWYMIAROWY - liczenie Jakobianu:function t out ] = newton_nwym_jakobian( in ) iout =
ButtonholesVertical Buttonholes On ii I x I ribbing. thc huttonholc is wnrkcd over a purl .stirch. I
so ii is only necessary to adopt ihc propcr refcroncc levcls in order (o mect thc new IHFM stan
Przygotowany program do wysyłania 3 Chomikowe rozmowy;) Lp Id profilu Status » niedziela « 27 luty 2
must be performed in order to implement a high performance hardware component that carries out the o
(31) In order to increase the availability of information on the use of medicinal products in t
The goals of Design Survey are to (1) provide an introductory knowledge of design in order to assist
_a EWifeOLGPRS Performance - Performance evaluation • Three test environments are defined in order t
skanowanie0043 (8) could re-teach the lesson, how well the teacher feels s/he performed as an EFL te

więcej podobnych podstron