On Jun 26, 10:25 am, [EMAIL PROTECTED] (Philip Garrett)
wrote:
> [EMAIL PROTECTED] wrote:
> > Good morning,
>
> > I was given some tables on an Oracle database, but unfortunately I do
> > not know the field/column names of the table. I've made numerous
> > attempts to print such a list for a given table, but they never seem
> > to work. I've been trying SQL queries such as:
>
> > SELECT column_name FROM user_tab_cols WHERE table_name =
> > 'mytable'sname'
>
> > Sometimes I'm able to get them to run with no errors... yet no result
> > is produced when I try to print them. I'm not sure if there is some
> > trick with DBI that I'm overlooking. Any tips would be greatly
> > appreciated!
>
> Well I suppose you could use DBI for this, but why?  Just run "desc
> <tablename>" in sqlplus.
>
> - Philip


Thank you everyone for your help! I was eventually able to get it to
work using:

$sth = $dbh->prepare("select table_name, column_name from
all_tab_columns where table_name = 'mytablesname'");

I will test out your other solutions, though. I appreciate the help
greatly!

Reply via email to