-------------------------------------------------------------------
--PLAIN INSERTS
-------------------------------------------------------------------
--Connection Type Constants
INSERT INTO WPTB.TB_CONNECTIONTYPE (CONNECTIONTYPEID, NAME)
	VALUES(0,'URL');
INSERT INTO WPTB.TB_CONNECTIONTYPE (CONNECTIONTYPEID, NAME)
	VALUES(1,'IP/Port');
INSERT INTO WPTB.TB_CONNECTIONTYPE (CONNECTIONTYPEID, NAME)
	VALUES(2,'Email');

--Adaptor Type Constants
INSERT INTO WPTB.TB_ADAPTORTYPE (ADAPTORTYPEID, NAME)
	VALUES(0, 'NONE');
INSERT INTO WPTB.TB_ADAPTORTYPE (ADAPTORTYPEID, NAME)
	VALUES(1, 'DEFAULT');
INSERT INTO WPTB.TB_ADAPTORTYPE (ADAPTORTYPEID, NAME)
	VALUES(2, 'CUSTOM');

--Adaptor Scope Constants
INSERT INTO WPTB.TB_ADAPTORSCOPE (ADAPTORSCOPEID, NAME)
	VALUES(0, 'APPLICATION');
INSERT INTO WPTB.TB_ADAPTORSCOPE (ADAPTORSCOPEID, NAME)
	VALUES(1, 'MESSAGE');

--Node Definition Type Constants
INSERT INTO WPTB.TB_NODEDEFINITIONTYPE(NODEDEFINITIONTYPEID, NAME)
	VALUES(0, 'SINGLENODE');
INSERT INTO WPTB.TB_NODEDEFINITIONTYPE(NODEDEFINITIONTYPEID, NAME)
	VALUES(1, 'SUPERSTATE');

-------------------------------------------------------------------
--INSERTS FOR INSTALLER
-------------------------------------------------------------------
--Connection Type Constants
BEGIN
	EXECUTE IMMEDIATE 'INSERT INTO WPTB.TB_CONNECTIONTYPE (CONNECTIONTYPEID, NAME)
		VALUES(0,''URL'')';
	EXECUTE IMMEDIATE 'INSERT INTO WPTB.TB_CONNECTIONTYPE (CONNECTIONTYPEID, NAME)
		VALUES(1,''IP/Port'')';
	EXECUTE IMMEDIATE 'INSERT INTO WPTB.TB_CONNECTIONTYPE (CONNECTIONTYPEID, NAME)
		VALUES(2,''Email'')';
	EXCEPTION
		WHEN OTHERS THEN
			wk_message := 'ERROR';
      	  	EXECUTE IMMEDIATE 'INSERT INTO sys.install_table values
            	    (''error in installing of application database objects:  
            	       unable to insert data into TB_CONNECTIONTYPE'')';
      		GOTO bypass_install;
END;
	
--Adaptor Type Constants
BEGIN
	EXECUTE IMMEDIATE 'INSERT INTO WPTB.TB_ADAPTORTYPE (ADAPTORTYPEID, NAME) 
		VALUES(0, ''NONE'')';
	EXECUTE IMMEDIATE 'INSERT INTO WPTB.TB_ADAPTORTYPE (ADAPTORTYPEID, NAME) 
		VALUES(1, ''DEFAULT'')';
	EXECUTE IMMEDIATE 'INSERT INTO WPTB.TB_ADAPTORTYPE (ADAPTORTYPEID, NAME) 
		VALUES(2, ''CUSTOM'')';
	EXCEPTION
		WHEN OTHERS THEN
			wk_message := 'ERROR';
      	  	EXECUTE IMMEDIATE 'INSERT INTO sys.install_table values
            	    (''error in installing of application database objects:  
            	       unable to insert data into TB_ADAPTORTYPE'')';
      		GOTO bypass_install;
END;
--Adaptor Scope Constants
BEGIN
	EXECUTE IMMEDIATE 'INSERT INTO WPTB.TB_ADAPTORSCOPE (ADAPTORSCOPEID, NAME)
		VALUES(0, ''APPLICATION'')';
	EXECUTE IMMEDIATE 'INSERT INTO WPTB.TB_ADAPTORSCOPE (ADAPTORSCOPEID, NAME)
		VALUES(1, ''MESSAGE'')';
	EXCEPTION
		WHEN OTHERS THEN
			wk_message := 'ERROR';
      	  	EXECUTE IMMEDIATE 'INSERT INTO sys.install_table values
            	    (''error in installing of application database objects:  
            	       unable to insert data into TB_ADAPTORSCOPE'')';
      		GOTO bypass_install;
END;
--Node Definition Type Constants
BEGIN
	EXECUTE IMMEDIATE 'INSERT INTO WPTB.TB_NODEDEFINITIONTYPE(NODEDEFINITIONTYPEID, NAME) 
		VALUES(0, ''SINGLENODE'')';
	EXECUTE IMMEDIATE 'INSERT INTO WPTB.TB_NODEDEFINITIONTYPE(NODEDEFINITIONTYPEID, NAME) 
		VALUES(1, ''SUPERSTATE'')';
	EXCEPTION
		WHEN OTHERS THEN
			wk_message := 'ERROR';
      	  	EXECUTE IMMEDIATE 'INSERT INTO sys.install_table values
            	    (''error in installing of application database objects:  
            	       unable to insert data into TB_NODEDEFINITIONTYPE'')';
      		GOTO bypass_install;
END;