Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1985
  • 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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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