-----Prepared by Ganesh [20/02/2013][To create system table entries for Admin Payroll ][Start]-------

--- (A) itm2menu ----

INSERT INTO itm2menu (
	APPLICATION ,
	LEVEL_1 ,
	LEVEL_2 ,
	LEVEL_3 ,
	LEVEL_4 ,
	LEVEL_5 ,
	WIN_NAME ,
	DESCR ,
	COMMENTS ,
	MENU_PATH ,
	ICON_PATH ,
	CLOSE_ICON ,
	OPEN_ICON ,
	OBJ_TYPE ,
	CHG_DATE ,
	CHG_TERM ,
	CHG_USER ,
	MOB_DEPLOY)
VALUES (
	'ADM',
	2,
	26,
	0,
	0,
	0,
	'w_site_stan_paytbl',
	'Site Station PayTable',	
	NULL,
	'ADM.2.26.0.0.0',
	'e12_logo.gif',
	NULL,
	NULL,
	'T',
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL );

COMMIT;

--- (B) obj_forms ----

INSERT INTO obj_forms (
	WIN_NAME,
	TITLE,
	OBJ_BROW_NAME,
	OBJ_EDIT_NAME,
	CROSS_UPDATE_EXPR,
	EXPR_FLD_INFO,
	TARGET_FLD_INFO,
	EXPR_COMMENT,
	FORM_NO,
	SCR_FLAG,
	AUTO_ACCEPT_SCAN,
	SCAN_FLAG,
	SCAN_METADATA,
	PROPERTY_INFO,
	EXT_COM,
	EXT_METADATA,
	EXT_SETUP,
	AFTER_SAVE,
	COLUMN_ON_SAVE,
	SCAN_DELIMITER,
	AUTO_ACCEPT_WEIGHDATA,
	PARENT_KEY_COL,
	FORM_TYPE,
	DISP_METADATA,
	QTY_COL,
	RATE_COL
	)
VALUES (
	'w_site_stan_paytbl',
	'PayTable',
	'd_site_stan_paytbl_brow',
	'd_site_stan_paytbl_edit',
	NULL,
	NULL,
	NULL,
	NULL,
	'1',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

COMMIT;

--- (C) obj_itemchange ----

INSERT INTO obj_itemchange (
	OBJ_NAME ,
	FORM_NO ,
	FIELD_NAME ,
	MANDATORY 
	)
VALUES (
	'site_stan_paytbl',
	'1',
	'site_code',
	NULL);

INSERT INTO obj_itemchange (
	OBJ_NAME ,
	FORM_NO ,
	FIELD_NAME ,
	MANDATORY 
	)
VALUES (
	'site_stan_paytbl',
	'1',
	'state_code',
	NULL);

INSERT INTO obj_itemchange (
	OBJ_NAME ,
	FORM_NO ,
	FIELD_NAME ,
	MANDATORY 
	)
VALUES (
	'site_stan_paytbl',
	'1',
	'stan_code',
	NULL);

INSERT INTO obj_itemchange (
	OBJ_NAME ,
	FORM_NO ,
	FIELD_NAME ,
	MANDATORY 
	)
VALUES (
	'site_stan_paytbl',
	'1',
	'pay_table',
	NULL);

COMMIT;


--- (D) transetup ----

INSERT INTO transetup (
	TRAN_WINDOW,
	SAVE_FLAG,
	VAL_FLAG,
	KEY_FLAG,
	KEY_STRING,
	UDF_1,
	UDF_2,
	UDF_3,
	UDF_4,
	UDF_5,
	REPEATE_ADD,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	EDI_OPTION,
	SITE_ACC_COL,
	CONFIRM_COL ,
	CONFIRM_VAL,
	REPEAT_ADD_DET,
	REPEATADDDET,
	LOAD_MODE,
	AUTO_CONFIRM,
	LEDG_POST_CONF,
	CHG_DATE_ON_CONF,
	TRAN_ID_COL,
	MAIL_OPTION,
	CONFIRM_MODE,
	GARBAGE_OPT,
	VAL_FLAG_EDI ,
	VERIFY_PASSWORD,
	CUST_ACC_COL,
	SALES_PERS_ACC_COL,
	SUPP_ACC_COL,
	ITEM_SER_ACC_CODE,
	EMP_ACC_COL,
	ITEM_SER_ACC_COL,
	WORKFLOW_OPT,
	TABLE_NAME,
	APPLICATION,
	TABLE_DESC,
	TRAN_DATE_COL,
	TRAN_ID__FROM,
	TRAN_ID__TO,
	TABLE_NAME_DET1,
	TABLE_NAME_DET2,
	TABLE_NAME_DET3,
	MULTITIRE_OPT,
	REF_SER,
	VIEW_MODE,
	TAX_FORMS,
	SIGN_STATUS,
	USER_TRAN_WINDOW,
	CUSTOM_PREVIEW_OBJ,
	IGNOREERRLIST_ONLOAD,
	CHILDDATA_ARGOPT,
	EDIT_TMPLT,
	WRKFLW_INIT,
	EDITTAX,
	FORMAL_ARGS,
	AUDIT_TRAIL_OPT,
	EDIT_OPT,
	CACHE_OPT,
	OPTIMIZE_MODE,
	EDIT_EXPR,
	RATE_COL,
	QTY_COL,
	EDIT_EXPR_INP,
	RCP_CACHE_STATUS,
	PRINT_CONTROL)
VALUES (
	'w_site_stan_paytbl',
	'2',
	'2',
	'M',
	'seq10',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'N',
	fn_sysdate(),
	'GANESH',
	'SYSTEM',
	'0',
	NULL,
	NULL,
	NULL,
	'N',
	NULL,
	'E',
	NULL,
	'N',
	NULL,
	NULL,
	NULL,
	'0',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	'SITE_STAN_PAYTBL',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	2,
	NULL,
	'F',
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL);

COMMIT;

--- (E) system_events ----


INSERT INTO system_events (
	OBJ_NAME,
	EVENT_CODE,
	EVENT_CONTEXT,
	SERVICE_CODE,
	METHOD_RULE,
	OVERWRITE_CORE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	RESULT_HANDLE,
	COMP_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'site_stan_paytbl',
	'post_item_change',
	'1',
	'poic_site_stan_paytbl',
	NULL,
	'0',
	fn_sysdate(),
	'BASE ',
	'BASE',
	'2',
	'SiteStanPayTbl',
	'EJB',
	NULL);


INSERT INTO system_events (
	OBJ_NAME,
	EVENT_CODE,
	EVENT_CONTEXT,
	SERVICE_CODE,
	METHOD_RULE,
	OVERWRITE_CORE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	RESULT_HANDLE,
	COMP_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'site_stan_paytbl',
	'pre_validate',
	'1',
	'prv_site_stan_paytbl',
	NULL,
	'0',
	fn_sysdate(),
	'BASE ',
	'BASE',
	'2',
	'SiteStanPayTbl',
	'EJB',
	NULL);

COMMIT;


--- (F) system_event_services ----

INSERT INTO system_event_services (
	SERVICE_CODE,
	SERVICE_DESCR,
	SERVICE_URI,
	SERVICE_PROVIDER,
	METHOD_NAME,
	RETURN_VALUE,
	RETURN_TYPE,
	RETURN_DESCR,
	RETURN_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM
	)
VALUES (
	'poic_site_stan_paytbl',
	'itemchanged',
	'http://localhost:9090/axis/services/ValidatorService',
	NULL,
	'itemChanged',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE');

INSERT INTO system_event_services (
	SERVICE_CODE,
	SERVICE_DESCR,
	SERVICE_URI,
	SERVICE_PROVIDER,
	METHOD_NAME,
	RETURN_VALUE,
	RETURN_TYPE,
	RETURN_DESCR,
	RETURN_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM
	)
VALUES (
	'prv_site_stan_paytbl',
	'Navigate',
	'http://localhost:9090/axis/services/ValidatorService',
	NULL,
	'wfValData',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE');

COMMIT;

----(G) system_service_args ----

---a) For poic_site_stan_paytbl : ---

INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_site_stan_paytbl',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'EJB');

INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_site_stan_paytbl',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'SiteStanPayTbl');
 

INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_site_stan_paytbl',
	3,
	'XML_DATA',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_site_stan_paytbl',
	4,
	'XML_DATA_1',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_site_stan_paytbl',
	5,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_site_stan_paytbl',
	6,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);


INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_site_stan_paytbl',
	7,
	'FOCUSED_COLUMN',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);


INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_site_stan_paytbl',
	8,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);


INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_site_stan_paytbl',
	9,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);

 COMMIT;

---b) For prv_site_stan_paytbl : ---

INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_site_stan_paytbl',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'EJB');
 

INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_site_stan_paytbl',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'SiteStanPayTbl');


INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_site_stan_paytbl',
	3,
	'XML_DATA',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_site_stan_paytbl',
	4,
	'XML_DATA_1',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_site_stan_paytbl',
	5,
	'XML_DATA_ALL',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR ,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_site_stan_paytbl',
	6,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR ,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_site_stan_paytbl',
	7,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);


INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_site_stan_paytbl',
	8,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);

 COMMIT;

---H) obj_actions----------

INSERT INTO obj_actions(
	OBJ_NAME,
	LINE_NO,
	IMAGE,
	DESCRIPTION,
	SERVICE_CODE,
	INTERACTIVE,
	RIGHTS_CHAR,
	TITLE,
	FORM_NO,
	SERVICE_HANDLER,
	PLACEMENT,
	ACTION_TYPE,
	TRAN_TYPE,
	CHG_DATE,
	CHG_TERM,
	CHG_USER )
 VALUES (
	'site_stan_paytbl',
	1,
	'add~normal.gif',
	'Adding New',
	'a',
	'a',
	'A',
	'Add',
	'1',
	NULL,
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL);

INSERT INTO obj_actions(
	OBJ_NAME,
	LINE_NO,
	IMAGE,
	DESCRIPTION,
	SERVICE_CODE,
	INTERACTIVE,
	RIGHTS_CHAR,
	TITLE,
	FORM_NO,
	SERVICE_HANDLER,
	PLACEMENT,
	ACTION_TYPE,
	TRAN_TYPE,
	CHG_DATE,
	CHG_TERM,
	CHG_USER )
 VALUES (
	'site_stan_paytbl',
	2,
	'edit~normal.gif',
	'Editing Existing Record',
	'a',
	'a',
	'E',
	'Edit',
	'1',
	NULL,
	NULL,
	'S',
	NULL,
	NULL,
	NULL,
	NULL);

COMMIT;


-- I) Messages ---

INSERT INTO MESSAGES(
	MSG_NO,
	MSG_STR,
	MSG_DESCR,
	MSG_TYPE,
	MSG_OPT,
	MSG_TIME,
	ALARM,
	ERR_SOURCE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	OVERRIDE_INPUT,
	MAIL_OPTION
	) 
VALUES 
	(
	'VMSTANNULL',
	'Station Code Null',
	'Station Code can not be null or empty',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);

INSERT INTO MESSAGES(
	MSG_NO,
	MSG_STR,
	MSG_DESCR,
	MSG_TYPE,
	MSG_OPT,
	MSG_TIME,
	ALARM,
	ERR_SOURCE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	OVERRIDE_INPUT,
	MAIL_OPTION
	) 
VALUES 
	(
	'VMSTANINVD',
	'Invalid station code',
	'The entered station code is not valid, please enter valid station code',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL
	);
INSERT INTO MESSAGES(
	MSG_NO,
	MSG_STR,
	MSG_DESCR,
	MSG_TYPE,
	MSG_OPT,
	MSG_TIME,
	ALARM,
	ERR_SOURCE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	OVERRIDE_INPUT,
	MAIL_OPTION
	) 
VALUES 
	(
	'VMSTANSTCD',
	'Invalid station code',
	'The entered station code is not valid for the state code, please enter valid station code',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL
	);

INSERT INTO messages(
	MSG_NO,
	MSG_STR,
	MSG_DESCR,
	MSG_TYPE,
	MSG_OPT,
	MSG_TIME,
	ALARM,
	ERR_SOURCE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	OVERRIDE_INPUT,
	MAIL_OPTION
	) 
VALUES 
	(
	'VMSITENULL',
	'Site Code Null',
	'Site Code can not be null or empty',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);


INSERT INTO messages(
	MSG_NO,
	MSG_STR,
	MSG_DESCR,
	MSG_TYPE,
	MSG_OPT,
	MSG_TIME,
	ALARM,
	ERR_SOURCE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	OVERRIDE_INPUT,
	MAIL_OPTION) 
VALUES 
	(
	'VMSTATNULL',
	'State Code Null',
	'State Code can not be null or empty',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);


INSERT INTO messages(
	MSG_NO,
	MSG_STR,
	MSG_DESCR,
	MSG_TYPE,
	MSG_OPT,
	MSG_TIME,
	ALARM,
	ERR_SOURCE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	OVERRIDE_INPUT,
	MAIL_OPTION) 
VALUES 
	(
	'VMPAYTBNUL',
	'Pay Table Null',
	'Pay Table can not be null or empty',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);


INSERT INTO messages(
	MSG_NO,
	MSG_STR,
	MSG_DESCR,
	MSG_TYPE,
	MSG_OPT,
	MSG_TIME,
	ALARM,
	ERR_SOURCE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	OVERRIDE_INPUT,
	MAIL_OPTION) 
VALUES 
	(
	'VMSITEINVD',
	'Invalid Site Code',
	'Entered site code is not present, please enter valid site code',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);


INSERT INTO messages(
	MSG_NO,
	MSG_STR,
	MSG_DESCR,
	MSG_TYPE,
	MSG_OPT,
	MSG_TIME,
	ALARM,
	ERR_SOURCE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	OVERRIDE_INPUT,
	MAIL_OPTION
	) 
VALUES 
	(
	'VMSTATINVD',
	'Invalid State Code',
	'The entered state code is not present, please enter valid state code',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);



INSERT INTO messages(
	MSG_NO,
	MSG_STR,
	MSG_DESCR,
	MSG_TYPE,
	MSG_OPT,
	MSG_TIME,
	ALARM,
	ERR_SOURCE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	OVERRIDE_INPUT,
	MAIL_OPTION
	) 
VALUES 
	(
	'VMPTBLINVD',
	'Invalid Pay Table',
	'The entered pay table is not present, please enter valid pay table',
	'E',
	'Y',
	NULL,
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL,
	NULL);

COMMIT;

-- J) Pop help--

---1. For SITE_CODE--

INSERT INTO POPHELP (
	FIELD_NAME,
	MOD_NAME,
	SQL_STR,
	DW_OBJECT,
	MSG_TITLE,
	WIDTH,
	HEIGHT,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	DIST_OPT,
	FILTER_STRING,
	SQL_INPUT,
	DEFAULT_COL,
	POP_ALIGN,
	QUERY_MODE,
	PAGE_CONTEXT,
	POPHELP_COLS,
	POPHELP_SOURCE,
	MULTI_OPT,
	HELP_OPTION)
VALUES (
	'SITE_CODE',
	'W_SITE_STAN_PAYTBL',
	'SELECT  SITE_CODE , DESCR FROM SITE',
	NULL,
	'Site',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);


---2. For STATE_CODE--

INSERT INTO POPHELP (
	FIELD_NAME,
	MOD_NAME,
	SQL_STR,
	DW_OBJECT,
	MSG_TITLE,
	WIDTH,
	HEIGHT,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	DIST_OPT,
	FILTER_STRING,
	SQL_INPUT,
	DEFAULT_COL,
	POP_ALIGN,
	QUERY_MODE,
	PAGE_CONTEXT,
	POPHELP_COLS,
	POPHELP_SOURCE,
	MULTI_OPT,
	HELP_OPTION)
VALUES (
	'STATE_CODE',
	'W_SITE_STAN_PAYTBL',
	'SELECT STATE_CODE,DESCR FROM STATE',
	NULL,
	'State',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);

---3. For STAN_CODE--

INSERT INTO POPHELP (
	FIELD_NAME,
	MOD_NAME,
	SQL_STR,
	DW_OBJECT,
	MSG_TITLE,
	WIDTH,
	HEIGHT,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	DIST_OPT,
	FILTER_STRING,
	SQL_INPUT,
	DEFAULT_COL,
	POP_ALIGN,
	QUERY_MODE,
	PAGE_CONTEXT,
	POPHELP_COLS,
	POPHELP_SOURCE,
	MULTI_OPT,
	HELP_OPTION)
VALUES (
	'STAN_CODE',
	'W_SITE_STAN_PAYTBL',
	'SELECT  STAN_CODE, DESCR FROM STATION WHERE STATE_CODE = ''?''',
	NULL,
	'Station',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	':state_code',
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);


COMMIT;


---4. For PAY_TABLE--

INSERT INTO POPHELP (
	FIELD_NAME,
	MOD_NAME,
	SQL_STR,
	DW_OBJECT,
	MSG_TITLE,
	WIDTH,
	HEIGHT,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	DIST_OPT,
	FILTER_STRING,
	SQL_INPUT,
	DEFAULT_COL,
	POP_ALIGN,
	QUERY_MODE,
	PAGE_CONTEXT,
	POPHELP_COLS,
	POPHELP_SOURCE,
	MULTI_OPT,
	HELP_OPTION)
VALUES (
	'PAY_TABLE',
	'W_SITE_STAN_PAYTBL',
	'SELECT PAY_TABLE, DESCR FROM PAYTABLE',
	NULL,
	'Pay Table',
	0,
	0,
	fn_sysdate(),
	'BASE',
	'BASE',
	'0',
	NULL,
	NULL,
	0,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
	);

COMMIT;


-- K) For new table SITE_STAN_PAYTBL

CREATE TABLE SITE_STAN_PAYTBL
	(
		SITE_CODE CHAR(5) NOT NULL ,
		STATE_CODE CHAR(5) NOT NULL ,
		STAN_CODE CHAR(5) NOT NULL ,
		PAY_TABLE CHAR(5) NOT NULL ,
		CHG_DATE DATE NOT NULL,
		CHG_USER VARCHAR2(10) NOT NULL,
		CHG_TERM VARCHAR2(15) NOT NULL
	);
ALTER TABLE SITE_STAN_PAYTBL ADD CONSTRAINT SITE_STAN_PAYTBL_X PRIMARY KEY (SITE_CODE,STATE_CODE,STAN_CODE);
ALTER TABLE SITE_STAN_PAYTBL ADD CONSTRAINT FK_SITESTANPAYTBL_SITE FOREIGN KEY ( SITE_CODE ) REFERENCES SITE ;
ALTER TABLE SITE_STAN_PAYTBL ADD CONSTRAINT FK_SITESTANPAYTBL_STAT FOREIGN KEY ( STATE_CODE ) REFERENCES STATE;


----------- System Entries for ITM ----------------

INSERT INTO system_events (
	OBJ_NAME,
	EVENT_CODE,
	EVENT_CONTEXT,
	SERVICE_CODE,
	METHOD_RULE,
	OVERWRITE_CORE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	RESULT_HANDLE,
	COMP_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'w_site_stan_paytbl',
	'ITEMCHANGED',
	'1',
	'poic_itm_site_stan_paytbl',
	NULL,
	'0',
	fn_sysdate(),
	'BASE ',
	'BASE',
	'2',
	'SiteStanPayTbl',
	'EJB',
	NULL);


INSERT INTO system_events (
	OBJ_NAME,
	EVENT_CODE,
	EVENT_CONTEXT,
	SERVICE_CODE,
	METHOD_RULE,
	OVERWRITE_CORE,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	RESULT_HANDLE,
	COMP_NAME,
	COMP_TYPE,
	COMM_FORMAT)
VALUES (
	'w_site_stan_paytbl',
	'VALDATA',
	'1',
	'prv_itm_site_stan_paytbl',
	NULL,
	'0',
	fn_sysdate(),
	'BASE ',
	'BASE',
	'2',
	'SiteStanPayTbl',
	'EJB',
	NULL);

COMMIT;

INSERT INTO system_event_services (
	SERVICE_CODE,
	SERVICE_DESCR,
	SERVICE_URI,
	SERVICE_PROVIDER,
	METHOD_NAME,
	RETURN_VALUE,
	RETURN_TYPE,
	RETURN_DESCR,
	RETURN_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM
	)
VALUES (
	'poic_itm_site_stan_paytbl',
	'itemchanged',
	'http://localhost:9090/axis/services/ValidatorService',
	NULL,
	'itemChanged',
	'String',
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE');

INSERT INTO system_event_services (
	SERVICE_CODE,
	SERVICE_DESCR,
	SERVICE_URI,
	SERVICE_PROVIDER,
	METHOD_NAME,
	RETURN_VALUE,
	RETURN_TYPE,
	RETURN_DESCR,
	RETURN_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM
	)
VALUES (
	'prv_itm_site_stan_paytbl',
	'Navigate',
	'http://localhost:9090/axis/services/ValidatorService',
	NULL,
	'wf_val_data',
	NULL,
	'S',
	NULL,
	NULL,
	fn_sysdate(),
	'BASE ',
	'BASE');

COMMIT;

INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_itm_site_stan_paytbl',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'EJB');

INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_itm_site_stan_paytbl',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'SiteStanPayTbl');
 

INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_itm_site_stan_paytbl',
	3,
	'TAB_XML_DATA',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_itm_site_stan_paytbl',
	4,
	'TAB_XML_DATA_1',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_itm_site_stan_paytbl',
	5,
	'TAB_XML_DATA_2',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_itm_site_stan_paytbl',
	6,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);


INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_itm_site_stan_paytbl',
	7,
	'FOCUSED_COLUMN',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);


INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_itm_site_stan_paytbl',
	8,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);


INSERT INTO system_service_args  (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE )
VALUES (
	'poic_itm_site_stan_paytbl',
	9,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);

 COMMIT;

INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_itm_site_stan_paytbl',
	1,
	'COMPONENT_TYPE',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'EJB');
 

INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_itm_site_stan_paytbl',
	2,
	'COMPONENT_NAME',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	'SiteStanPayTbl');


INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_itm_site_stan_paytbl',
	3,
	'TAB_XML_DATA',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_itm_site_stan_paytbl',
	4,
	'TAB_XML_DATA_1',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_itm_site_stan_paytbl',
	5,
	'TAB_XML_DATA_2',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR ,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_itm_site_stan_paytbl',
	6,
	'OBJ_CONTEXT',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
 

INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR ,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_itm_site_stan_paytbl',
	7,
	'EDIT_FLAG',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);


INSERT INTO system_service_args (
	SERVICE_CODE,
	LINE_NO,
	ARG_NAME,
	ARG_MODE,
	DESCR,
	ARG_TYPE,
	ARG_XFRM,
	CHG_DATE,
	CHG_USER,
	CHG_TERM,
	ARG_VALUE)
values (
	'prv_itm_site_stan_paytbl',
	8,
	'XTRA_PARAMS',
	'I',
	NULL,
	'S',
	NULL,
	fn_sysdate(),
	'BASE',
	'BASE',
	NULL);
COMMIT;
