• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1989
  • Last Modified:

Define ROWTYPE in Oracle

In defining a REF CURSOR, I defined an entire Row as the ROWTYPE.  But I got an error message when I chose only three of the fields.  However, when I chose to retrieve the entire row it compiled just fine.  I want to know a way to define a new ROWTYPE that would enable retrieving only the specified rows.  Any help??

Thanks,

SunDevil
0
SunDevilProgrammer
Asked:
SunDevilProgrammer
  • 2
1 Solution
 
Naveen KumarProduction Manager / Application Support ManagerCommented:
can you paste you code please.
0
 
sdstuberCommented:
rowtype means "this type is a copy of the entire row"

you can define records that correspond to a subset of the columns in a row, but a "row type" is by-definition an entire row.
0
 
Naveen KumarProduction Manager / Application Support ManagerCommented:
try creating a record as shown below :

create type testing_record is  record
( r_empid emp.empid%type,
  r_empname emp.empname%type );

rec_var testing;

while fetching data you can use rec_var in the select/fetch statement.

Refer to the url below for more info on records :

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/collections.htm#i20479

Thanks
0
 
SunDevilProgrammerAuthor Commented:
Thanks, nav kum v!  Actually just this morning I figured it out, but you still deserve credit for this.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now