Click to See Complete Forum and Search --> : How to make this happen


seenu27
07-17-2002, 12:14 PM
I have an output like this

Name Indicator
================
FERAR OTR17
FORDO OTR17
KEOLA DCT
LIBRA OTR20
LOTUS OTR17
PETAL OTR20
PUPPI DCT
RENAU OTR18
SUNNS OTR20
SYVAD V16
VIRGO OTR20

I need an output something like this:

FERAR ORT17 FORDO KEOLA DCT LIBRA OTR20 LOTUS etc., IS THAT POSSIBLE???.

Can anyone help me out please.

Table Details are as follows:

TABLE NAME :: forms
Columns :: Name, Indicator, formid

thanks
Srini

stecal
07-17-2002, 12:29 PM
You will be using PL/SQL as the best way to do this.
Pseudocode/general outline of what you need to do:

Declare
string_list varchar2(2000);
v_name varchar2(50);
v_indicator varchar2(10);
Cursor string_value is
select name, indicator into v_name, v_indicator from forms;

Begin
--start a loop, read in the name & indicator into your cursor
--append v_name||chr(32)||v_indicator to the string
-- use chr(32) to create the space between name & indicator
Next record
Do unitl no records found
dbms_output.put_line (string_list)
End;