>UPDATE products; >SET discontinued = This.chkDiscontinued.Value ; >WHERE Product_id = vp_Product_ID > >Now you have a backend independent segment of code.
That only applies if you're dealing with SQL Passthrough, right? But it's certainly much cleaner than INSERT INTO's syntax (and it's a lot like the REPLACE syntax). But I suppose if you're doing backend-independent (SQL Passthrough), you'd have to use INSERT INTO when adding new records. Is that right? It's been a long time since I've inserted records into a SQL backend with pass-through.
One thing I've heard of a couple times is people forget the WHERE clause of the DELETE statement (and so probably UPDATE as well). Ack! At least in VFP you'd only mess up 1 record instead of the entire database if you 'forgot' your scope (of course, assuming journaling/logging is taking place in the SQL DB you should be able to roll it back if you caught it quick enough).
>... > >I personally hate REPLACE, and where I am now, there's a lot of code > >with a TON of REPLACE statements. That's a lot of unnecessary traffic > >over the network. > > > >BUT, I don't consider myself a VFP programmer, I just dabble. All I've
And Jerry already pointed the simplest syntax with the GATHER ... NAME ... command. That's actually what I use (I should have clarified that when I do use REPLACE, I use the multi-line syntax). Does anyone know if VFP 8 have the INSERT INTO ... FROM NAME ....? Or is that something coming in the next release? Now THAT's cool!
-Charlie
©2003 Charlie Coleman |