Re: Determine a char column length

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 20 Jan 2003 14:15:49 -0800
Message-ID: <2687bb95.0301201415.1a7d1d1d_at_posting.google.com>


"Nuno C. Godinho" <ncg_at_apie.pt> wrote in message news:<Xns93097D2E18888nacgapie_at_213.30.5.12>...
> Hi!
> First of all I'm a newbie on Oracle (until now I use to work on Informix,
> but I'm facing the possibility to be unable to do so for much longer!).
>
> I would appreciate if someone could give me a SQL command for Ora able to
> determine the length of a char column.
> What I intent to do I to convert for Ora the following Ifx SQL command:
>
> select c.collength from systables t, syscolumns c
> where
> t.tabid = c.tabid and t.tabname = 'ctplano' and c.colname = 'conta'
>
>
>
> TIA
> Nuno C. Godinho

Look at Oracle rdbms dictionary view dba_tab_columns which shows the maximum length for a column.

To find the actual length used in a column value use the length function:
select length(col_name2), other_col ... from table_a where ....

Note that the single row functions available in Oracle are listed and explained in the SQL Manual, while the dictionary views are described in the Oracle version# Reference manual.

HTH -- Mark D Powell -- Received on Mon Jan 20 2003 - 23:15:49 CET

Original text of this message