Topic: Oracle Certified Professional Exams (OCP & OCA) >> help on PROCEDURE
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| RK |
Posted: Jun 11, 2007 02:31:51 PM |
Total Post: 37
Joined: Apr, 2007
|
create table item_details
(item_code number(5) not null,
item_name varchar2(50) not null,
quantity number(5),
sp_price number(8,2),
constraint con_pk_itemcode primary key(item_code))
/
--the above is the table
--the below is the procedure on the above table to insert data
create or replace procedure proc_id
(v_itemcode IN item_details.item_code%type,
v_itemname IN item_details.item_name%type,
v_quantity IN item_details.quantity%type,
v_sp IN item_details.sp_price%type)
is
begin
insert into item_details
values(v_itemcode,v_itemname,v_quantity, v_sp);
end proc_id;
/
--the below is a plsql block
declare
v_itemcode item_details.item_code%type;
v_itemname item_details.item_name%type;
v_quantity item_details.quantity%type;
v_sp item_details.sp_price%type;
begin
for i in 1..2 loop
execute proc_id(&v_itemcode,'&v_itemname',&v_quantity,&v_sp);
end loop;
end;
/
NOW MY DOUBT IS when i execute the 3rd block indivually it gives error.please help me on this area....I AM USING ORACLE 9i ENTERPRISE..
|
|
|
sudha |
| Posted: Jun 11, 2007 03:54:25 PM | |
|
Total Post: 15
Joined: Jan, 2007
|
|
|
|
|
RK |
| Posted: Jun 11, 2007 11:17:26 PM | |
|
Total Post: 37
Joined: Apr, 2007
|
Sudha thanx for replying.But i can not uderstand what u wrote.plz b elaborative...
|
|
|
|
|
chinna |
| Posted: Jun 11, 2007 11:51:23 PM | |
|
Total Post: 28
Joined: May, 2007
|
hi,rk
execute(&value1,&value2....)
According to my view,
during compilation only it promts for a value and while execution same values it takes,and it may not loop just take the only once.
thanks
srawan
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Vinoth Kumar | 357 |
| Gopu Gopi | 340 |
| Gitesh Trivedi | 322 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|