The document defines tables and procedures for a bank account management system. It creates two tables to store bank account and personal details information. It then defines five procedures - one to create a new account, one to get an account balance by reference, one to get an account balance by function return, one to define a cursor type, and one function to return account details matching an account type using a cursor.
The document defines tables and procedures for a bank account management system. It creates two tables to store bank account and personal details information. It then defines five procedures - one to create a new account, one to get an account balance by reference, one to get an account balance by function return, one to define a cursor type, and one function to return account details matching an account type using a cursor.
The document defines tables and procedures for a bank account management system. It creates two tables to store bank account and personal details information. It then defines five procedures - one to create a new account, one to get an account balance by reference, one to get an account balance by function return, one to define a cursor type, and one function to return account details matching an account type using a cursor.
accnumber number, actype number,acname varchar2,amt number,addr varchar2, phno number) is begin insert into bank values(accnumber,acname,amt,actype); insert into personal_details values (accnumber,addr,phno); end; /
2.create or replace procedure getBalance(acno number,amt OUT number) is
begin select bal into amt from bank where accno=acno; end; / 3.create or replace function getBalanceF(acno number) return number as amt number; begin select bal into amt from bank where accno=acno; return amt; end; / 4.create or replace package mypack as TYPE mycursor is REF CURSOR; end; / 5.create or replace function getAccountDetails(actype number) return mypack.mycursor as myresult mypack.mycursor; begin open myresult for select accno,name,bal from bank where acctype=actype; return myresult; end; /