in reply to 'Describe table' doesn't work (Oracle/dbiproxy)
Warning: This method is experimental and may change.don't worry -- there's a reasonable alternative using a query to oracle's own "data dictionary" tables. Here's a query that I've used to get something pretty similar to the output of "describe" -- just do your normal "prepare, execute, fetch_row" sequence using this query, and the results will be the list of columns and some of their attributes:
(Just have a scalar variable that holds the table name in ALL_CAPS, and provide that variable when you "execute" the prepared statement.) That query might not tell you everything you want to know about the definitions of the columns -- in which case, just consult a good oracle book about how to query for the attributes you want.my $sql = "select column_name, data_type, data_length, nullable from a +ll_tab_columns where table_name = ?";
|
|---|