aspose file tools*
The moose likes JDBC and the fly likes pl/sql error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "pl/sql error" Watch "pl/sql error" New topic
Author

pl/sql error

Masood Khan
Greenhorn

Joined: Nov 24, 2005
Posts: 4
plz do let me know why am i getting this error below is the code followed by the error msgs.

create or replace procedure dnsp is

cursor s1 is select splr.s_num, splr.s_name,
cnts.c_area_code,cnts.c_phone
from supplier splr, supplies spls,contacts cnts
where splr.s_num not in(select distinct spls.s_num from supplies
spls) and splr.s_num=cnts.s_num
order by splr.s_num;

l_num supplier.s_num%type :=0;

begin
DBMS_OUTPUT.PUT_LINE('No Purchases have been made from the
following supplier');

for cursor_r in s1 loop
if l_num != current_row.s_num then

DBMS_OUTPUT.PUT_LINE('Supplier'||current_row.s_name||'(number'||tochar(current_row.s_num)||')');

end if;
end loop;
end;
/

here is the error msgs...
LINE/COL ERROR
-------- -----------------------------------------------------------------
17/2 PL/SQL: Statement ignored
17/14 PLS-00201: identifier 'CURRENT_ROW.S_NUM' must be declared
plz do let me know wht mistake am i making in the above code as soon as possible thanks...
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14433
    
  23

This is not a Java or JDBC question, you'd better ask this to an SQL expert. The error message is quite clear, though. It means that "CURRENT_ROW.S_NUM" is not a valid identifier of a variable. You probably wanted to write:

for cursor_r in s1 loop
if l_num != cursor_r.s_num then

(instead of current_row.s_num). But I'm not a PL/SQL expert, so I might be wrong.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
wood burning stoves
 
subject: pl/sql error