New Table

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

slimane
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 15.09.2011, 16:24

New Table

Postby slimane » 15.09.2011, 16:49

is it possible to add a new table/fields to the database at run time if yes how? I can't find anything in the documentation.
I am using Delphi 2010

seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Postby seawolf » 15.09.2011, 21:48

Why not using a TZQuery.SQL.Text := "CREATE TABLE example (id INT,data VARCHAR(100));" ?

Or do you need something different?

slimane
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 15.09.2011, 16:24

Postby slimane » 16.09.2011, 10:16

Is there a second option? like CreateTable in TTable class.
The solution given will do, if there is more than one solution please let me know

User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Postby mdaems » 18.09.2011, 19:45

slimane,
Such a feature isn't available at the moment.
You can check what tables exist by using the metadata component and just fire the create statements you like when needed. An automatic create functionality is in most cases only useful for temporary tables.
As a developer I would like full control over the 'first install table creation' process when a user starts using my program. And not depend on the first time the users tries to access a table before creating it.
Even more : when you want to have optimal field type and size, you can probably only get that when you define the create statement yourself, instead of depending on some automatic process.
Image


Return to “MySQL”

Who is online

Users browsing this forum: No registered users and 1 guest