Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE DB Provider for Visual FoxPro
Message
De
25/11/2002 18:08:39
 
 
À
25/11/2002 17:10:19
Chad Ashpole
Ads Information Systems, Inc.
Minneapolis, Minnesota, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
00726619
Message ID:
00726721
Vues:
34
>I understand what NULL means. What I don't understand is why the OLE DB Provider for Visual FoxPro inserts a NULL into my field(s) if I don't specify that field it in my insert command? Let's say I have a table with 5 fields. In FoxPro, if I do an insert command for one of the fields (I.E. INSERT INTO mytable (myfield) VALUES ('mydata') the rest of the fields in the table are defaulted to whatever type they are. If I use the OLE DB Provider to Visual FoxPro with the same syntax, it inserts NULL values into the fields I do not specify. So my question, is there a setting that the OLE DB Provider has to turn of the NULL insert?

The OLE-DB provider isn't inserting nulls. What is happening is that since you didn't provide a value, and there is no default value defined, then null is all that is left. The same thing happens if you don't provide a value for all the field in SQL Server that don't have a default or allow null.

What we do, in SQL Server is provide a default value for all fields that are not required. Or, as you said, you can provide empty defaults in your insert statement.

BOb
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform