The monorow IMDB table are designed to store only one record in the same table. For that they have only one row the have also a special ability, you can access their fields directly. Just like some variables.
One useful feature of the monorow IMDB variables is that if you have a query witha where clause that depends on a variabile of this kind, is will be automatically refreshed if the value of the monorow IMDB table field changes.
You can use a multi row IMDB table. If you do that you can set one IMDB table field as a Primary Key (also a counter one, if you want to do in this way) and write down an insert statement like that
- Code: Select all
int -ID = 0;
INSERT INTO table (vID)
set FIELD1 = 'Goofy' // I always use Walt Disney for my examples :)
After that statement the vID integer variable will contain the last ID created for the new row.
If you want to implement a panel that force the user to insert only one row at a time, you can use the "Auto Manage Layout" flag of the panel. With that you will force the panel to automatically switch to detail layout when the user click on the "insert" button.