FunctionWithRecord

FunctionWithRecord - Sheet1 Page 2 declare*declare a record...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 CREATE TYPE address as OBJECT (street varchar2(120), city varchar2(30)) / create or replace FUNCTION temp_table RETURN address is add_var address begin dbms_output.put_line('hello') add_var.street:='pune' add_var.city:='pune' end / calling select temp_table.add_var(0).city from dual dbms_output.put_line(emp_tab(0).empno) ____________________________________________________________________________ create type stud_rec as object ( stud_id number(5), v_firstname varchar2(20), v_lastname varchar2(20), address varchar2(20)) create or replace function myfunc return stud_rec is studerec stud_rec begin studerec.stud_id:=101 studerec.v_firstname:='vaishali' studerec.v_lastname:='kadam' studerec.address:='pune' dbms_output.put_line(studerec.stud_id) end / calling function_name(parameter_list).field_name
Background image of page 1

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

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

Unformatted text preview: Sheet1 Page 2 ____________________________________________________________________________ declare /*declare a record type to hold common student information*/ TYPE stud_rec is RECORD( stud_id number(5), v_firstname varchar2(20), v_lastname varchar2(20), address varchar2(20)) /* declare a variable of this type*/ studerec stud_rec begin studerec.stud_id:=101 studerec.v_firstname:='vaishali' studerec.v_lastname:='kadam' studerec.address:='pune' end / ____________________________________________________________________ CREATE OR REPLACE FUNCTION home (INTEGER, INTEGER) RETURNS RECORD AS DECLARE c_fname CHAR(15) pp_i_id1 INTEGER rec RECORD BEGIN SELECT c_fname::CHAR(15), pp_i_id1::INTEGER INTO rec RETURN rec END...
View Full Document

This note was uploaded on 07/15/2011 for the course ECO 2023 taught by Professor Mr.raza during the Summer '10 term at FAU.

Page1 / 2

FunctionWithRecord - Sheet1 Page 2 declare*declare a record...

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