Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Table in interbase (runtime)

Status
Not open for further replies.

KrisUK

Programmer
Sep 26, 2002
6
GB
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
 
OK thanks, could you give me an example of this please?
Thanks
Kris
 
Try this (I am usin Delphi 6/7 and working)

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 ;

 
Hi,

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top