nirdu
asked on
How to add a filde to a Data Base table in run time ?
Hi
I need some help in Data Base programing.
How can I add a new filde, to an exists table, in run time ?
Thanks for your help.
I need some help in Data Base programing.
How can I add a new filde, to an exists table, in run time ?
Thanks for your help.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
I know it is not database TA, but would like to say that
better use
sql = "ALTER TABLE table_name ADD field DOUBLE NULL";
otherwaie You should also specify default value for a field (at least on some databases)
mokule
better use
sql = "ALTER TABLE table_name ADD field DOUBLE NULL";
otherwaie You should also specify default value for a field (at least on some databases)
mokule
It depend of the type of the field... you can set it as char, double, etc.. and in same cases the defaul value, also where iin the table (after any field)
JHL
JHL
hi dear friend ...
it is so easy. just download this complete Project. all that you want is here :
+) http://mizan3.com/delphi/databases-addfield.zip
Regards friend.
it is so easy. just download this complete Project. all that you want is here :
+) http://mizan3.com/delphi/databases-addfield.zip
Regards friend.
ASKER
Hi
Alter works the way I want, but it is very slow ....
Is there a way to rash it ?
thanks
Alter works the way I want, but it is very slow ....
Is there a way to rash it ?
thanks
Usually it´s the best form. But there are other functions that you can use, but depend of the component that you are useing to access the table. By ex. if you are using ADO TABLE, you can make modifications as Alter with adotable1.fields.add(Tfiel d).
But I think that the best and fastest way it´s by SQL( Alter)
Regards
JHL
But I think that the best and fastest way it´s by SQL( Alter)
Regards
JHL
query.execsql;
just from head -> means untested and typos possible
i recommend to refere your databasemanual about the correct syntax
meikl ;-)