If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > problem in executing procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-01-04, 17:51
sam70 sam70 is offline
Registered User
 
Join Date: Apr 2004
Location: USA
Posts: 14
Post problem in executing procedure

I am beginner in PL/SQL and getting difficulty in executing following procedure ,i am going through one of book , please guide me
-------------------------------------------------------------
create or replace procedure total_salary
IS
cursor employee_cur IS
select lname,salary,commision from employee;

v_last employee.lname%type;
v_sal employee.salary%type;
v_commi employee.commision%type;
v_total_sal employee.salary%type;
begin

open employee_cur;
fetch employee_cur into v_last,v_sal,v_commi;
while employee_cur%found loop
v_total_sal := v_sal +nvl (v_commi,0);
if v_total_sal < 50000 then
dbms_output.put_line(v_last || 'makes $ ' || to_char (v_total_sal));

end if;
fetch employee_cur into v_last,v_sal,v_commi;
end loop;
close employee_cur;
end;

------------------------------------
I am typing this procedure in notepad and i dont know where to save and how to execute it;

Please help me
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On