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

Home -> Community -> Usenet -> c.d.o.tools -> Re: A small view of a table

Re: A small view of a table

From: Holger Kreft <Holger.Kreft_at_sutter.de>
Date: Fri, 24 Nov 2000 09:48:09 +0100
Message-ID: <3a1e2b6a$1@news.ic-marl.de>

Francesco Marchioni <Francesco.Marchioni_at_lastminutetour.com> schrieb in im Newsbeitrag: 8viqrt$dik$1_at_marte.lastminutetour.com...
> I'd like to know if it's possible to do ,with a single statement,
> a select of the first 5 characters from all fields in a table.
> I have tried this:
> select substr(*,0,5) from mytable
> and this:
> select substr((select * from mytable),0,5) from mytable
> but none worked. As a matter of fact I could easily create a view,
>[...]>

Hi Francesco,

your problem is not a question wether to use a view or not. You simply cannot use the '*' as placeholder for all fields in a function call. So you will have to list all fields explicitly:

select substr( a, 1, 5 ), substr( b, 1, 5 ), ... from mytable;

regards

--
Holger Kreft
====================
Verlion GmbH, Essen
Received on Fri Nov 24 2000 - 02:48:09 CST

Original text of this message

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