Re: DESCRIBE IN PRO*C?

From: Scott Urman <surman_at_wwsun10.us.oracle.com>
Date: 27 Sep 1994 21:13:49 GMT
Message-ID: <36a1ud$pgj_at_dcsun4.us.oracle.com>


In article <CwsxA3.Eou_at_rahul.net>, Mike Stuart <mstuart_at_rahul.net> writes:
|> Hi There,
|>
|> I'm new to pro*c and I don't have any books on it, but I've been
|> working with some "oracle provided" online example code. I'm trying
|> to use the describe command to query table definitions via
|> EXEC SQL
|> DESCRIBE table_name
|>
|> I receive an "Invalid Command" compile error.
|>
|> None of the oracle examples use the describe command, but I assume it
|> can be done. Does anybody out ther know the syntax for this?
|>
|>
|> Thanx in advance,
|>
|> Mike Stuart ( mstuart_at_rahul.net )
|> --
|> Mike Stuart <mstuart_at_rahul.net>

Nope, can't be done, that way at least. 'describe' is a sqlplus command, like 'spool' or 'host'. Commands like this are valid only in sqlplus (or sqldba for most of them). If you want to find out the column names and datatypes for a particular table, you can query the data dictionary yourself (select from user_tab_columns or all_tab_columns) (this is probably what sqlplus itself does) or you could describe the select list of a 'select * from tablename' query, using dynamic method 4. If you go the latter route, I definitely recommend the Pro*C Supplement to the Oracle Precompilers. It has a chapter on dynamic method 4, going into lots and lots of gory detail. Received on Tue Sep 27 1994 - 22:13:49 CET

Original text of this message