Incrementing counter on ASCII import (None Specified)
At 08 JAN 1998 05:51:05PM Paxton Scott wrote:
Have a simple table and a simple form.
The form/table is setup with an incremental key counter.
Empty file, counter is set to one.
Import 100 records (using the OI import utility), counter is still one.
IS there a way the import process can increment the counter or do I have to handle it myself (with code)? If I have to handle it myself,
maybe you can send me to an example or otherwise shorten the curve.
Thanks, Paxton [email protected]
At 08 JAN 1998 06:26PM Donald Bakke wrote:
Paxton,
The counter won't increment automatically unless the data is being entered through the data window, which then forces %SK% to update itself. If the import process assigned key ID's that include the existing default (i.e. 1), and they are all sequential, then the next time you open the data window the sequential counter should be one more than the last key ID used (although you might experience a momentary delay while the system is counting upwards and verifying the existance of these records.)
If you want to increment the %SK% as the records are being imported, then you will have to do this yourself in code (as well as the importing) by opening the record %SK% from the relevant dictionary table.
At 09 JAN 1998 10:22AM Paxton Scott wrote:
Don,
Thanks for the reply. Well, using the import utility in OI, the keys are assigned Ok, but evidently %SK% does not know this, so he stays at 1 even though the import process loaded say 100 records with keys 1 to 100. I was hoping there was a switch somewhere on the import utility that I could set that would update %SK%. Otherwise, I guess I'll have to build a process to import and maintain %SK%. Any other ideas?
At 09 JAN 1998 11:48AM Donald Bakke wrote:
Paxton,
Any other ideas?
Not really, other than just opening your data window after each import so the system can automatically set %SK% to its correct value.
At 09 JAN 1998 01:13PM dsig (SigSolutions) wrote:
Possibly you should aim this message to RTI. It seems to me that if the import uses the %SK% and increments correctly then %SK% should be updated. This, if you notes are right, is a data corruption problem and should be of interest to RTI.
dsig
David Tod Sigafoos ~ SigSOlutions
[email protected] cis:70302,77 voice:503-639-8080
At 27 JAN 1998 03:31PM Cameron Purdy wrote:
Paxton,
Have a simple table and a simple form. The form/table is setup with an incremental key counter. Empty file, counter is set to one. Import 100 records (using the OI import utility), counter is still one. IS there a way the import process can increment the counter or do I have to handle it myself (with code)? If I have to handle it myself, maybe you can send me to an example or otherwise shorten the curve.
There is a way to customize the ASCII Import key generation. The record (which may not exist in your system – if not then create it) called "CFG_IMPORT" in the "SYSENV" table has the following structure:
- @vm-delimited list of data file names
- @vm-delimited list of stored procedures corresponding to
The stored procedure associated with the data file that data is being imported into is called for each imported record to get a key. The prototype for the stored procedure is:
<code> function (DataFileName) * responsible for generating the next import key return</code>
Cameron Purdy