Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Define ROWTYPE in Oracle

Posted on 2007-11-19
4
Medium Priority
?
1,983 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 Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
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.

610 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