>>-From my POV insert syntax is better. You can't get the list out of sync if you don't do that on purpose.
>
>It is easy to make mistakes. Humans are taught to read English Left to Right and Top to Bottom. INSERT separates the fields from the values breaking the reading pattern and increasing the mistakes.
I tend to agree here - with more than just a few fields, it's easy to develop eye fatigue.
My solution is insert from name. I don't mind a Createobject("empty") and a series of addproperty() calls - these are again just single-liners (i.e. one line per field, not two), and have one advantage: if you insist on insert...values, what if you actually don't know whether it'll be an insert or an update? Suppose your code checks for primary key first, and then inserts or updates, depending on the result.
Your code may develop into a lengthy sausage:
if lUpdating
update mytable set;
field1=value1 ;
, field2=value2;
...
where pk=m.lPK
else
insert into mytable (;
field1 ;
, field2 ;
...
) ;
values ;
(value1 ;
, value2
....
)
endif<pre>
whereas using a record object, we have
<pre>loRec=createobject("empty")
addproperty(loRec, "field1", value1)
addproperty(loRec, "field2", value2)
...
select myalias
if lUpdating
gather name loRec memo
else
insert into myalias from name lorec memo
endif
.
There's no multiline statement here which has to be carefully maintained.