Document toolboxDocument toolbox

Sequences and Identity Columns

Many tables within the database require unique numbers to be generated for use as the Primary key within the table, or just as sequences for other purposes. In Oracle this is achieved by use of Oracle Sequences. In SQL Server, these fields are identity columns.

(grey lightbulb) In the below table all min/max values are 1 and 999999999, and cycle by 1, except where stated otherwise

Oracle Sequence Name

min/max values(grey lightbulb)

SQL Server Identity

Column Name

TableUsed to...
activity_no activity_nosp100_activities

Used in packages SPDB_TRIGGERS and SPDB_RESETSEQUENCES.

analysis_nomaxvalue 999999analysis_nosp070_activity_standards

Used in SPDB_RESETSEQUENCES and JobTypeDBImpl.cpp. DbTidy also uses this sequence.

assigned_ports_audit sequence_nosp415_assigned_ports_audit

Used in server code MonitorDBImpl.cpp and processInfo.cpp.

audit_no sequence

sp507_audit_sp100

sp508_audit_sp108

sp509_audit_sp111

sp511_audit_sp206

Used to generate unique identifiers for audit operations. Used in SPDB_AUDIT database package.
(plus)audit_sequence_no audit_seq_nosp822_smaudit 
audit_transaction_id transaction_idsp599_transaction_auditUsed in TransactionDBImpl.cpp.
(plus)break_spec_id break_spec_idsp128_break_patterns 
(plus)bru_nomaxvalue 9999bru_nosp051_brus 
(plus)capacity_pattern_no capacity_pattern_nosp351_capacity_patterns 
(plus)component_no component_nosp400_components 
component_states_audit sequence_nosp403_component_states_audit 
dependency_group_no dependency_group_nosp156_job_dependency_groupsUsed in JobDependencyGroupDBImpl.cpp.
(plus)dru_nomaxvalue 9999dru_nosp053_drus 
employee_no employee_nosp210_employees 
ganttaudit sequencesp500_gantt_audit

 

holiday_specmaxvalue 9999holiday_specsp106_holiday_specifications

 

job_no job_nosp111_jobs 
location_nomaxvalue 9999location_nosp118_work_locations

 

mapping_nomaxvalue 9999mapping_nosp261_task_mapping

 

message_no message_nosp207_dispatch_messages

 

monitor_audit sequence_nosp408_monitor_audit

 

optimizer_run_no optimizer_run_nosp530_optimizer_runs

Used in OptimizerStatisticsDBImpl.cpp.

region_no region_nosp057_regions

 

resource_no resource_nosp211_resources

 

resp_unit_nomaxvalue 9999resp_unit_nosp058_responsibility_units 
shift_specmaxvalue 9999shift_specsp114_shift_specifications

 

(plus)sp073_restrictions_seq restriction_nosp073_restriction_types 
(plus)sp150_category_id category_idsp150_std_act_categories 
(plus)sp263_journey_typeminvalue 256journey_typesp263_journey_types 
(plus)sp350_capacity_categories_seq capacity_category_nosp350_capacity_categories 
(plus)sp419_sequence-no sequence_nosp419_event_audit 
(plus)sp503_sequence_no sequence_nosp503_api_audit 
(plus)sp560_sequence_no sequence_nosp560_travel_status_history 
(plus)sp802_permission_id permission_idsp802_permission

Used in DB Load.

(plus)sp808_role_id role_idsp808_role_definition 
(plus)sp810_param_seq_no permission_parameter

sp810_perm_param_seq

Used to generate unique identifiers for use by both sp803_auth_actual_parameters and sp804_permission_parameters.

(plus)specialperiod_no period_idsp620_special_periods 
(plus)system_state_audit sequence_nosp418_system_state_audit 
team_no team_nosp250_teamsUsed to generate unique identifiers for teams (sp250).

user_category

   

Used to generate unique identifiers for user categories (sp89).

(minus) this sequence is no longer valid and will be removed from future versions of this spec.