• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

pl/sql error

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic