Subject Re: Modify database structure in a program
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Mon, 8 Apr 2019 16:42:30 -0700
Newsgroups dbase.getting-started

On 4/8/2019 1:02 PM, Dave Cornelson wrote:
> Is there a code I can put in a program to change the type and width in a database file with out using the command Modify Structure and do each one at a time.  I have many tables to modify and like to create a program to run to do this...
>

It's not an easy thing to do. The dBASE/BDE version of the (local SQL)
ALTER TABLE command won't let you just modify a field, for example. You
would need to add a new field with the new type/size, copy the data over
(you could use local SQL UPDATE SET command, or ...), and then: delete
the old field, and rename the new field. So four different steps for a
single field.

Ken


--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm