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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

begining in sql 1

Status
Not open for further replies.

newapocalipsis

Programmer
Aug 10, 2001
48
0
0
MX
i´m begining i sql into ms-foxpro and i´m attempting to change an existing record with update... but it append one more record and i dont want that, i want to replace the existing data in record. Golden Dragon Is Coming Soon...
 
Can you provide more information please? Type and version of FoxPro (e.g. FPDOS 2.5b, FPW 2.6a, VFP 6.0 SP5), and the table type (e.g. FP 2.x table, VFP table in a DBC, SQL server table), and whether you are using trying to use "native" SQL statements or Passthrough SQL statements.

Rick
 
i´m using fpw 2.6 a fpw 2.6 table and the select and update statements are these:

select * from raygoza noconsole plain nowait into cursor daniela

update raygoza set nombre=m.nombre where clave=m.clave Golden Dragon Is Coming Soon...
 
OK, the SQL Update command wasn't available till VFP 3.0 - you'll just need to use the standard xBase Replace in this case.
Code:
SELECT 0
USE raygoza
REPLACE ALL nombre WITH m.nombre WHERE clave=m.clave
USE
Rick

 
Hi,

A little sintax correction to Rick's advice:

...
REPLACE ALL nombre WITH m.nombre FOR clave=m.clave
...
David.
 
Thanks David - another good catch. I guess my brain was trying to make it TOO close to his expected UPDATE syntax.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top