CREATE TABLE  "USERS" 
   (	"USERID" NUMBER NOT NULL ENABLE, 
	"LOGINNAME" VARCHAR2(50) NOT NULL ENABLE, 
	"LOGINPASSWORD" VARCHAR2(50), 
	"ROLENAME" VARCHAR2(255), 
	"ISADMIN" NUMBER(10,0) NOT NULL ENABLE, 
	"ACCESSI" NUMBER(10,0) NOT NULL ENABLE, 
	"RECORDSTATUS" NUMBER(10,0) DEFAULT 1, 
	"C1" VARCHAR2(255), 
	"C2" VARCHAR2(255), 
	"C3" VARCHAR2(255), 
	"C4" VARCHAR2(255), 
	"C5" VARCHAR2(255), 
	"C6" VARCHAR2(255), 
	"C7" VARCHAR2(255), 
	 CONSTRAINT "USERS_PK" PRIMARY KEY ("USERID") ENABLE
   )
/

CREATE OR REPLACE TRIGGER  "TGR_USERS" 
BEFORE
insert on "USERS"
for each row
  WHEN (new.UserId IS NULL) begin
SELECT (SELECT NVL(MAX(UserId),0)+1  FROM Users)
     INTO   :new.UserId
 FROM   dual;
end;

/
ALTER TRIGGER  "TGR_USERS" ENABLE
/

CREATE TABLE  "USERPERMISSIONS" 
   (	"USERPERMISSIONID" NUMBER(10,0) NOT NULL ENABLE, 
	"USERID" NUMBER(10,0) NOT NULL ENABLE, 
	"PERMISSIONID" NUMBER(10,0) NOT NULL ENABLE, 
	 CONSTRAINT "USERPERMISSIONS_PK" PRIMARY KEY ("USERPERMISSIONID") ENABLE
   )
/

CREATE OR REPLACE TRIGGER  "TGR_USERPERMISSIONS" 
BEFORE
insert on "USERPERMISSIONS"
for each row
  WHEN (new.USERPERMISSIONID IS NULL) begin
 SELECT (SELECT NVL(MAX(USERPERMISSIONID ),0)+1  FROM USERPERMISSIONS)
      INTO   :new.USERPERMISSIONID 
  FROM   dual;
end;

/
ALTER TRIGGER  "TGR_USERPERMISSIONS" ENABLE
/
CREATE TABLE  "PERMISSIONS" 
   (	"PERMISSIONID" NUMBER(10,0) NOT NULL ENABLE, 
	"PERMISSION" VARCHAR2(50) NOT NULL ENABLE, 
	 CONSTRAINT "PERMISSIONS_PK" PRIMARY KEY ("PERMISSIONID") ENABLE
   )
/
CREATE TABLE  "PARALLELDATABASEDETAILS" 
   (	"ISPARALLELDATABASEDOWLOAD" NUMBER(10,0), 
	"DATABASETYPE" VARCHAR2(255), 
	"SERVICE" VARCHAR2(255), 
	"PORT" VARCHAR2(255), 
	"SERVERNAME" VARCHAR2(255), 
	"DATABASENAME" VARCHAR2(255), 
	"DATABASEUSERNAME" VARCHAR2(255), 
	"DATABASEPASSWORD" VARCHAR2(255), 
	"TABLENAME" VARCHAR2(255), 
	"EMPLOYEECODE" VARCHAR2(255), 
	"LOGDATE" VARCHAR2(255), 
	"DIRECTION" VARCHAR2(255), 
	"WORKCODE" VARCHAR2(255), 
	"ISRESERVEDFIELD1" NUMBER(10,0), 
	"ISRESERVEDFIELD2" NUMBER(10,0), 
	"RESERVEDFIELD1" VARCHAR2(255), 
	"RESERVEDFIELD1VALUE" VARCHAR2(255), 
	"RESERVEDFIELD2" VARCHAR2(255), 
	"RESERVEDFIELD2VALUE" VARCHAR2(255), 
	"LOGTIME" VARCHAR2(255), 
	"LOGDATETIME" VARCHAR2(255), 
	"LOGTIMEFORMAT" VARCHAR2(255), 
	"LOGDATETIMEFORMAT" VARCHAR2(255), 
	"LOGDATEFORMAT" VARCHAR2(255), 
	"INVALUE" VARCHAR2(255), 
	"OUTVALUE" VARCHAR2(255)
   )
/
CREATE TABLE  "PARALLELATTLOGEXPORTDETAILS" 
   (	"ISPARALLELDATABASEDOWLOAD" NUMBER(10,0), 
	"DATABASETYPE" VARCHAR2(255), 
	"SERVICE" VARCHAR2(255), 
	"PORT" VARCHAR2(255), 
	"SERVERNAME" VARCHAR2(255), 
	"DATABASENAME" VARCHAR2(255), 
	"DATABASEUSERNAME" VARCHAR2(255), 
	"DATABASEPASSWORD" VARCHAR2(255), 
	"TABLENAME" VARCHAR2(255), 
	"DBPATH" VARCHAR2(255), 
	"ATTENDANCEDATE" VARCHAR2(255), 
	"ATTENDANCEDATEFORMAT" VARCHAR2(255), 
	"EMPLOYEECODE" VARCHAR2(255), 
	"COMPANY" VARCHAR2(255), 
	"CATEGORY" VARCHAR2(255), 
	"DEPARTMENT" VARCHAR2(255), 
	"DESIGNATION" VARCHAR2(255), 
	"EMPLOYEMENTTYPE" VARCHAR2(255), 
	"INDATE" VARCHAR2(255), 
	"INDATEFORMAT" VARCHAR2(255), 
	"INTIME" VARCHAR2(255), 
	"INTIMEFORMAT" VARCHAR2(255), 
	"INDEVICE" VARCHAR2(255), 
	"INLOCATION" VARCHAR2(255), 
	"OUTDATE" VARCHAR2(255), 
	"OUTDATEFORMAT" VARCHAR2(255), 
	"OUTTIME" VARCHAR2(255), 
	"OUTTIMEFORMAT" VARCHAR2(255), 
	"OUTDEVICE" VARCHAR2(255), 
	"OUTLOCATION" VARCHAR2(255), 
	"STATUS" VARCHAR2(255), 
	"STATUSCODE" VARCHAR2(255), 
	"DURATION" VARCHAR2(255), 
	"LATEBY" VARCHAR2(255), 
	"EARLYBY" VARCHAR2(255), 
	"OVERTIME" VARCHAR2(255), 
	"ISONLEAVE" VARCHAR2(255), 
	"LEAVETYPE" VARCHAR2(255), 
	"ISONOD" VARCHAR2(255), 
	"ODDURATION" VARCHAR2(255), 
	"PUNCHRECORDS" VARCHAR2(255), 
	"SHIFTNAME" VARCHAR2(255), 
	"ISRESERVEDFIELD1" NUMBER(10,0), 
	"ISRESERVEDFIELD2" NUMBER(10,0), 
	"ISRESERVEDFIELD3" NUMBER(10,0), 
	"RESERVEDFIELD1" VARCHAR2(255), 
	"RESERVEDFIELD1VALUE" VARCHAR2(255), 
	"RESERVEDFIELD2" VARCHAR2(255), 
	"RESERVEDFIELD2VALUE" VARCHAR2(255), 
	"RESERVEDFIELD3" VARCHAR2(255), 
	"RESERVEDFIELD3VALUE" VARCHAR2(255)
   )
/
CREATE TABLE  "EMPLOYEESBIO" 
   (	"EMPLOYEEBIOID" NUMBER(10,0) NOT NULL ENABLE, 
	"EMPLOYEEID" NUMBER(10,0) NOT NULL ENABLE, 
	"BIOTYPE" VARCHAR2(50), 
	"BIOVERSION" VARCHAR2(50), 
	"BIOID" NUMBER(10,0) NOT NULL ENABLE, 
	"BIO" LONG, 
	 CONSTRAINT "EMPLOYEESBIO_PK" PRIMARY KEY ("EMPLOYEEBIOID") ENABLE
   )
/

CREATE OR REPLACE TRIGGER  "TGR_EMPLOYEESBIO" 
BEFORE
insert on "EMPLOYEESBIO"
for each row
 
  WHEN (new.EmployeeBioId IS NULL) begin
 SELECT (SELECT NVL(MAX(EmployeeBioId),0)+1  FROM EmployeesBio)
      INTO   :new.EmployeeBioId
  FROM   dual;
end;

/
ALTER TRIGGER  "TGR_EMPLOYEESBIO" ENABLE
/
CREATE TABLE  "EMPLOYEES" 
   (	"EMPLOYEEID" NUMBER(10,0) NOT NULL ENABLE, 
	"EMPLOYEENAME" VARCHAR2(50) NOT NULL ENABLE, 
	"EMPLOYEECODE" VARCHAR2(50) NOT NULL ENABLE, 
	"STRINGCODE" VARCHAR2(50) NOT NULL ENABLE, 
	"NUMERICCODE" NUMBER(10,0) NOT NULL ENABLE, 
	"GENDER" VARCHAR2(255) NOT NULL ENABLE, 
	"COMPANYID" NUMBER(10,0) NOT NULL ENABLE, 
	"DEPARTMENTID" NUMBER(10,0) NOT NULL ENABLE, 
	"DESIGNATION" VARCHAR2(255), 
	"CATEGORYID" NUMBER(10,0) NOT NULL ENABLE, 
	"DOJ" DATE DEFAULT TO_DATE('1900-01-01', 'YYYY/MM/DD'), 
	"DOR" DATE DEFAULT TO_DATE('3000-01-01', 'YYYY/MM/DD'), 
	"DOC" DATE DEFAULT TO_DATE('1900-01-01', 'YYYY/MM/DD'), 
	"EMPLOYEECODEINDEVICE" VARCHAR2(50) NOT NULL ENABLE, 
	"EMPLOYEERFIDNUMBER" VARCHAR2(255), 
	"EMPLOYEMENTTYPE" VARCHAR2(255) NOT NULL ENABLE, 
	"STATUS" VARCHAR2(255) NOT NULL ENABLE, 
	"EMPLOYEEDEVICEPASSWORD" VARCHAR2(50) DEFAULT ' ', 
	"EMPLOYEEDEVICEGROUP" VARCHAR2(50) DEFAULT ' ', 
	"FATHERNAME" VARCHAR2(255) DEFAULT ' ', 
	"MOTHERNAME" VARCHAR2(255) DEFAULT ' ', 
	"RESIDENTIALADDRESS" VARCHAR2(255) DEFAULT ' ', 
	"PERMANENTADDRESS" VARCHAR2(255) DEFAULT ' ', 
	"CONTACTNO" VARCHAR2(255) DEFAULT ' ', 
	"EMAIL" VARCHAR2(255) DEFAULT ' ', 
	"DOB" DATE DEFAULT TO_DATE('1900-01-01', 'YYYY-MM-DD'), 
	"PLACEOFBIRTH" VARCHAR2(255) DEFAULT ' ', 
	"NOMENEE1" VARCHAR2(255) DEFAULT ' ', 
	"NOMENEE2" VARCHAR2(255) DEFAULT ' ', 
	"REMARKS" LONG DEFAULT ' ', 
	"RECORDSTATUS" NUMBER(10,0) DEFAULT 1, 
	"C1" VARCHAR2(255), 
	"C2" VARCHAR2(255), 
	"C3" VARCHAR2(255), 
	"C4" VARCHAR2(255), 
	"C5" VARCHAR2(255), 
	"C6" VARCHAR2(255), 
	"C7" VARCHAR2(255), 
	"LOCATION" VARCHAR2(255), 
	"BLOODGROUP" VARCHAR2(255) DEFAULT ' ', 
	"WORKPLACE" VARCHAR2(255) DEFAULT ' ', 
	"EXTENSIONNO" VARCHAR2(255) DEFAULT ' ', 
	"LOGINNAME" VARCHAR2(255) DEFAULT ' ', 
	"LOGINPASSWORD" VARCHAR2(255) DEFAULT ' ', 
	"GRADE" VARCHAR2(255), 
	"TEAM" VARCHAR2(255), 
	"ISRECIEVENOTIFICATION" NUMBER(10,0), 
	"HOLIDAYGROUP" NUMBER(10,0), 
	"SHIFTGROUPID" NUMBER(10,0), 
	"SHIFTROSTERID" NUMBER(10,0), 
	"LASTMODIFIEDBY" VARCHAR2(50), 
	 CONSTRAINT "EMPLOYEES_PK" PRIMARY KEY ("EMPLOYEEID") ENABLE
   )
/

CREATE OR REPLACE TRIGGER  "TGR_EMPLOYEES" 
BEFORE
insert on "EMPLOYEES"
for each row
  WHEN (new.EmployeeId IS NULL) begin
 SELECT (SELECT NVL(MAX(EmployeeId),0)+1  FROM Employees)
      INTO   :new.EmployeeId
  FROM   dual;
end;

/
ALTER TRIGGER  "TGR_EMPLOYEES" ENABLE
/
CREATE TABLE  "DEVICESSTATUS" 
   (	"DEVICESTATUSID" NUMBER(10,0) NOT NULL ENABLE, 
	"DEVICEID" NUMBER(10,0), 
	"DEVICESTATUS" VARCHAR2(255), 
	"LASTDEVICESTATUSON" DATE, 
	 CONSTRAINT "DEVICESTATUS_PK" PRIMARY KEY ("DEVICESTATUSID") ENABLE
   )
/

CREATE OR REPLACE TRIGGER  "TGR_DEVICESTATUS" BEFORE insert on "DEVICESSTATUS" for each row   WHEN (new.DEVICESTATUSID IS NULL) begin SELECT (SELECT NVL(MAX(DEVICESTATUSID),0)+1  FROM DEVICESSTATUS) INTO :new.DEVICESTATUSID FROM   dual; end;
/
ALTER TRIGGER  "TGR_DEVICESTATUS" ENABLE
/
CREATE TABLE  "DEVICES" 
   (	"DEVICEID" NUMBER(10,0) NOT NULL ENABLE, 
	"DEVICEFNAME" VARCHAR2(255) NOT NULL ENABLE, 
	"DEVICESNAME" VARCHAR2(255) NOT NULL ENABLE, 
	"DEVICEDIRECTION" VARCHAR2(255), 
	"SERIALNUMBER" VARCHAR2(255), 
	"CONNECTIONTYPE" VARCHAR2(255), 
	"IPADDRESS" VARCHAR2(255), 
	"BAUDRATE" VARCHAR2(255), 
	"COMMKEY" VARCHAR2(255) NOT NULL ENABLE, 
	"COMPORT" VARCHAR2(255), 
	"LASTLOGDOWNLOADDATE" DATE DEFAULT TO_DATE('01/01/1900', 'MM/DD/YYYY'), 
	"C1" VARCHAR2(255), 
	"C2" VARCHAR2(255), 
	"C3" VARCHAR2(255), 
	"C4" VARCHAR2(255), 
	"C5" VARCHAR2(255), 
	"C6" VARCHAR2(255), 
	"C7" VARCHAR2(255), 
	"TRANSACTIONSTAMP" VARCHAR2(50) DEFAULT '0', 
	"LASTPING" DATE, 
	"DEVICETYPE" VARCHAR2(255), 
	"OPSTAMP" VARCHAR2(255), 
	"DOWNLOADTYPE" NUMBER(10,0), 
	"TIMEZONE" VARCHAR2(50), 
	"DEVICELOCATION" VARCHAR2(50), 
	"TIMEOUT" VARCHAR2(50), 
	 CONSTRAINT "DEVICES_PK" PRIMARY KEY ("DEVICEID") ENABLE
   )
/

CREATE OR REPLACE TRIGGER  "TGR_DEVICES" 
BEFORE
insert on "DEVICES"
for each row
   WHEN (new.DeviceId IS NULL) begin
 SELECT (SELECT NVL(MAX(DeviceId),0)+1  FROM Devices)
      INTO   :new.DeviceId
  FROM   dual;
end;

/
ALTER TRIGGER  "TGR_DEVICES" ENABLE
/
CREATE TABLE  "DEVICEOPERATIONLOGTYPES" 
   (	"OPERATIONLOGTYPEID" NUMBER(10,0) NOT NULL ENABLE, 
	"OPERATIONLOGTYPECODE" NUMBER(10,0), 
	"OPERATIONLOGTYPENAME" VARCHAR2(255), 
	 CONSTRAINT "DEVICEOPERATIONLOGTYPES_PK" PRIMARY KEY ("OPERATIONLOGTYPEID") ENABLE
   )
/

CREATE OR REPLACE TRIGGER  "TGR_DEVICEOPERATIONLOGTYPES" BEFORE insert on "DEVICEOPERATIONLOGTYPES" for each row   WHEN (new.OPERATIONLOGTYPEID IS NULL) begin SELECT (SELECT NVL(MAX(OPERATIONLOGTYPEID),0)+1  FROM DEVICEOPERATIONLOGTYPES) INTO :new.OPERATIONLOGTYPEID FROM   dual; end;
/
ALTER TRIGGER  "TGR_DEVICEOPERATIONLOGTYPES" ENABLE
/
CREATE TABLE  "DEVICEOPERATIONLOGS" 
   (	"DEVICEOPERATIONLOGID" NUMBER(10,0) NOT NULL ENABLE, 
	"DEVICEOPERATIONLOGCODE" NUMBER(10,0), 
	"DEVICEOPERATIONLOGEXECUTEDON" DATE, 
	"SERIALNUMBER" VARCHAR2(255), 
	 CONSTRAINT "DEVICEOPERATIONLOGS_PK" PRIMARY KEY ("DEVICEOPERATIONLOGID") ENABLE
   )
/

CREATE OR REPLACE TRIGGER  "TGR_DEVICEOPERATIONLOGS" BEFORE insert on "DEVICEOPERATIONLOGS" for each row   WHEN (new.DEVICEOPERATIONLOGID IS NULL) begin SELECT (SELECT NVL(MAX(DEVICEOPERATIONLOGID),0)+1  FROM DEVICEOPERATIONLOGS) INTO :new.DEVICEOPERATIONLOGID FROM   dual; end;
/
ALTER TRIGGER  "TGR_DEVICEOPERATIONLOGS" ENABLE
/
CREATE TABLE  "DEVICELOGS" 
   (	"DEVICELOGID" NUMBER(10,0) NOT NULL ENABLE, 
	"DOWNLOADDATE" DATE, 
	"DEVICEID" NUMBER(10,0) NOT NULL ENABLE, 
	"USERID" VARCHAR2(50) NOT NULL ENABLE, 
	"LOGDATE" DATE NOT NULL ENABLE, 
	"DIRECTION" VARCHAR2(255), 
	"ATTDIRECTION" VARCHAR2(255), 
	"C1" VARCHAR2(255), 
	"C2" VARCHAR2(255), 
	"C3" VARCHAR2(255), 
	"C4" VARCHAR2(255), 
	"C5" VARCHAR2(255), 
	"C6" VARCHAR2(255), 
	"C7" VARCHAR2(255), 
	"WORKCODE" VARCHAR2(255), 
	 CONSTRAINT "DEVICESLOGS_PK" PRIMARY KEY ("DEVICELOGID", "USERID", "LOGDATE") ENABLE
   )
/

CREATE OR REPLACE TRIGGER  "TGR_DEVICELOGS" 
BEFORE
insert on "DEVICELOGS"
for each row
  WHEN (new.DeviceLogId IS NULL) begin
 SELECT (SELECT NVL(MAX(DeviceLogId),0)+1  FROM DeviceLogs)
      INTO   :new.DeviceLogId
  FROM   dual;
end;

/
ALTER TRIGGER  "TGR_DEVICELOGS" ENABLE
/
CREATE TABLE  "DEVICEERRORMESSAGES" 
   (	"DEVICEERRORMESSAGEID" NUMBER(10,0) NOT NULL ENABLE, 
	"SERIALNUMBER" VARCHAR2(255), 
	"ERRORMESSAGE" VARCHAR2(255), 
	"LOGSTREAM" VARCHAR2(3000)
   )
/

CREATE OR REPLACE TRIGGER  "TGR_DEVICEERRORMESSAGES" BEFORE insert on "DEVICEERRORMESSAGES" for each row   WHEN (new.DEVICEERRORMESSAGEID IS NULL) begin SELECT (SELECT NVL(MAX(DEVICEERRORMESSAGEID),0)+1  FROM DEVICEERRORMESSAGES) INTO :new.DEVICEERRORMESSAGEID FROM   dual; end;
/
ALTER TRIGGER  "TGR_DEVICEERRORMESSAGES" ENABLE
/
CREATE TABLE  "DEVICECOMMANDS" 
   (	"DEVICECOMMANDID" NUMBER(10,0) NOT NULL ENABLE, 
	"TITLE" VARCHAR2(255), 
	"DEVICECOMMAND" VARCHAR2(4000), 
	"SERIALNUMBER" VARCHAR2(255), 
	"STATUS" VARCHAR2(255), 
	"TYPE" VARCHAR2(255), 
	"CREATIONDATE" DATE, 
	"EXECUTIONDATE" DATE, 
	 CONSTRAINT "DEVICECOMMANDS_PK" PRIMARY KEY ("DEVICECOMMANDID") ENABLE
   )
/

CREATE OR REPLACE TRIGGER  "TGR_DEVICECOMMANDS" BEFORE insert on "DEVICECOMMANDS" for each row   WHEN (new.DEVICECOMMANDID IS NULL) begin SELECT (SELECT NVL(MAX(DEVICECOMMANDID),0)+1  FROM DEVICECOMMANDS) INTO :new.DEVICECOMMANDID FROM   dual; end;
/
ALTER TRIGGER  "TGR_DEVICECOMMANDS" ENABLE
/
CREATE TABLE  "MASTERSETTINGS" 
   (	"MASTERDETAILSID" NUMBER(10,0) NOT NULL ENABLE, 
	"ISALPHANUMERICEMPLOYEECODE" NUMBER(10,0) NOT NULL ENABLE, 
	"ISFIXEDSHIFT" NUMBER(10,0) NOT NULL ENABLE, 
	"SHIFTBEGINTIME" VARCHAR2(255), 
	"SHIFTENDTIME" VARCHAR2(255), 
	"ISDEVICECODESAME" NUMBER(10,0) NOT NULL ENABLE, 
	"ATTENDANCEYEARSTARTMONTH" VARCHAR2(255), 
	"ATTENDANCEYEARSTARTDATE" VARCHAR2(255), 
	"EXTRAHOURSHIFTEXPIRES" NUMBER(10,0), 
	"LIECENCEKEY" VARCHAR2(255), 
	"PUNCHBEGINDURATION" NUMBER(10,0), 
	"VERSION" VARCHAR2(50), 
	"ISAUTOBACKUP" NUMBER(10,0) NOT NULL ENABLE, 
	"AUTOBACKUPPATH" VARCHAR2(255), 
	"BACKUPDAYS" NUMBER(10,0), 
	"LASTBACKUPDATE" VARCHAR2(50), 
	"MINDIFFBETWEENTWOPUNCH" NUMBER(10,0), 
	"ISAUTOSHIFT" NUMBER(10,0), 
	"C1" VARCHAR2(255), 
	"C2" VARCHAR2(255), 
	"C3" VARCHAR2(255), 
	"C4" VARCHAR2(255), 
	"C5" VARCHAR2(255), 
	"C6" VARCHAR2(255), 
	"C7" VARCHAR2(255), 
	"C8" VARCHAR2(255), 
	"C9" VARCHAR2(255), 
	"C10" VARCHAR2(255), 
	"C11" VARCHAR2(255), 
	"C12" VARCHAR2(255), 
	"C13" VARCHAR2(255), 
	"C14" VARCHAR2(255), 
	"C15" VARCHAR2(255), 
	"MEMOABSENTSUBJECT" VARCHAR2(2000), 
	"MEMOLATEEARLYSUBJECT" VARCHAR2(2000), 
	"MEMOMISSEDPUNCHSUBJECT" VARCHAR2(2000), 
	"MEMOSIGNATURE" VARCHAR2(2000), 
	"MEMOABSENTTEXT" VARCHAR2(2000), 
	"MEMOLATEEARLYTEXT" VARCHAR2(2000), 
	"MEMOMISSEDPUNCHTEXT" VARCHAR2(2000), 
	"EMPLOYEEPHOTOPATH" VARCHAR2(255), 
	"VISITORPHOTOPATH" VARCHAR2(255), 
	"VISITORFINGERPRINTPATH" VARCHAR2(255), 
	"VEHICLEPHOTOPATH" VARCHAR2(255), 
	"ISAUTOCLEARLOGS" NUMBER(10,0), 
	"MEMOHALFDAYFORLATEEARLYSUBJECT" VARCHAR2(4000), 
	"MEMOHALFDAYFORLATEEARLYTEXT" VARCHAR2(4000), 
	 CONSTRAINT "MASTERSETTINGS_PK" PRIMARY KEY ("MASTERDETAILSID") ENABLE
   )
/

CREATE OR REPLACE TRIGGER  "TGR_MASTERSETTINGS" 
BEFORE
insert on "MASTERSETTINGS"
for each row
  WHEN (new.MasterDetailsId IS NULL) begin
 SELECT (SELECT NVL(MAX(MasterDetailsId),0)+1  FROM MasterSettings)
      INTO   :new.MasterDetailsId
  FROM   dual;
end;

/
ALTER TRIGGER  "TGR_MASTERSETTINGS" ENABLE
/
CREATE TABLE  "VERIFICATIONMODE" 
   (	"VERIFYMETHODCODE" NUMBER, 
	"VERIFYMETHODNAME" VARCHAR2(4000)
   )
/
CREATE TABLE  "ATTENDANCESTATES" 
   (	"ATTSTATECODE" NUMBER, 
	"ATTSTATENAME" VARCHAR2(4000)
   )
/
Insert into Users(LoginName, LoginPassword, RoleName, IsAdmin, AccessI) values('essl', '79195F54068C15E0DC4AAFDC97740DFC', 'Admin', '-1', '-1')
/
insert into Permissions(PermissionId,Permission) values(1,'Users')
/
insert into Permissions(PermissionId,Permission) values(2,'ViewUsers') 
/
insert into Permissions(PermissionId,Permission) values(3,'AddUsers')
 /
insert into Permissions(PermissionId,Permission) values(4,'EditUsers') 
/
insert into Permissions(PermissionId,Permission) values(5,'DeleteUsers') 
/
insert into Permissions(PermissionId,Permission) values(76,'DeviceManagement')
/
insert into  MasterSettings ( IsAlphaNumericEmployeeCode,  IsFixedShift,  ShiftBeginTime,  ShiftEndTime,  IsDeviceCodeSame,  AttendanceYearStartMonth,  AttendanceYearStartDate,  ExtraHourShiftExpires, LiecenceKey, PunchBeginDuration, Version, IsAutoBackUp, AutoBackuppath, BackupDays, LastBackUpDate, MinDiffBetweenTwoPunch, IsAutoShift, C1, C2, C3, C4, C5 ,IsAutoClearLogs)values(-1, 0, '09:00', '18:30', -1, '1', '1', 240, 'license key', 120, 'eTimeTrackLite 6.6', 0, ' ', 7, '1900-01-01', 5, 0, 'enterprise Software Solutions Lab(eSSL)', 'Bangalore', ' ', ' ', 'http://www.esslindia.com',0)
/
Insert into Devices(DeviceFName, DeviceSName, SerialNumber, DeviceDirection, ConnectionType, IpAddress, BaudRate, ComPort, CommKey,LastPing) values('Manual Entry','ME','0','altinout','Tcp/IP','0',' ',' ','0',To_Date('1900-01-01', 'YYYY-MM-DD'))
/
Insert into Devices(DeviceFName, DeviceSName, SerialNumber, DeviceDirection, ConnectionType, IpAddress, BaudRate, ComPort, CommKey,LastPing) values('System Entry','SE','0','altinout','Tcp/IP','0',' ',' ','0',To_Date('1900-01-01', 'YYYY-MM-DD'))
/
Update MasterSettings 
set  MemoAbsentSubject='ABSENTEEISM NOTICE/MEMO.', MemoLateEarlySubject='LATE-COMING/EARLY-GOING NOTICE/MEMO.', MemoMissedPunchSubject='MISSED OUT PUNCH NOTICE/MEMO.', MemoAbsentText='It has been observed from the Attendance Record that you were Absent from the duty unauthorisedly i.e. without permission on below said attendance date. Please give an explanation to the Authorised person immediately.', MemoLateEarlyText='It has been observed from the Attendance Record that you were  Coming Late or Going Early from the duty unauthorisedly i.e. without permission on below said attendance date. Please give an explanation to the Authorised person immediately.', MemoMissedPunchText='It  has been observed from the Attendance Record that you are not punching properly which is resulting into Missed Out Punch records in our attendance reports. Kindly explain the reason and co-operate with us to know exact out punch.', MemoSignature='Administrator'
/
Insert into AttendanceStates(AttStateCode,AttStateName)values(0,'Check-In')
/
Insert into AttendanceStates(AttStateCode,AttStateName)values(1,'Check-Out')
/
Insert into AttendanceStates(AttStateCode,AttStateName)values(2,'Break-Out')
/
Insert into AttendanceStates(AttStateCode,AttStateName)values(3,'Break-In')
/
Insert into AttendanceStates(AttStateCode,AttStateName)values(4,'OT-In')
/
Insert into AttendanceStates(AttStateCode,AttStateName)values(5,'OT-Out')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(0,'VS_FP_OR_PW_OR_RF_OR_FACE')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(1,'VS_FP')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(2,'VS_PIN')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(3,'VS_PW')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(4,'VS_RF')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(5,'VS_FP_OR_PW')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(6,'VS_FP_OR_RF')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(7,'VS_PW_OR_RF')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(8,'VS_PIN_AND_FP')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(9,'VS_FP_AND_PW')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(10,'VS_FP_AND_RF')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(11,'VS_PW_AND_RF')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(12,'VS_FP_AND_PW_AND_RF')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(13,'VS_PIN_AND_FP_AND_PW')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(14,'VS_FP_AND_RF_OR_PIN')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(15,'VS_FACE')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(16,'VS_FACE_AND_FP')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(17,'VS_FACE_AND_PW')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(18,'VS_FACE_AND_RF')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(19,'VS_FACE_AND_FP_AND_RF')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(20,'VS_FACE_AND_FP_AND_PW')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(21,'VS_OTHER')
/
Insert into VerificationMode(VerifyMethodCode,VerifyMethodName)values(22,'VS_NUM')
/

commit;
        
  








        
  





        





        
  




        
  



