ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/IdentityColumns/Unit1.lfm
Revision: 158
Committed: Thu Mar 1 11:23:33 2018 UTC (6 years, 2 months ago) by tony
File size: 4860 byte(s)
Log Message:
Repository resync

File Contents

# User Rev Content
1 tony 158 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 = '1.8.1.0'
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 = False
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     DeleteSQL.Strings = (
129     'Delete From IDTEST A'
130     'Where A.KEY = :OLD_KEY'
131     )
132     InsertSQL.Strings = (
133     'Insert Into IDTEST(SOMETEXT)'
134     'Values(:SOMETEXT) RETURNING KEY, COMPTEXT'
135     )
136     RefreshSQL.Strings = (
137     'Select A.COMPTEXT, A.KEY, A.SOMETEXT From IDTEST A'
138     'Where A.KEY = :KEY'
139     )
140     SelectSQL.Strings = (
141     'Select A.COMPTEXT, A.KEY, A.SOMETEXT From IDTEST A'
142     )
143     ModifySQL.Strings = (
144     'Update IDTEST A Set '
145     ' A.SOMETEXT = :SOMETEXT'
146     'Where A.KEY = :OLD_KEY'
147     'RETURNING COMPTEXT'
148     )
149     GeneratorField.ApplyOnEvent = gaeOnNewRecord
150     GenerateParamNames = False
151     DataSetCloseAction = dcSaveChanges
152     left = 400
153     top = 46
154     end
155     object DataSource1: TDataSource
156     DataSet = IBDataSet1
157     left = 326
158     top = 46
159     end
160     object ApplicationProperties1: TApplicationProperties
161     OnIdle = ApplicationProperties1Idle
162     left = 520
163     top = 48
164     end
165     object IBDatabaseInfo1: TIBDatabaseInfo
166     Database = IBDatabase1
167     left = 155
168     top = 114
169     end
170     end