Home » SQL & PL/SQL » SQL & PL/SQL » how to read the data from type created as table
how to read the data from type created as table [message #18756] Wed, 13 February 2002 07:13 Go to next message
ksr
Messages: 112
Registered: January 2002
Senior Member
Hi,

I have few questions

1) How to create a type of table(or like table)

2) How do i assign the data to this type which is a selection of records from another select statement

3) How do i read all the columns in a loop from this type of table

Any example will be useful..

any help is appreciated
Re: how to read the data from type created as table [message #18758 is a reply to message #18756] Wed, 13 February 2002 07:30 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
How to create a type of table(or like table)
------------------------------------------
what do u mean by type of table.do u mean pl/sql table of records ?
Re: how to read the data from type created as table [message #18761 is a reply to message #18756] Wed, 13 February 2002 08:04 Go to previous messageGo to next message
ksr
Messages: 112
Registered: January 2002
Senior Member
Hi,
I mean something like

type cur1 is table of tab1%rowtype;
Re: how to read the data from type created as table [message #18775 is a reply to message #18756] Wed, 13 February 2002 23:46 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
here is an example

declare
type cur1 is table of emp%rowtype index by binary_integer;
a cur1;
cursor abc is select * from emp;
n number:=0;
begin
for tmp in abc
loop
n:=n+1;
a(n).ename:=tmp.ename;
a(n).sal:=tmp.sal;
end loop;
end;
Previous Topic: Re: SQL TUTORIAL.
Next Topic: how do i delete the records
Goto Forum:
  


Current Time: Fri Apr 19 14:08:36 CDT 2024