Does the var_ref value in Database Logging have a maximum limit?
If the var\_ref value exceeds 2,147,483,647 then we get back a negative value rather than the large unsigned int stored in the database.
If the REF value in the var\_ref\_ table exceeds 2,147,483,647 in value, then the var\_ref values that will be stored in user tables will be negative.
For example:
select ref from var\_ref\_table WHERE varname ='%toolkit2.2.value' and tablename='os\_table'
The resulting var\_ref value will be 2,305,291,474. But in the Gateway, the resulting REF value is already translated into a negative value:
DEBUG: Schema1\_0::executePreparedQueryReturnLong QUERY=[SELECT ref FROM var\_ref\_table WHERE varname = :varname AND tablename = :tablename] DATA=[ :varname='*%toolkit2.2.value*' :tablename='os\_table' ]
DEBUG: Schema1\_0::executePreparedQueryReturnLong Returning**-1989675822**
Note
The value for the var_ref column is determined by auto-incrementing positive integer, databases should implement this as the largest value + 1.
MySQL:
CREATE TABLE `node\_ref\_table` (* *`ref` int(11) NOT NULL auto\_increment,*
A 4 byte positive integer displayed to 11 characters when selected.
SQL Server or Sybase:
CREATE TABLE var\_ref\_table (ref numeric(10,0) identity, ...
Positive integer to 10 digits of precision. identity is the auto-increment type.
Oracle:
CREATE TABLE var\_ref\_table (REF NUMERIC(10,0) ...
CREATE SEQUENCE var\_ref\_seq START WITH 1 INCREMENT BY 1 NOMAXVALUE; CREATE TRIGGER var\_ref\_trigger BEFORE INSERT ON var\_ref\_table FOR EACH ROW BEGIN SELECT var\_ref\_seq.nextval INTO :new.REF FROM dual;END;
As before but a trigger is used to auto-increment the value. The gateway should be able to detect the error conditions since version GA4.2 (AA-534).