Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 4 of 4 total |
Altering table in Delphi code |
Sat, Dec 11 2010 11:41 AM | Permanent Link |
Mikko Erva | Hi,
In DBISAM 3 following code inserted new field to table but now i can't get it work with DBISAM 4. If talble version is lower than 2 then new field wil be added and talve version in updated to v. 2. Any help? with tblCustomers do begin if (UserMajorVersion<2) then begin RestructureFieldDefs.Update; RestructureFieldDefs.Add(-1,'PhoneNumber', ftString, 0, False, '', '', '', '', fcNoChange); RestructureIndexDefs.Update; RestructureTable(0,0,2,0,False,'','',512,-1,'',nil,'','',False); end; |
Sun, Dec 12 2010 6:55 AM | Permanent Link |
Adam Brett Orixa Systems | Hi Mikko
I can't comment about the UserVersion side of things. I would always use an EXEC script in SQL to do this: if [conditions] then begin MyDBISAMQuery.SQL.Text := 'ALTER TABLE ADD COLUMN "CustName" CHAR(40)) AT 5 DEFAULT ''-unknown-'''; MyDBISAMQuery.Prepare; MyDBISAMQuery.ExecSQL; end; |
Mon, Dec 13 2010 12:17 AM | Permanent Link |
Gregory Sebastian | I too prefer to use SQL, its a lot easier. SQL code to update the user
major version number is : ALTER TABLE IF EXISTS "Customers" USER MAJOR VERSION 2 Regards Gregory Sebastian |
Mon, Dec 13 2010 3:44 AM | Permanent Link |
Mikko Erva | Thanks for both replys. I start using SQL also, it's easier than Delphi
code. Never thought it could be used altering table version also. -mikko "Gregory Sebastian" <gregorys@nospam-ezysoft-dev.com> kirjoitti viestissä:4F06895D-4F2D-4F72-B479-5605E64C79B5@news.elevatesoft.com... >I too prefer to use SQL, its a lot easier. SQL code to update the user >major version number is : > > ALTER TABLE IF EXISTS "Customers" USER MAJOR VERSION 2 > > Regards > Gregory Sebastian > |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |