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

Home -> Community -> Usenet -> c.d.o.server -> PL/SQL formatting output question

PL/SQL formatting output question

From: Jim <infosys_at_medfab.com>
Date: Thu, 16 Dec 1999 15:20:30 -0700
Message-ID: <83bs33$ca2$1@news.efn.org>


I have never used PL/SQL for formatting output for a "regular" report. In attempting to use it now am having difficulty seeing how to get the "single record" at a time for dbms_output.put_line. In this instance I would like to have two lines output for every record occurance, thus:
<begin code fragment>

set echo off
set serveroutput on
set line 132
set feedback off
--
DECLARE
 v_name VARCHAR(30);
 v_supplierno VARCHAR(6);
BEGIN
select name,supplierno into v_name,v_supplierno   from suppliers
  where status != 'X';
dbms_output.put_line (v_name);
dbms_output.put_line (v_supplierno);
END;
/
set serveroutput off
set feedback on
<end code fragment>

Now obviously this code will attempt to retrieve all the records at once instead of a record at a time to the dbms_output line. So what is the correct way to accomplish this single record at a time situation? I feel like an idiot that it must be right in front of my face and I don't see it.

TIA
Jim Received on Thu Dec 16 1999 - 16:20:30 CST

Original text of this message

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