> That only applies if you're dealing with SQL Passthrough,=20 > right? But it's=20 > certainly much cleaner than INSERT INTO's syntax (and it's a=20 > lot like the=20 > REPLACE syntax). But I suppose if you're doing=20 > backend-independent (SQL=20 > Passthrough), you'd have to use INSERT INTO when adding new=20 > records. Is=20 > that right? It's been a long time since I've inserted records=20 > into a SQL=20 > backend with pass-through.
It doesn't have to be. You can use INSERT INTO / UPDATE table / DELETE FROM directly in Fox with tables, views, or cursors. I generally use a combination of SQL-style and xBase-style commands depending on what I need to do. They each have their pros and cons.
> One thing I've heard of a couple times is people forget the=20 > WHERE clause of=20 > the DELETE statement (and so probably UPDATE as well). Ack!=20 > At least in=20 > VFP you'd only mess up 1 record instead of the entire database if you=20 > 'forgot' your scope (of course, assuming journaling/logging=20 > is taking place=20 > in the SQL DB you should be able to roll it back if you=20 > caught it quick=20 > enough).
Well, dumb programmer mistakes can happen with any methodology.
> Does anyone know=20 > if VFP 8 have=20 > the INSERT INTO ... FROM NAME ....? Or is that something=20 > coming in the next=20 > release? Now THAT's cool!
Yes it does. But even cooler (and more powerful) than that is the ability to do:
INSERT INTO TABLE (<fieldlist>) SELECT <fieldlist> FROM TABLE ...
VFP8 has finally introduced more of the power of SQL.
HTH,
J. Chad Bourque, MCP Fort=E9 Incorporated chad .at. teche DOT net=20
©2003 J. Chad Bourque |