Subject | Re: alter in stored procedure |
---|---|
Author | Alexander V.Nevsky |
Post date | 2003-10-03T09:30:57Z |
--- In firebird-support@yahoogroups.com, "Martijn Tonies"
<m.tonies@u...> wrote:
Box. All my experience says metadata changes is not performed entirely
under general transactional logic. And I intentionally recommend don't
work with uncommited metadata changes even in the same transaction,
what is assumed when metadata is changed within SP.
Best regards,
Alexander.
<m.tonies@u...> wrote:
> Hi,Martijn, did you tried this youself? I'm afraid this is Pandora's
>
> > can i do this?
> >
> > CREATE PROCEDURE sp_test
> > (tabname VARCHAR(24), colname VARCHAR(24), datatype VARCHAR(24))
> > AS
> > BEGIN
> > ALTER TABLE :tabname ADD :colname :datatype;
> > END
> >
> > how can i alter table (add new columns) in stored procedure?
>
> You can't.
>
> Unless you're using Firebird 1.5 and use EXECUTE STATEMENT -
> this allows you to dynamically create an SQL statement and execute
> it.
Box. All my experience says metadata changes is not performed entirely
under general transactional logic. And I intentionally recommend don't
work with uncommited metadata changes even in the same transaction,
what is assumed when metadata is changed within SP.
Best regards,
Alexander.