Main Tables Views Materialized Views Indexes Constraints Triggers Procedures Functions Packages Sequences Java Sources Jobs Sanity Check Index DDL scrips
Description Columns Primary key Check Constraints Foreign keys Unique Keys Options Indexes Referenced by Triggers Partitions

RHNSERVERACTION

DDL script

Columns

NameTypeNullableDefault valueComment
SERVER_IDNUMBER(38)N  
ACTION_IDNUMBER(38)N  
STATUSNUMBER(38)N  
RESULT_CODENUMBER(38)Y  
RESULT_MSGVARCHAR2(1024)Y  
PICKUP_TIMETIMESTAMP(6) WITH LOCAL TIME ZONEY  
REMAINING_TRIESNUMBER(38)N(5)  
COMPLETION_TIMETIMESTAMP(6) WITH LOCAL TIME ZONEY  
CREATEDTIMESTAMP(6) WITH LOCAL TIME ZONEN(current_timestamp)  
MODIFIEDTIMESTAMP(6) WITH LOCAL TIME ZONEN(current_timestamp)  

Foreign Keys:

Constraint NameColumnsReferenced tableReferenced ConstraintOn Delete Rule
RHN_SERVER_ACTION_AID_FKACTION_ID RHNACTION RHN_ACTION_PK CASCADE
RHN_SERVER_ACTION_SID_FKSERVER_ID RHNSERVER RHN_SERVER_ID_PK NO ACTION
RHN_SERVER_ACTION_STATUS_FKSTATUS RHNACTIONSTATUS RHN_ACTION_STATUS_PK NO ACTION

Unique Keys:

Constraint nameColumns
RHN_SERVER_ACTION_SID_AID_UQSERVER_ID , ACTION_ID

Options:

OptionSettings
TablespaceUSERS
Index OrganizedNo
Generated by OracleNo
ClusteredNo
NestedNo
TemporaryNo

Indexes:

Index NameTypeUnuquenessColumnsDDL script
RHN_SER_ACT_AID_IDXNORMALNONUNIQUEACTION_ID DDL script
RHN_SER_ACT_SID_AID_S_IDXNORMALNONUNIQUESERVER_ID , ACTION_ID , STATUS DDL script

Referenced by:

TableConstraint
RHNACTIONCONFIGCHANNEL RHN_ACTIONCC_SID_AID_FK
RHNACTIONCONFIGFILENAME RHN_ACTIONCF_NAME_AID_SID_FK

Triggers

RHN_SERVER_ACTION_MOD_TRIG

Legend: comment string keyword reserved word operator
CREATE TRIGGER 
rhn_server_action_mod_trig
before insert or update on rhnServerAction
for each row

REFERENCING NEW AS NEW OLD AS OLD
declare
	handle_status	number;
begin
	:new.modified := current_timestamp;
	handle_status := 0;
	if updating then
		if :new.status != :old.status then
			handle_status := 1;
		end if;
	else
		handle_status := 1;
	end if;

	if handle_status = 1 then
		if :new.status = 1 then
			:new.pickup_time := current_timestamp;
		elsif :new.status = 2 then
			:new.completion_time := current_timestamp;
		end if;
	end if;
end;