Sybase DC38133-01-0902-01 Microscope & Magnifier User Manual


 
set option "PUBLIC"."Global_database_id" = ’1’;
create table extract_id ( next_id integer not null) ;
insert into extract_id values( 1 );
create procedure sp_hook_dbxtract_begin
as
declare @next_id integer
update extract_id set next_id = next_id + 1000
select @next_id = (next_id )
from extract_id
commit
update #hook_dict
set value = @next_id
where name = ’extracted_db_global_id’
Then each extracted or re-extracted database will get a different
Global_database_id. The first starts at 1001, the next at 2001, and so on.
To assist in debugging procedure hooks,
dbxtract
outputs the following
when it is set to operate in verbose mode:
the procedure hooks found
the contents of #hook_dict before the procedure hook is called
the contents of #hook_dict after the procedure hook is called.
How default values are chosen
The public option Global_database_id in each database must be set to a
unique, non-negative integer. The range of default values for a particular
database is
pn
+ 1 to
p
(
n
+ 1), where
p
is the partition size and
n
is the value
of the public option Global_database_id. For example, if the partition size
is 1000 and Global_database_id is set to 3, then the range is from 3001
to 4000.
If Global_database_id is set to a non-negative integer, Adaptive Server
Anywhere chooses default values by applying the following rules:
If the column contains no values in the current partition, the first default
value is
pn
+ 1.
If the column contains values in the current partition, but all are less than
p
(
n
+ 1), the next default value will be one greater than the previous
maximum value in this range.
Default column values are not affect by values in the column outside of
the current partition; that is, by numbers less than
pn
+ 1 or greater than
p
(
n
+ 1). Such values may be present if they have been replicated from
another database via MobiLink synchronization.
132