-- Generated by BladeSmith 3.60.TC2  DO NOT MODIFY. --

execute procedure ifx_allow_newline('t');

insert into sysbldmodules
	(bld_id, bld_server_type, bld_inst_state)
values
(
	"%SYSBLDNAME%",
	"any", 0
);

insert into sysbldscripts
	(bld_id, blocale_id, bscr_type, bscr_sequence, bscr_sql_script)
values
(
	"%SYSBLDNAME%",
	"any",
	2, 1,
	"clean.sql"
);

insert into sysbldscripts
	(bld_id, blocale_id, bscr_type, bscr_sequence, bscr_sql_script)
values
(
	"%SYSBLDNAME%",
	"any",
	4, 1,
	"upgrade_from_8.1x.sql"
);

CREATE PROCEDURE objects_setup()
  DEFINE nmajor integer;
  DEFINE slevel integer;

  SELECT dbinfo('version','major') INTO nmajor
     FROM systables WHERE tabid = 1;

  IF ( nmajor >= 11 ) THEN

     insert into sysbldscripts
       (bld_id, blocale_id, bscr_type, bscr_sequence, bscr_sql_script)
       values
       ( "%SYSBLDNAME%", "any", 4, 2, "objects_hdr.sql");
     insert into sysbldscripts
       (bld_id, blocale_id, bscr_type, bscr_sequence, bscr_sql_script)
       values
       ( "%SYSBLDNAME%", "any", 4, 3, "objects.sql");
     insert into sysbldscripts
       (bld_id, blocale_id, bscr_type, bscr_sequence, bscr_sql_script)
       values
       ( "%SYSBLDNAME%", "any", 4, 4, "objects_supp.sql");

   ELIF ( nmajor < 10 ) THEN

     insert into sysbldscripts
       (bld_id, blocale_id, bscr_type, bscr_sequence, bscr_sql_script)
       values
       ( "%SYSBLDNAME%", "any", 4, 2, "objects.sql");
     insert into sysbldscripts
       (bld_id, blocale_id, bscr_type, bscr_sequence, bscr_sql_script)
       values
       ( "%SYSBLDNAME%", "any", 4, 3, "objects_supp.sql");

   ELSE

      SELECT substr(
        replace(
         replace(
          replace(
           replace(
            replace(
             replace(
              replace(
               replace(dbinfo('version','level'),'E',' '),
               'T',' '),
              'B',' '),
             'W',' '),
            'X',' '),
           'N',' '),
          'D',' '),
         'V',' '),2,2)::int 
        INTO slevel FROM systables WHERE tabid=1;

      IF ( slevel >= 6 ) THEN
         insert into sysbldscripts
           (bld_id, blocale_id, bscr_type, bscr_sequence, bscr_sql_script)
           values
           ( "%SYSBLDNAME%", "any", 4, 2, "objects_hdr.sql");
         insert into sysbldscripts
           (bld_id, blocale_id, bscr_type, bscr_sequence, bscr_sql_script)
           values
           ( "%SYSBLDNAME%", "any", 4, 3, "objects.sql");
         insert into sysbldscripts
           (bld_id, blocale_id, bscr_type, bscr_sequence, bscr_sql_script)
           values 
           ( "%SYSBLDNAME%", "any", 4, 4, "objects_supp.sql");
      ELSE
         insert into sysbldscripts
           (bld_id, blocale_id, bscr_type, bscr_sequence, bscr_sql_script)
           values
           ( "%SYSBLDNAME%", "any", 4, 2, "objects.sql");
         insert into sysbldscripts
           (bld_id, blocale_id, bscr_type, bscr_sequence, bscr_sql_script)
           values 
           ( "%SYSBLDNAME%", "any", 4, 3, "objects_supp.sql");
      END IF

  END IF
END PROCEDURE;
EXECUTE PROCEDURE objects_setup();
DROP PROCEDURE objects_setup;

insert into sysbldupgrades
	(bld_id, bld_upgrade_like)
values
(
	"%SYSBLDNAME%",
	"spatial.%"
);

insert into sysbldupgrades
	(bld_id, bld_upgrade_like)
values
(
	"%SYSBLDNAME%",
	"ArcSde_Svr.%"
);

insert into sysbldinterfaces
	(bldi_id, bldi_name, bldi_desc)
values
(
	"Ispatial",
	"Ispatial",
	"This DataBlade provides support for the ST_Geometry spatial type hierarchy, and support Web Feature Service.
It is compliant with the OpenGIS specification."
);

insert into sysbldifacprovided
	(bldi_id, bld_id)
values
(
	"Ispatial",
	"%SYSBLDNAME%"
);

insert into sysbldifacrequired
	(bldi_id, bld_id)
values
(
	"ifxrltree1",
	"%SYSBLDNAME%"
);

