Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update statement

Status
Not open for further replies.

HenkR

Programmer
Oct 5, 2005
15
BE
Hi,

I get a syntax error when executing this statement:

UPDATE AdmNmbr.DBF
SET NUMBER = 3
WHERE NMBRID = '000205'


this works fine:
SELECT NUMBER FROM AdmNmbr.DBF
WHERE NMBRID = '000205'

what is wrong with the update statement?
I don't know much about DBase...
 
First guess is the field NUMBER is character as opposed to numeric, so the 3 needs to be in parens:

UPDATE AdmNmbr.DBF
SET NUMBER = '3'
WHERE NMBRID = '000205'

It would be helpful to post the verbage of the error. If I'm correct with the above , the error should be "Data Type Mismatch" (or close to that).

hth

 
I tried it but NUMBER IS numeric

The error is syntax error on update statement
 
What version of dBase are you running? Not all had SQL capabilities. If it's an earlier version, you'll need to use xBase commands instead, like:

USE AdmNmbr.DBF
REPLACE ALL NUMBER WITH 3 FOR NMBRID = '000205'
 
In dBase 5 for DOS the UPDATE command is nothing like what you're using. Most likely you're mixing languages. I agree with 1oldfoxman on using REPLACE instead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top