Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update and insert if _tall = 0
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Update and insert if _tall = 0
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01620194
Message ID:
01620194
Views:
76
Hi all,

normally I would do a seek on a table that has a 2 field index, if I find the entry I update a field, if not I create a new record.
I was thinking about changing this to an update command, but wondering if there are any issues, speed mainly, with this.
update table1 set field3 = "some data" where field1 = "ABC" and field2 = "DEF"
if _tally = 0
    insert into table1 (...) values(...)
endif
it doesn't seem to slow things down as against a seek but I'm wondering if this is the dont thing.
the reason I would like to move to an update command is to modify code to be more like .net and sql which we're migrating to.

~M
Go raibh maith agat

~M
Next
Reply
Map
View

Click here to load this message in the networking platform