Oracle Command Equivelent
Posted in 2006
Topics: General Discussion
Hello All, Again, thanks for all of your help with my previous questions. Struggling to find a command similar to DESC in Oracle and sp_help in SQL Server/Adaptive Server for Informix. I've seen mention of INFO TABLE but cannot seem to get it to work. Typing INFO TBALE FOR <tablename> produces syntax errors when I try to use it. Thanks for your kind assistance, Tam.
Tam OShanter wrote: > Struggling to find a command similar to DESC in Oracle and sp_help in SQL > Server/Adaptive Server for Informix. > > I've seen mention of INFO TABLE but cannot seem to get it to work. > Typing INFO TBALE FOR <tablename> produces syntax errors when I try > to use it. Which bit of the manual did you look in? Even assuming you wrote TABLE instead of TBALE, you need to discover that the syntax is: INFO TABLES; INFO COLUMNS FOR TABLE xyz; INFO INDEXES FOR TABLE xyz; ... If you look up the INFO statement in the SQL Syntax manual, you find all this, and more. The statement only works in DB-Access - it is not understood by IDS. DB-Access interprets it, and decides which query or queries to generate and then formats the results. If a syntax is not part of the SQL standard, you must look at the manuals for the DBMS to find out how it works and what the syntax is. Actually, even if the syntax is in the SQL standard, you usually need to do that, but you've got a better excuse for trying it first. In general, non-standard features are implemented differently in each DBMS. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/
Jonathan Leffler said:
> Tam OShanter wrote:
>> Struggling to find a command similar to DESC in Oracle and sp_help in
>> SQL
>> Server/Adaptive Server for Informix.
>>
>> I've seen mention of INFO TABLE but cannot seem to get it to work.
>> Typing INFO TBALE FOR <tablename> produces syntax errors when I try
>> to use it.
>
> Which bit of the manual did you look in?
>
> Even assuming you wrote TABLE instead of TBALE, you need to discover
> that the syntax is:
>
> INFO TABLES;
> INFO COLUMNS FOR TABLE xyz;
> INFO INDEXES FOR TABLE xyz;
> ...
>
> If you look up the INFO statement in the SQL Syntax manual, you find all
> this, and more. The statement only works in DB-Access - it is not
> understood by IDS. DB-Access interprets it, and decides which query or
> queries to generate and then formats the results.
>
> If a syntax is not part of the SQL standard, you must look at the
> manuals for the DBMS to find out how it works and what the syntax is.
> Actually, even if the syntax is in the SQL standard, you usually need to
> do that, but you've got a better excuse for trying it first. In
> general, non-standard features are implemented differently in each DBMS.
Alternatively, the OP might find that parsing the output of the
command-line dbschema program is easier.
--
Bye now,
Obnoxio
"... no bill is required as no value was provided."
-- Christine Normile
Hello Friends, Thanks for the advice. Guess what I was looking for was something not offered directly as an SQL Statement. I've decided to write some queries to hit the system tables in stead. Thanks for your help, Tam. "Tam OShanter" <tam@oshanter.com> wrote in message news:9Gfqg.29175$cd2.25396@fe06.news.easynews.com... > Hello All, > Again, thanks for all of your help with my previous questions. > > Struggling to find a command similar to DESC in Oracle and sp_help in SQL > Server/Adaptive Server for Informix. > > I've seen mention of INFO TABLE but cannot seem to get it to work. > Typing INFO TBALE FOR <tablename> produces syntax errors when I try to use > it. > > Thanks for your kind assistance, > > Tam. > >