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]<mailto:[email protected]>>
To: RBASE-L Mailing List <[email protected]<mailto:[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]<mailto:[email protected]>
From: [email protected]<mailto:[email protected]> 
[mailto:[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]<mailto:[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

Reply via email to