Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQLPLUS: how to make results appear in a line fashion
It also would just plain not work. The union would still give you the
values one per row. The only way that I can think of doing this would
be to create a function ( inline_joe_col2, for example ). Then you
would do a "select inline_joe_col2 from dual;" This function would
create a cursor as select col2 from joe and loop through it,
concatenating the value to a variable, which would be returned by the
function when it finished. You could use the DBMS_SQL package to make
the function be applicable to any column in any table, but you get the
general idea. This question seems to be asked a lot. I think a few
people have said that they have solutions on their web sites, but I'm
not sure who or where. Oracle would probably make a lot of customers
happy if they made a function to do this.
Hth,
-Jeff Guttadauro
On Tue, 27 Jul 1999 13:50:46 GMT, hlh_nospam_at_excite.com (Howard Lee Harkness) wrote:
>>AleX <korrozia_at_my-deja.com> news:7niumh$83u$1_at_nnrp1.deja.com asked:
>>> Is there a way to make the results appear like this
>>> FLO> select col2 from joe;
>>>
>>> COL2
>>> -----
>>> 2, xzc, ccxc, cxcx, xcx, zxz
>>>
>>> 6 rows selected.
>>>
>>> Any help is appreciated!
>[snip]
>On Tue, 27 Jul 1999 12:22:24 +0900, "Kyoungrok, Lee"
><tunnel_at_hanmail.net> answered:
>>Make a view.
>>
>>create or replace view view_name
>>as select col2 from joe where col2 = '2'
>>union
>> ...
>>select col2 from joe where col2 = 'zxz';
>
>This solution assumes the user knows the contents of the columns. In
>the general case, that would not be true.
>
>hlh_NOSPAM_at_excite.com is a valid, unmunged address!
>It is also so full of spam(!) that I don't read it.
Received on Tue Jul 27 1999 - 09:05:17 CDT
![]() |
![]() |