Subject | Re: [firebird-support] alter in stored procedure |
---|---|
Author | Martijn Tonies |
Post date | 2003-10-03T07:22:26Z |
Hi,
Unless you're using Firebird 1.5 and use EXECUTE STATEMENT -
this allows you to dynamically create an SQL statement and execute
it.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird & MS SQL Server.
Upscene Productions
http://www.upscene.com
> can i do this?You can't.
>
> 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?
Unless you're using Firebird 1.5 and use EXECUTE STATEMENT -
this allows you to dynamically create an SQL statement and execute
it.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird & MS SQL Server.
Upscene Productions
http://www.upscene.com