section 3 sp - 1)Assignment solution:create or replace procedure p2(X in number y in number result out number As begin if y=0 then begin

section 3 sp - 1)Assignment solution:create or replace...

This preview shows page 1 - 3 out of 3 pages.

1)Assignment solution:- create or replace procedure p2(X in number, y in number, result out number) As begin if y=0 then begin dbms_output.put_line('invalid'); return; end; end then else begin result:=x/y; dbms_output.put_line(result); end; end else end if; end p2; declare res number; begin p2(25,0,res); end; 2)create a procedure that insert values into table department (dept_name, dept_no) create or replace procedure fill_dept(dname in department.dept_name%type, dno in department.dept_no%type) As Begin if dname is null then begin dbms_output.put_line('dept name cant be null'); return; end; else insert into department values(dno,dname); end if; end fill_dept; begin fill_dept('new dept',44); end; to check the null condition begin fill_dept(null,44); end; 3)--building (b_no,kind,address,status) --customer (c_id,c_name) --cust_build (s_no,b_no,c_no) a)-- get the building number given the kind,add and status should be 'available'.
Image of page 1
create or replace procedure checkstatus(add in building.address%type,knd in building.kind%type) As stat varchar2(25); bn number;
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 3 pages?

  • Fall '08
  • 5odfatrek
  • Following, Stored procedure, following tables, procedure p2

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes