Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UpdateNameList
Message
From
17/01/2003 04:50:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00738407
Message ID:
00742784
Views:
33
>Cetin,
>
>I tried what you suggested and it worked for updates and deletes.
>
>It doesn't work for inserts, however. Is it possible to make an SPT cursor updatable and have it do inserts also? Or am I doing something wrong?
>
>Thanks,
>
>Gerry Newton

It works for inserts too. However all required (not null) fields should be in UpdateNameList and UpdatableFieldList unless they have a default value. ie:(with SQL server pubs.authors)
SQLExec(handle,"insert into pubs.dbo.authors "+;
 " (au_id,au_fname,au_lname)"+;
 " values "+;
 " ('999-99-1234','Test','Name')")
* would fail 
* Phone and Contract doesn't accept NULL and only phone has default value

SQLExec(handle,"insert into pubs.dbo.authors "+;
 " (au_id,au_fname,au_lname,contract)"+;
 " values "+;
 " ('999-99-1234','Test','Name',1)")

*would succeed
*Same with UpdatenameList and UpdatableFieldlist
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform