Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread How to add a column to an existing table programmatically
Mon, Oct 19 2015 1:17 PMPermanent Link

Brian Clingan

Looking to add a column to an existing ElevateDB table at runtime through program code
Mon, Oct 19 2015 1:20 PMPermanent Link

Raul

Team Elevate Team Elevate

On 10/19/2015 1:17 PM, Max Stewart wrote:
> Looking to add a column to an existing ElevateDB table at runtime through program code

Again - i would suggest you look at the manual:

http://www.elevatesoft.com/manual?action=viewtopic&id=edb2sql&topic=ALTER_TABLE

Raul

Mon, Oct 19 2015 4:07 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Max,

<< Looking to add a column to an existing ElevateDB table at runtime through program code >>

Raul is, again, correct with the link.  Unlike DBISAM, EDB executes all data-definition operations via SQL.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Oct 20 2015 3:55 AMPermanent Link

Matthew Jones




Attachments: uDatabaseUtilsEDB.pas
Tue, Oct 20 2015 7:20 AMPermanent Link

Adam Brett

Orixa Systems

Max

If you are working within a Delphi programme you may have EDB database and table components open.

Remember first, you can't ALTER a table unless there are no other users (including yourself) accessing it, as the DB requires a full lock of the table prior to any ALTER statement.

Once you have this you can pass ALTER statements to an EDBQuery component's "SQL.Text" property and they will work:

ALTER TABLE <name>
ADD COLUMN <name> VARCHAR(50)

It has been a long time since I did it this way, but I am pretty sure it works.

You may do well to look search for "tutorials alter table SQL" in Google ... as it is a complex area.
Tue, Oct 20 2015 8:49 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Max


And finally since no one else has mentioned it - when you have a problem of this nature do it in EDBManager and then look in Explorer | SQL History and you will see the sql command you need to use.

This is very very useful since it effectively shows you all of the structure management commands on your tables

Roy Lambert
Image