DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: How to make this happen

  1. #1
    Join Date
    Mar 2001
    Posts
    19

    Smile

    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


  2. #2
    Join Date
    May 2002
    Posts
    2,645
    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;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width