Thank you Lutz.
>>Hello all,
>>
>>I had a weird bug in my app. A field defined as Auto-Integer got 0 for a value. I always manage updating or creating my tables with Stonefield Database Toolkit.
>>
>>I never touch the default values in SDT. For example Step value and Start value for a auto-integer field.
>>
>>How can I make sure that default value will really be 1 when appending records to all my tables considering my use of SDT?
>
>If you really want to be sure, you need to
>- create the table via SDT
>- get all tables (ADBOBJECTS( ))
>- loop through, for each table
cTable>-- USE EXCL
>-- get all fields (AFIELDS()); for each field
cField>-- check if autoinc is on (column 18 # 0); if
>--- store to
iStep>--- check start value = 1 (column 17 = 1); if not
>---- run
ALTER TABLE cTable ALTER COUMN cField I AUTOINC NEXTVALUE 1 STEP iStep>
>If you ALTER an existing DBC, it's basically the same, except that you need to gather the recent max value
iMax of your
cField (note: including deleted records!)
>and run
ALTER TABLE cTable ALTER COUMN cField I AUTOINC NEXTVALUE iMax+1 STEP iStep>
>Logically you can do the same for an empty table, the first one is some ms faster.
>
>HTH
>
>BTW: Save the
forests, eat
more beaver
s.
>
>Update:
>For all I know SDT will not do that without reason. Have you double checked your SDT definitions for start value other then 1? And try to ask the manufacturer of SDT. He number 1 helps and number 2 likes to fix such bugs.
>
>Update 2
>use of STEP
*******************************************************
Save a tree, eat a beaver.
Denis Chassé