?
Solved

Define ROWTYPE in Oracle

Posted on 2007-11-19
4
Medium Priority
?
1,981 Views
Last Modified: 2010-04-21
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
Comment
Question by:SunDevilProgrammer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 20317723
can you paste you code please.
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 20317865
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
 
LVL 28

Accepted Solution

by:
Naveen Kumar earned 200 total points
ID: 20317946
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
 

Author Closing Comment

by:SunDevilProgrammer
ID: 31410059
Thanks, nav kum v!  Actually just this morning I figured it out, but you still deserve credit for this.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question