triggers lab pt1

triggers lab pt1 - 1.) SQL> select find_circle_area (4),...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1.) SQL> select find_circle_area (4), sysdate from dual; FIND_CIRCLE_AREA(4) SYSDATE ------------------- --------- 50.2654825 19-MAR-08 SQL> Drop Function find_square_area; Function dropped. SQL> Create Function find_square_area (p_side IN number) 2 Return Number Is 3 My_area number :=0; 4 Begin 5 My_area :=(p_side*p_side); 6 Return My_area; 7 END; 8 / Function created. 2.)SQL> CREATE OR REPLACE PROCEDURE insertCustomerAgent ( 2 cid IN CHAR, cname IN VARCHAR, city IN VARCHAR2, 3 discnt IN REAL, aid IN char, aname IN varchar , percent number) IS 4 5 BEGIN 6 INSERT INTO Customers VALUES (cid, cname, city, discnt); 7 INSERT INTO Agents VALUES (aid, aname, city, percent); 8 END; 9 / Procedure created. SQL> exec insertCustomerAgent ('c007', 'Goldberg', 'Palo Alto', 15, 'a08', 'Kay',9); PL/SQL procedure successfully completed. SQL> select * from customers; CID CNAME CITY DISCNT ---- ------------- -------------------- ---------- c001 Tiptop Duluth 10 c002 Basics Dallas 12 c003 Allied Dallas 8 c004 ACME
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

triggers lab pt1 - 1.) SQL> select find_circle_area (4),...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online