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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Sql Query

Re: Sql Query

From: Mladen Gogala <gogala_at_sbcglobal.net>
Date: Thu, 04 May 2006 22:29:48 -0400
Message-Id: <1146796188l.2810l.2l@medo.noip.com>


Here is a fairly straightforward SQL which does precisely what you want.

DECLARE outl VARCHAR2(32767);
CURSOR csr IS
SELECT TABLE_NAME
FROM all_tables;
BEGIN
  FOR c IN csr
  LOOP
    outl := outl || c.TABLE_NAME || ',';   END LOOP;   DBMS_OUTPUT.PUT_LINE(TRIM(TRAILING ','   FROM outl));
END;
/

On 05/04/2006 02:11:38 PM, Sanjay Mishra wrote:
> Sql Gurus
>
> I need to create the sql script that can display all tables from user_tables in one line seperated by ",". Is there any straighforward SQL that can display the result in Horizontal instead of single table in each row.
>
> Regds
> Sanjay
>
>
> ---------------------------------
> Yahoo! Mail goes everywhere you do. Get it on your phone.

-- 
Mladen Gogala
http://www.mgogala.com

--
http://www.freelists.org/webpage/oracle-l
Received on Thu May 04 2006 - 21:29:48 CDT

Original text of this message

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