Re: PL/SQL how-to procedure
From: Bob Fazio <fazio_at_danet.com>
Date: 1997/04/02
Message-ID: <01bc3f73$438af3a0$64fa03cf_at_bobfazio.danetinc.com>#1/1
Date: 1997/04/02
Message-ID: <01bc3f73$438af3a0$64fa03cf_at_bobfazio.danetinc.com>#1/1
[Quoted] CG <christian.gregory_at_citicorp.com> wrote in article
[Quoted] <333C8093.19A5_at_citicorp.com>...
[Quoted] > ...Can anyone tell me if it is possible to create a procedure
> this select statement will not have an into clause.
You can't do anything but an into clause but the following will do basically the same thing.
declare
- this is just a anonymous block, but it could just as well be a procedure. my_var varchar2(2000); cursor c1 is select name from emp; begin
- simulate the select with the for loop
for c_emp in c1
loop
- use dbms_output.put_line to display the output. dbms_output.put_line(c_emp.name); end loop; end; /
You must however use the dbms_output.put_line and get_line if you want to see what was put out.
use the following with sqlplus to see the output.
set serverout on size 1000000 -- the 1000000 can be any number between 2k and 1M
-- Bob Fazio Oracle DBA Danet, Inc. fazio_at_danet.comReceived on Wed Apr 02 1997 - 00:00:00 CEST