Subject Re: [ib-support] Table layouts
Author Nando Dessena
Dave,

> I'm creating tables for the first time with interbase 6 and need to know the table description function - equivalent to
> desc <tablename>; of MySQL/Oracle which prints a layout/description of each column in the table.

the closest thing to it that I know id the RDB$DESCRIPTION field on many
systema tables, but there is not DSQL interface that will handle it (ie
you would have to do direct DML against the system tables to read and
write that description).


> And also the easiest way to automatically generate incremented column ids for new rows inserted into a table. (Equivalent of creating the column as 'auto_increment' with mysql).

Use a generator

create generator my_gen

and a trigger

create trigger set_id for my_table before insert
as
begin
if (new.id is null or new.id = 0) then
new.id = gen_id(my_gen, 1);
end

HTH
--
____
_/\/ando