Foxpro server sql updating
I know very little about VFP but I've been tasked with making some data alterations to a fairly large table.
When running standard SQL update commands in the command window, VFP claims records are updating but they never change.
Neither is any liability assumed for damages resulting from the use of the information contained herein.
For information, please contact: Visual Fox Pro has excellent facilities for database application development utilising a client-server database management system to store data as a replacement for the native Fox Pro table files.
Just in case this was some anomaly based on the fact I was attempting to update the field I was filtering on, I tried this: Which reported as having updated 1 record but changed nothing. Is there some sort of post-command process I need to invoke, like there is when you mark records for deletion and then have the actual delete step? Has the same effect - it says it's replaced 4 million records, but the data doesn't seem to change.
I have discovered that I cannot seem to add fields to the table either, which suggests some kind of lock. It may be that the table structure is only one character for the gender as one can only be either biologically Male or Female and the short reference of "M" or "F" respectively.
SELECT * FROM OPENROWSET('VFPOLEDB','D:\dir\file.dbf';'';'','file') SELECT * FROM OPENROWSET('VFPOLEDB','D:\dir\file.dbf';'';'','update file set n=2 where n=1') SELECT * FROM OPENROWSET('VFPOLEDB','D:\dir\file.dbf';'';'','delete from file where n=2') SELECT * FROM OPENROWSET('VFPOLEDB','D:\dir\db2.dbc';'';'','tab2') SELECT * FROM OPENROWSET('VFPOLEDB','D:\dir\db2.dbc';'';'','update tab2 set somedate=ctod("12/30/2000") where n=1') The only inconvenience is that update and delete statements result with error 7357 telling you that no rows to be returned.
These ODBC extensions are interpreted by the driver so that the same syntax can be applied across multiple database servers.
SET specifies the criteria that records must meet to be updated with new values.
You can include as many filter conditions as you like, connecting them with the AND or OR operator.
I tried this: And VFP reported it had updated 4221674 records (the expected number) in about ten seconds.
But when I re-queried the table, the gender field had not changed.The article is 49 pages long, but don’t be alarmed, most of it is screen shots. I’ve included the Word format in case you want to edit the article, add your own comments, copy stuff out etc.