Re: Doing DESC in Pro*C

From: XU <xux_at_informa.bio.caltech.edu>
Date: 11 Apr 1999 17:08:51 GMT
Message-ID: <7eqkv3$m7r_at_gap.cco.caltech.edu>


Why do you have to do it through "DESC"? There is a data dictionary table called "user_tab_columns", and it contains everything you can get (and much more than you can get) from desc a table. For example, the statement

select column_name, data_type, nullable, data_length, data_precision

	from user_tab_columns 
	where table_name = 'YOUR_TABLE';

is *exactly* the same as what you get from "desc YOUR_TABLE". Just embed the select statement in your program.

Robert XU

Pauil Perkins (paulp_at_despam.penguinpowered.com) wrote:
: Hi All,

: Is there a way to perform a "DESC" on a table using Pro*C. I want to
: enumerate the column names and types for a particular table using Pro*C at
: runtime.

: I've seen that you can do a DESCRIBE on a prepared DSQL statement, but this
: (I think) enumerates the types of the columns contained in the statement -
: i.e. requires prior knowledge of the table.

: I'm trying to write a tool that sniffs out the available tables and displays
: the available columns along with column types.

: Any ideas?

: Thanks,

: Paul.
Received on Sun Apr 11 1999 - 19:08:51 CEST

Original text of this message