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
Solved

how to set the pass the parameter for %rowtype

Posted on 2011-03-01
2
809 Views
Last Modified: 2012-05-11
Please find the structure of Storeprocedure. The  emp_in   is taking parameter of emp%rowtype ;  emp being table in the database.
Now  when I need to execute blow sp, I need set the value for    emp_in      and pass as param.  how to set the value and execute the sp.
procedure emp_store(
        emp_in          emp%rowtype,
        inserted_ind_out            out pkg_util.TYPE_FLAG,
        emp_id_out      out emp_id%type
        );
0
Comment
Question by:chaitu chaitu
2 Comments
 
LVL 28

Accepted Solution

by:
Naveen Kumar earned 400 total points
ID: 35005994
first fetch that into a variable and then pass it accordingly as shown below :

declare
myrec_var emp%rowtype;
begin

select * into myrec_var from emp where empno = 100;

emp_store(myrec_var,.... );

end;
/
0
 
LVL 1

Assisted Solution

by:sunil_rangineni
sunil_rangineni earned 100 total points
ID: 35015951
What nav_kum_v said is correct. For a single record, you can use %rowtype. But if you wanna process multiple reocords or huge set of data, you need to use collections. Refer the below documentation for more details.
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/05_colls.htm
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

856 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