Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: cursor problem.

Re: cursor problem.

From: Vyacheslav Rossov <slava_at_cbank.kz>
Date: 1997/03/16
Message-ID: <332B8643.67C5@cbank.kz>#1/1

Vegard Tollefsen wrote:

  When I call the procedure 'show' I also want to send in an   argument 'grom'.
  I want to use that argument when I define a cursor. Like this:

  create or replace procedure show (grom in varchar2) is   cursor rad is select * from Rom

                  where Type=grom
                  and Stoerrelse>=6
                  and Stoerrelse<=15;

  r rad%rowtype;
  begin
  open rad;
  fetch rad into r;
  htp.print
  (r.Romnummer||r.Stoerrelse||r.Blokk||r.Etasje||r.Type||r.Status);   end
  /

  But this dont work the way it should. Why??   Thanks.

You need to create cursor with parameter:

create or replace procedure show (grom in varchar2) is

cursor rad(your_param in varchar2 ) is select * from Rom

                where Type=your_param
                and Stoerrelse>=6
                and Stoerrelse<=15;

r rad%rowtype;
begin
open rad(grom);
fetch rad into r;
htp.print
(r.Romnummer||r.Stoerrelse||r.Blokk||r.Etasje||r.Type||r.Status); end
/ Received on Sun Mar 16 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US