Subject | Add a column to a table via stored proc |
---|---|
Author | Dave Bullar |
Post date | 2002-10-01T11:34:18Z |
I am using ibobjects with firebird.
I want to add a column to table B when a new record is added to Table A. Via
a trigger and a stored proc.
I cannot do this using SQL syntax ('alter table B add Fred smallint')
because that is not available in stored proc. But I suppose I can alter the
appropriate RDB$ files by stored proc.
It is a very simple column of smallint with no index or other constraints
that I want to add (or occasionally drop). I see that I can add a record to
RDB$RelationFields.
But are there any dire pitfalls to this ?
And are there other RDB$ entries to be made at the same time.
(In other words what, in terms of the system relations, does the sql
statement "alter table B add Fred smallint" achieve ?)
--
'Probable impossibilities are to be preferred to improbable possibilities.'
Aristotle
I want to add a column to table B when a new record is added to Table A. Via
a trigger and a stored proc.
I cannot do this using SQL syntax ('alter table B add Fred smallint')
because that is not available in stored proc. But I suppose I can alter the
appropriate RDB$ files by stored proc.
It is a very simple column of smallint with no index or other constraints
that I want to add (or occasionally drop). I see that I can add a record to
RDB$RelationFields.
But are there any dire pitfalls to this ?
And are there other RDB$ entries to be made at the same time.
(In other words what, in terms of the system relations, does the sql
statement "alter table B add Fred smallint" achieve ?)
--
'Probable impossibilities are to be preferred to improbable possibilities.'
Aristotle