I think in some cases it's better to use:

select * from sys.all_tab_columns where table_name = '<TABLE_NAME>' and owner = 
'<SCHEMA_NAME>';

user_tab_columns will only show the tables of the current user. If your perl script 
will connect as a user who is not the owner of the table under consideration, then 
user_tab_columns won't show that table.

Tim Helck



-----Original Message-----
From: PerlDiscuss - Perl Newsgroups and mailing lists
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 06, 2004 5:16 AM
To: [EMAIL PROTECTED]
Subject: Re: Describe table


Hi

You cannot use the DESCRIBE statement as it is. Try it in the following way

select * from sys.user_tab_columns where table_name = '<TABLE_NAME>';

Cheers

Prabu



Jimmy Jauhal wrote:

> Hi All,

> I am trying to execute a DESCRIBE table statement from my perl script that
> connects to an oracle DB. For some reason the execute fails saying that
> "describe table" is not a valid SQL statement. When I try SELECT
> statements they work fine and fetch data properly.

> DBI version 1.30
> DBD::Oracle version 1.12

> Any help would be appreciated.
> Thanks,
> -Jimmy


Reply via email to