1 |
object Form1: TForm1 |
2 |
Left = 414 |
3 |
Height = 468 |
4 |
Top = 150 |
5 |
Width = 830 |
6 |
BorderStyle = bsSingle |
7 |
Caption = 'Identity Column Demo' |
8 |
ClientHeight = 468 |
9 |
ClientWidth = 830 |
10 |
DefaultMonitor = dmPrimary |
11 |
OnCreate = FormCreate |
12 |
OnShow = FormShow |
13 |
Position = poDefaultSizeOnly |
14 |
LCLVersion = '2.0.0.2' |
15 |
object IBDynamicGrid1: TIBDynamicGrid |
16 |
Left = 10 |
17 |
Height = 301 |
18 |
Top = 9 |
19 |
Width = 734 |
20 |
Color = clWindow |
21 |
Columns = < |
22 |
item |
23 |
ReadOnly = True |
24 |
Title.Alignment = taCenter |
25 |
Title.Caption = 'KEY' |
26 |
Width = 60 |
27 |
FieldName = 'KEY' |
28 |
AutoSizeColumn = False |
29 |
InitialSortColumn = False |
30 |
DBLookupProperties.ItemHeight = 0 |
31 |
DBLookupProperties.ItemWidth = 0 |
32 |
DBLookupProperties.AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchAscending] |
33 |
end |
34 |
item |
35 |
Title.Alignment = taCenter |
36 |
Title.Caption = 'SOMETEXT' |
37 |
Width = 200 |
38 |
FieldName = 'SOMETEXT' |
39 |
AutoSizeColumn = True |
40 |
InitialSortColumn = False |
41 |
DBLookupProperties.ItemHeight = 0 |
42 |
DBLookupProperties.ItemWidth = 0 |
43 |
DBLookupProperties.AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchAscending] |
44 |
end |
45 |
item |
46 |
ReadOnly = True |
47 |
Title.Alignment = taCenter |
48 |
Title.Caption = 'COMPTEXT' |
49 |
Width = 200 |
50 |
FieldName = 'COMPTEXT' |
51 |
AutoSizeColumn = True |
52 |
InitialSortColumn = False |
53 |
DBLookupProperties.ItemHeight = 0 |
54 |
DBLookupProperties.ItemWidth = 0 |
55 |
DBLookupProperties.AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchAscending] |
56 |
end> |
57 |
DataSource = DataSource1 |
58 |
Scrollbars = ssAutoVertical |
59 |
TabOrder = 0 |
60 |
ExpandEditorPanelBelowRow = False |
61 |
Descending = False |
62 |
EditorBorderStyle = bsSingle |
63 |
DefaultPositionAtEnd = False |
64 |
end |
65 |
object Button1: TButton |
66 |
Left = 752 |
67 |
Height = 28 |
68 |
Top = 8 |
69 |
Width = 75 |
70 |
Caption = 'Add' |
71 |
OnClick = Button1Click |
72 |
TabOrder = 1 |
73 |
end |
74 |
object PostBtn: TButton |
75 |
Left = 753 |
76 |
Height = 28 |
77 |
Top = 43 |
78 |
Width = 75 |
79 |
Caption = 'Post' |
80 |
OnClick = PostBtnClick |
81 |
TabOrder = 2 |
82 |
end |
83 |
object Label1: TLabel |
84 |
Left = 19 |
85 |
Height = 132 |
86 |
Top = 324 |
87 |
Width = 725 |
88 |
AutoSize = False |
89 |
Caption = 'This test requires Firebird 3 or later. It demonstrates the handling of Identity columns and how INSERT RETURNING (or Update Returning) can also be used to efficiently update COMPUTED BY columns on insert/update. '#10#10'The Application will create a simple database in a temporary location using a local Firebird Server when it is first run.'#10#10'Click on "Add" to insert a new row and on "Post" to insert the row into the database - or just move the cursor to a new column. Rows can be edited in situ. Note the only the "SOMETEXT" column is editable.' |
90 |
ParentColor = False |
91 |
WordWrap = True |
92 |
end |
93 |
object IBDatabase1: TIBDatabase |
94 |
Connected = True |
95 |
AfterConnect = IBDatabase1AfterConnect |
96 |
CreateIfNotExists = True |
97 |
AllowStreamedConnected = False |
98 |
DatabaseName = '$DATADIR$IDTest.fdb' |
99 |
Params.Strings = ( |
100 |
'user_name=SYSDBA' |
101 |
'lc_ctype=UTF8' |
102 |
) |
103 |
DefaultTransaction = IBTransaction1 |
104 |
IdleTimer = 0 |
105 |
TraceFlags = [] |
106 |
UseDefaultSystemCodePage = False |
107 |
OnCreateDatabase = IBDatabase1CreateDatabase |
108 |
left = 149 |
109 |
top = 46 |
110 |
end |
111 |
object IBTransaction1: TIBTransaction |
112 |
Active = False |
113 |
DefaultDatabase = IBDatabase1 |
114 |
Params.Strings = ( |
115 |
'read_committed' |
116 |
'rec_version' |
117 |
'nowait' |
118 |
) |
119 |
left = 240 |
120 |
top = 46 |
121 |
end |
122 |
object IBDataSet1: TIBDataSet |
123 |
AllowAutoActivateTransaction = False |
124 |
Database = IBDatabase1 |
125 |
Transaction = IBTransaction1 |
126 |
BufferChunks = 1000 |
127 |
CachedUpdates = False |
128 |
EnableStatistics = False |
129 |
DeleteSQL.Strings = ( |
130 |
'Delete From IDTEST A' |
131 |
'Where A."KEY" = :OLD_KEY' |
132 |
) |
133 |
InsertSQL.Strings = ( |
134 |
'Insert Into IDTEST (SOMETEXT)' |
135 |
'Values(:SOMETEXT)' |
136 |
' RETURNING "KEY", COMPTEXT' |
137 |
) |
138 |
RefreshSQL.Strings = ( |
139 |
'Select A."KEY", A.SOMETEXT, A.COMPTEXT From IDTEST A' |
140 |
'Where A."KEY" = :"KEY"' |
141 |
) |
142 |
SelectSQL.Strings = ( |
143 |
'Select A."KEY", A.SOMETEXT, A.COMPTEXT From IDTEST A' |
144 |
) |
145 |
ModifySQL.Strings = ( |
146 |
'Update IDTEST A Set ' |
147 |
' A.SOMETEXT = :SOMETEXT' |
148 |
'Where A."KEY" = :OLD_KEY' |
149 |
' RETURNING A.COMPTEXT' |
150 |
) |
151 |
GeneratorField.ApplyOnEvent = gaeOnNewRecord |
152 |
GenerateParamNames = False |
153 |
MasterDetailDelay = 0 |
154 |
DataSetCloseAction = dcSaveChanges |
155 |
left = 400 |
156 |
top = 46 |
157 |
end |
158 |
object DataSource1: TDataSource |
159 |
DataSet = IBDataSet1 |
160 |
left = 326 |
161 |
top = 46 |
162 |
end |
163 |
object ApplicationProperties1: TApplicationProperties |
164 |
OnIdle = ApplicationProperties1Idle |
165 |
left = 520 |
166 |
top = 48 |
167 |
end |
168 |
object IBDatabaseInfo1: TIBDatabaseInfo |
169 |
Database = IBDatabase1 |
170 |
left = 155 |
171 |
top = 114 |
172 |
end |
173 |
end |