File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes pl/sql error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "pl/sql error" Watch "pl/sql error" New topic

pl/sql error

Masood Khan

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,
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;

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


end if;
end loop;

here is the error msgs...
-------- -----------------------------------------------------------------
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: 15096

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
I agree. Here's the link:
subject: pl/sql error
It's not a secret anymore!