Oh for sure it would be "dangerous" to issue an Autonum command if there's a possibility someone would be in the table as you are autonumbering it. My point was only that you can do an autonum command in multi-user, staticdb -- you won't get table corruption. Since the "next" command only increments by one, it doesn't necessarily fix a table if it's off by more than one; you would still need the additional programming to determine how far off the correct number is. So in that case it would be much less work to determine the next number required and then issue one "autonum" command.
Karen -----Original Message----- From: Dennis McGrath <[email protected]> To: RBASE-L Mailing List <[email protected]> Sent: Mon, Dec 30, 2013 10:05 am Subject: [RBASE-L] - Re: COMPILED APP PROBLEM Hmm, would you issue that kind of command with many users on? Personally, in a multi-user environment, I find NEXT to be the safest option. Dennis McGrath Software Developer QMI Security Solutions 1661 Glenlake Ave Itasca IL 60143 630-980-8461 [email protected] From: [email protected] [mailto:[email protected]] On Behalf Of Karen Tellef Sent: Monday, December 30, 2013 9:58 AM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: COMPILED APP PROBLEM You can issue an "autonum" command even if Staticdb is on. Karen -----Original Message----- From: Dennis McGrath <[email protected]> To: RBASE-L Mailing List <[email protected]> Sent: Mon, Dec 30, 2013 9:53 am Subject: [RBASE-L] - Re: COMPILED APP PROBLEM In a multi-user/staticdb environment, you can bump the autonumber to get it back in sync. set var vNext TEXT = (NEXT(tablename,columnname)) wri .vNext Repeat as necessary Dennis McGrath Software Developer QMI Security Solutions 1661 Glenlake Ave Itasca IL 60143 630-980-8461 [email protected] From: [email protected] [mailto:[email protected]] On Behalf Of Bill Downall Sent: Monday, December 30, 2013 9:46 AM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: COMPILED APP PROBLEM On Mon, Dec 30, 2013 at 10:33 AM, Frank Taylor <[email protected]> wrote: Which brings forth this question, where can I see or select from a system table that will show what the last Autonumber was for the table, thus allow me to check to see if the max(autonumbered col) in a table is greater then what the system shows for that table and would generate at insert Frank, Happy New Year! SET VAR vTableName TEXT = 'YourTableName' SET VAR vColumnName TEXT = 'YourAutonumColName' SELECT d1.SYS_NEXT FROM Sys_Defaults d1, Sys_Columns c2, Sys_Tables t3 + WHERE d1.sys_column_id = c2.sys_column_id + AND c2.sys_table_id = t3.sys_table_id + AND t3.sys_table_name = .vTableName + AND c2.sys_column_Name = .vColumnName SELECT MAX ( &vColumnName ) FROM &vTableName These two queries give you the "next" number to be autoassigned, and the current highest value. You could create a cursor to find all the sys_column_ids where SYS_DEFAULT.Column _ID is not null, and look up the current maxes for those columns. Bill Bill

