Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using SQL Update to Check for existence
Message
From
20/09/2005 17:46:40
 
 
To
20/09/2005 16:50:47
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01051456
Message ID:
01051470
Views:
7
>Instead of running a Select SPT statement to check for the existence of a record, how can I use the Update statement to do both? If record exists update it. if it dosen't do an insert.

With a single UPDATE is not possible.

You can use this in not multiuser env.
UPDATE ..... WHERE pk=....
IF EMPTY(_TALLY)
  INSERT ....
ENDIF
Previous
Reply
Map
View

Click here to load this message in the networking platform