Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert vs Append
Message
From
06/11/1999 13:15:35
 
 
To
06/11/1999 11:32:34
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00288011
Message ID:
00288058
Views:
13
>>I may be all wrong or doing something wrong, so I need some help. I have created some tables in a database and have iid in most of the tables. In the default of each of these tables for my iid field I have getkey('tablename') to retrieve my next unique key value. This works fine when at the command prompt I type append, my new key is generated and everything works as its suppose to, but in my program I use 'insert into' and the key is not generated. Is this right? How do I retreive my next key for my 'insert into' or should I just append blank and gather?
>>
>>TIA
>>Ron
>
>Are you using INSERT INTO MyTable FROM MEMVAR or SQL INSERT INTO?
>
>If you are using INSERT INTO FROM MEMVAR, and you have a variable m.iid defined, this value will obviously go in there, even if it is blank or zero. This has caught me once or twice.
>
>If you are using SQL INSERT, only the fields you name in the clause should go into the table, and all others should be allowed to take their default values.


Thanks Erik, I found that is what I am doing. insert into from memvar. I have done a few tests and fing that if I do not have a m.iid, it works right, but if I make m.iid = 100, then 100 is saved with the record. Thanks, that helps clear it up.

Ron
Previous
Reply
Map
View

Click here to load this message in the networking platform