>>
>Jon, what is the reason for not specifying all columns in the INSERT? That is the standard way and then you don't have to worry about mystery values getting in.>>
>>Mike,
>>
>>I understand where you're coming from on this, and it's certainly a valid way to resolve what we've been seeing.
>>
>>The main argument I see against this is that if the table in question ever has a structure change, then we would have to make at least one source code change to take into account the structure change, which isn't a very dynamic way to handle things. Given how I've always understood the INSERT command to work, you should not need to specify all fields in the field/value list, because the default values should kick in for all fields that are not specified. If I would be specifying all fields all the time, then I feel there's really no point in supporting default field values.
>>
>>Jon
>
>Jon,
>
>I believe you're correct. I just found a very strange behavior in the program I created.
>
>I had this code
>
>
>IF FIELD("MakeID","Manufacturers") = 0
> SELECT * FROM Manufacturers ORDER BY Name INTO CURSOR cM nofilter
> ZAP IN Manufacturers
> ALTER TABLE Manufacturers ADD COLUMN MakeID I AUTOINC PRIMARY KEY
> INSERT INTO Manufacturers ;
> (Name, Compname, Address1, Address2, City, State, Zip, ;
> Contact1, Email1, Phone1, Fax1, Contact2, Email2, Phone2, Fax2, ;
> Url, Notes, Adduser, Adddate, Changeuser, ;
> Changedate, Logo, Website, Licensekey) ;
> SELECT Name, Compname, Address1, Address2, City, State, Zip, ;
> Contact1, Email1, Phone1, Fax1, Contact2, Email2, Phone2, Fax2, ;
> Url, Notes, Adduser, Adddate, Changeuser, Changedate, Logo, ;
> Website, Licensekey FROM cM
> USE IN SELECT('cM')
> ENDIF
>
>Originally by mistake I added MakeID in the above statements, as
>
> INSERT INTO Manufacturers ;
> (MakeID, Name, Compname, Address1, Address2, City, State, Zip, ;
> Contact1, Email1, Phone1, Fax1, Contact2, Email2, Phone2, Fax2, ;
> Url, Notes, Adduser, Adddate, Changeuser, ;
> Changedate, Logo, Website, Licensekey) ;
> SELECT MakeID, Name, Compname, Address1, Address2, City, State, Zip, ;
> Contact1, Email1, Phone1, Fax1, Contact2, Email2, Phone2, Fax2, ;
> Url, Notes, Adduser, Adddate, Changeuser, Changedate, Logo, ;
> Website, Licensekey FROM cM
>
>
>The result was very weird. The field MakeID became character 40 and the last field LicenseKey was dropped from the table.
>
>May be you have some weird situation like this as well - you think you have some field in the cursor, but you don't.
That's why you should specify the field names as well as the values. Also standard ;-)