Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update and insert if _tall = 0
Message
 
To
26/05/2015 08:38:26
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
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:
01620335
Views:
47
Cheers Tore, just wanted to be sure I wasn't miles off the mark.

~M

>>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
>
>This is a very good solution, I do exactly the same thing. Whether you can save a nanosecond or two by doing it differently, I don't think is important.
Go raibh maith agat

~M
Previous
Reply
Map
View

Click here to load this message in the networking platform