Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Roman Smatana, new to Informix, asked how to tell whether an object is a table or a view. Respondents including Art S. Kagel advised checking tabtype in systables (T table, V view, S synonym) or running dbschema -d database -t name to see CREATE TABLE or CREATE VIEW. Senthil Kumar added a CASE query for recent IDS versions.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Hi,
I am new in Informix , and want tu ask :
I have a table and I want to know if a table is table or view. :)
I do not know the script that was a table created.
Is there any method to find out this ?
thanx
Roman
↪ replying to Roman.Smatana@socpoist.sk
TEST — — source: Informix-list mailing list archive (1991-1998)
You can check it in the systables table.
Systables table describes each table in the database.
It contains one row for each table, view or synonym defined.
Systables has a column (tabtype) and returns 'T' for table,
'V' for view, 'S' for synonym or 'L' for log.
select tabname, tabtype
from systables
where tabname = '?' -- the name of your table/view.
Another method is by using dbschema. dbschema generates
the SQL statements of your database/tables.
The syntax is:
$ dbshema -d dbname -t tablename
Roman.Smatana@socpoist.sk wrote in message
<7staf7$2rm$1@news.xmission.com>...
>
>
> Hi,
>
> I am new in Informix , and want tu ask :
>
> I have a table and I want to know if a table is table or view. :)
> I do not know the script that was a table created.
>
> Is there any method to find out this ?
> thanx
>
> Roman
>
↪ replying to Roman.Smatana@socpoist.sk
Art S. Kagel — — source: Informix-list mailing list archive (1991-1998)
Select the tabtype from systables or run:
dbschema -d <database> -t <table-or-view>
which will printout the SQL DDL needed to recreate the object which will
either be a CREATE TABLE or CREATE VIEW statement.
Art S. Kagel
Roman.Smatana@socpoist.sk wrote:
>
> Hi,
>
> I am new in Informix , and want tu ask :
>
> I have a table and I want to know if a table is table or view. :)
> I do not know the script that was a table created.
>
> Is there any method to find out this ?
> thanx
>
> Roman
↪ replying to Roman.Smatana@socpoist.sk
Senthil Kumar — — source: Informix-list mailing list archive (1991-1998)
Try this:
select tabname, case when tabtype = "V" then "is a view"
else "is not a view"
end
from systables
where tabname = "your_table_or_view_name_within_quotes"
Only if you have the latest version of IDS, the case construct will work.
Otherwise you can just do
select tabtype from systables
where tabname = "your_table_or_view_name_within_quotes"
If the output is V then it is a view.
Senthil Kumar
Roman.Smatana@socpoist.sk wrote in message <7staf7$2rm$1@news.xmission.com>...
>
>
> Hi,
>
> I am new in Informix , and want tu ask :
>
> I have a table and I want to know if a table is table or view. :)
> I do not know the script that was a table created.
>
> Is there any method to find out this ?
> thanx
>
> Roman
>
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.