Sequential Key (OpenInsight Specific)
At 15 JAN 1998 06:40:06AM Jacob Ignatius wrote:
I want a table with a sequential key. I created the table such that for the primary key the "Default" setting is set to SEQKEY. When I looked at the dictionary for the table I did not see %SK%. Therefore I can't make use of the sequential key.
Is it because no rows exist in the table?
Suggestions welcome.
At 15 JAN 1998 08:08AM Andrew P McAuley wrote:
It will be added when you first use the window (assuming you have set default on the window not the dict)
World Leaders in all things RevSoft
At 19 JAN 1998 06:18AM Jacob Ignatius wrote:
What window?
Do you mean table?
At 19 JAN 1998 07:17AM Oystein Reigem wrote:
Jacob,
No, he means window. Doubleclick the edit line for the key and choose SEQKEY in the Default listbox.
- Oystein -
At 19 JAN 1998 08:11AM Jacob Ignatius wrote:
I have set default to SEQKEY for the primary key of the table.
When I try to execute the code given below cuur_id remains unassigned:
open "FEE_STRUCTURE" to fee_table else debug
open "DICT.FEE_STRUCTURE" to @DICT else debug
readv curr_id from @DICT,"%SK%",1 else debug
new_id=curr_id + 1
No records have been added to the table as yet. Do I have to manually add the first record?
At 19 JAN 1998 09:41AM Oystein Reigem wrote:
Jacob,
]
Have you got a window for the table? What Andrew tells you to do is to set default to SEQKEY for the key control in the window, not for the table column. (Note: Don't do it with Database Association Set in the Edit Line Properties window, because then you set default for the column instead. Do it in the Default list box.)
]
I think so. The first time you use that window to enter data into the table, the %SK% row is created.
Or perhaps you don't want to have a data entry window for the table? Perhaps you only need the sequence counter to generate keys for an Ascii Import? (That's the only reason I can think of.) Make a window anyway and enter one row. If there is a problem with the import starting at key 2 instead of 1 you can always edit the %SK% row and reset it to 0 before you import.
- Oystein -
At 19 JAN 1998 10:12AM Jacob Ignatius wrote:
Oystein,
Thanks. I created a new form based on the table and when I ran it it prompted me to enter a value for SK. I was previously using a form that was not based on any particular table but had fields associated with the table.
Now that the sequential key has been created I can revert to the original form.