OA Framework Tutorial 01 Script
Written by Anil Passi   
Sunday, 24 June 2007

Please find below the script for the First Audio Video Tutorial in OA Framework

create table xx_person_details
(
 PERSON_ID        NUMBER NOT NULL
,FIRST_NAME       VARCHAR2(50)
,LAST_NAME        VARCHAR2(50)
,EMAIL            VARCHAR2(100)
,student_flag     VARCHAR2(1)
,name_of_university VARCHAR2(100)
,last_update_date DATE
,last_update_login INTEGER
,last_updated_by INTEGER
,creation_date DATE
,created_by INTEGER
) ;


CREATE OR REPLACE PROCEDURE xx_insert_person_prc(p_person_rec IN OUT xx_person_details%ROWTYPE) IS
BEGIN
  SELECT per_people_s.NEXTVAL
  INTO p_person_rec.person_id
  FROM dual;
  p_person_rec.last_update_date  := SYSDATE;
  p_person_rec.creation_date     := SYSDATE;
  p_person_rec.last_update_login := -1;
  p_person_rec.last_updated_by   := 71690;
  p_person_rec.created_by        := 71690;
  INSERT INTO xx_person_details
  VALUES p_person_rec;
END xx_insert_person_prc;
/



DECLARE
  l_person_rec xx_person_details%ROWTYPE;
BEGIN
  l_person_rec.first_name   := 'Anil';
  l_person_rec.last_name    := 'Passi';
  l_person_rec.email        := 'passi.anil@gmail.com';
  l_person_rec.student_flag := 'N';
  xx_insert_person_prc(l_person_rec);
  l_person_rec.first_name := 'Tom';
  l_person_rec.last_name  := 'Kumar';
  l_person_rec.email      := 'tom.kumar@gmail.com';
  xx_insert_person_prc(l_person_rec);
  l_person_rec.first_name := 'Mark';
  l_person_rec.last_name  := 'Kapoor';
  l_person_rec.email      := 'tom.kumar@gmail.com';
  xx_insert_person_prc(l_person_rec);
  commit;
END;
/

SELECT count(*)
FROM xx_person_details ;


commit;

Comments (0)add
You must be logged in to a comment. Please register if you do not have an account yet.

busy