Subject SQL Server SQL syntax 2 Firebird
Author Martijn van der Kooij
Hello,

I try to convert a SQL data export to a Firebird version. De SQL
code I generate is at the bottom of this message.

Currently I use variables and @@IDENTITY to refer to FK-PK
relations, is there a way to do this in Firebird? I do not want to
hard-code the ID's.

Any help would be appreciated!

Greetings,

Martijn van der Kooij

BTW this is a easy example of the resulting code, there is a
relation in de DB from Module > Catagory > Settings and enumerand's

-- Delete old table values
DELETE FROM MODULE_;
DELETE FROM CATEGORY_;
DELETE FROM SETTINGDEFINITION_;
DELETE FROM SETTINGSYSTEMOBJECT_;
DELETE FROM ENUMERAND_;
DELETE FROM ENUMERATION_;
-- write module indentifiers
DECLARE @Module_id_MOD_COMMON int;
-- write catagory indentifiers
-- write enumerand indentifiers
-- write enumeration indentifiers
-- write setting definition indentifiers
DECLARE @SettingDefinition_id_MOD_COMMON__TFormstate_Stabibase int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentSelectionTree int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentExpandedTree0 int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentExpandedTree1 int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentExpandedTree2 int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentExpandedTree3 int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentExpandedTree4 int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentlistID int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentSelectionList int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentExpandedList0 int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentExpandedList1 int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentExpandedList2 int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentExpandedList3 int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentExpandedList4 int;
DECLARE @SettingDefinition_id_MOD_COMMON__FilterName int;
DECLARE @SettingDefinition_id_MOD_COMMON__PreviewHeight int;
DECLARE @SettingDefinition_id_MOD_COMMON__UserStateBool int;
DECLARE @SettingDefinition_id_MOD_COMMON__TGVHeight int;
DECLARE @SettingDefinition_id_MOD_COMMON__TreeWidth int;
DECLARE @SettingDefinition_id_MOD_COMMON__test int;
DECLARE @SettingDefinition_id_MOD_COMMON__test_int int;
DECLARE @SettingDefinition_id_MOD_COMMON__State_TForm2 int;
DECLARE @SettingDefinition_id_MOD_COMMON__State_TForm3 int;
DECLARE @SettingDefinition_id_MOD_COMMON__CurrentAutoCad int;
-- inserting modules

INSERT INTO MODULE_ (VERSION_, NAME_, DESCRIPTION_)
VALUES (0, 'MOD_COMMON', 'SC_MOD_COMMON');
SELECT @Module_id_MOD_COMMON = @@IDENTITY;
-- inserting catagories
-- inserting enumerations
-- inserting enumerand
-- inserting settingdefinitions

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'TFormstate_Stabibase', 'SC_TFormstate_Stabibase', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__TFormstate_Stabibase =
@@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__TFormstate_Stabibase,
NULL, 0, 0, 'Flags=2
ShowCmd=3', 0, 0.00, 0.00, 0.00, 0, 200, 1, 3);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentSelectionTree', 'SC_CurrentSelectionTree', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentSelectionTree =
@@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentSelectionTree,
NULL, 0, 0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentExpandedTree0', 'SC_CurrentExpandedTree0', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentExpandedTree0 =
@@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentExpandedTree0,
NULL, 0, 0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentExpandedTree1', 'SC_CurrentExpandedTree1', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentExpandedTree1 =
@@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentExpandedTree1,
NULL, 0, 0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentExpandedTree2', 'SC_CurrentExpandedTree2', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentExpandedTree2 =
@@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentExpandedTree2,
NULL, 0, 0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentExpandedTree3', 'SC_CurrentExpandedTree3', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentExpandedTree3 =
@@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentExpandedTree3,
NULL, 0, 0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentExpandedTree4', 'SC_CurrentExpandedTree4', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentExpandedTree4 =
@@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentExpandedTree4,
NULL, 0, 0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentlistID', 'SC_CurrentlistID', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentlistID = @@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentlistID, NULL, 0,
2147483647, '', 50, 0.00, 0.00, 0.00, 0, 0, 0, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentSelectionList', 'SC_CurrentSelectionList', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentSelectionList =
@@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentSelectionList,
NULL, 0, 0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentExpandedList0', 'SC_CurrentExpandedList0', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentExpandedList0 =
@@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentExpandedList0,
NULL, 0, 0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentExpandedList1', 'SC_CurrentExpandedList1', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentExpandedList1 =
@@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentExpandedList1,
NULL, 0, 0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentExpandedList2', 'SC_CurrentExpandedList2', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentExpandedList2 =
@@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentExpandedList2,
NULL, 0, 0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentExpandedList3', 'SC_CurrentExpandedList3', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentExpandedList3 =
@@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentExpandedList3,
NULL, 0, 0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentExpandedList4', 'SC_CurrentExpandedList4', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentExpandedList4 =
@@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentExpandedList4,
NULL, 0, 0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'FilterName', 'SC_FilterName', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__FilterName = @@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__FilterName, NULL, 0,
0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'PreviewHeight', 'SC_PreviewHeight', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__PreviewHeight = @@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__PreviewHeight, NULL, 0,
1000, '', 100, 0.00, 0.00, 0.00, 0, 0, 0, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'UserStateBool', 'SC_UserStateBool', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__UserStateBool = @@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__UserStateBool, NULL, 0,
2147483647, '', 0, 0.00, 0.00, 0.00, 0, 0, 0, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'TGVHeight', 'SC_TGVHeight', NULL, @Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__TGVHeight = @@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__TGVHeight, NULL, 0,
1000, '', 250, 0.00, 0.00, 0.00, 0, 0, 0, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'TreeWidth', 'SC_TreeWidth', NULL, @Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__TreeWidth = @@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__TreeWidth, NULL, 0,
1000, '', 150, 0.00, 0.00, 0.00, 0, 0, 0, 1);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'test', 'SC_Test', NULL, @Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__test = @@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__test, NULL, 0, 0, '', 0,
0.00, 0.00, 0.00, 0, 5, 1, 12);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'test_int', 'sc_testint', NULL, @Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__test_int = @@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__test_int, NULL, 0,
100, '', 50, 0.00, 0.00, 0.00, 0, 0, 0, 12);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'State_TForm2', 'SC_State_TForm2', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__State_TForm2 = @@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__State_TForm2, NULL, 0,
0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 3);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'State_TForm3', 'SC_State_TForm3', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__State_TForm3 = @@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__State_TForm3, NULL, 0,
0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 3);

INSERT INTO SETTINGSYSTEMOBJECT_ (VERSION_, NAME_, DESCRIPTION_,
PARENT_ID_, MODULE_ID_)
VALUES (0, 'CurrentAutoCad', 'SC_CurrentAutoCad', NULL,
@Module_id_MOD_COMMON);
SELECT @SettingDefinition_id_MOD_COMMON__CurrentAutoCad = @@IDENTITY;
INSERT INTO SETTINGDEFINITION_ (SETTINGSYSTEMOBJECT_ID_,
ENUMERAND_ID_, MINIMUMINTEGERVALUE_, MAXIMUMINTEGERVALUE_,
DEFAULTSTRINGVALUE_, DEFAULTINTEGERVALUE_, DEFAULTDOUBLEVALUE_,
MINIMUMDOUBLEVALUE_, MAXIMUMDOUBLEVALUE_, DEFAULTBOOLEANVALUE_,
MAXCHARS_, DATATYPE_ID_, SETTINGTYPE_)
VALUES (@SettingDefinition_id_MOD_COMMON__CurrentAutoCad, NULL, 0,
0, '', 0, 0.00, 0.00, 0.00, 0, 200, 1, 3);