Create Table in interbase (runtime)
Create Table in interbase (runtime)
(OP)
Hi,
Im looking to create tables at runtime using CBuilder 6 and interbase, preferably using a stored procedure. Ive tried a few different methods without success and can find nothing on the net. Any advice would be appreciated.
TIA
Kris
Im looking to create tables at runtime using CBuilder 6 and interbase, preferably using a stored procedure. Ive tried a few different methods without success and can find nothing on the net. Any advice would be appreciated.
TIA
Kris
RE: Create Table in interbase (runtime)
Steven van Els
SAvanEls@cq-link.sr
RE: Create Table in interbase (runtime)
Thanks
Kris
RE: Create Table in interbase (runtime)
Use IBSQL
Set IBSQL.SQL to some command for example
CREATE TABLE "ARTIKLI"
(
"SIFRA" VARCHAR(50) NOT NULL,
"NAZIV" VARCHAR(100) NOT NULL,
"NAZIV_DRUGI" VARCHAR(100),
"MJERA" VARCHAR(50) NOT NULL,
"C1" FLOAT,
"C2" FLOAT,
"C3" FLOAT,
PRIMARY KEY ("SIFRA")
);
and then call IBSQL1.ExecQuery ;
RE: Create Table in interbase (runtime)
You cannot do this from within a Stored Procedure - DDL (Data Definition Language) is not allwed in stored procedures.
Use SQL DDL statements (like CREATE TABLE) either one by one in a TIBQuery/TQuery/TIB_DSQL/Twhatever component or use script-components that can process the whole lot at once.
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com