1 |
object Form1: TForm1
|
2 |
Left = 777
|
3 |
Height = 556
|
4 |
Top = 253
|
5 |
Width = 656
|
6 |
Caption = 'IBStoredProc Demo'
|
7 |
ClientHeight = 556
|
8 |
ClientWidth = 656
|
9 |
DefaultMonitor = dmPrimary
|
10 |
OnCreate = FormCreate
|
11 |
OnShow = FormShow
|
12 |
Position = poDefaultSizeOnly
|
13 |
LCLVersion = '1.8.3.0'
|
14 |
object Label1: TLabel
|
15 |
Left = 26
|
16 |
Height = 14
|
17 |
Top = 8
|
18 |
Width = 77
|
19 |
Caption = 'Output Table'
|
20 |
ParentColor = False
|
21 |
end
|
22 |
object IBDynamicGrid1: TIBDynamicGrid
|
23 |
Left = 26
|
24 |
Height = 145
|
25 |
Top = 26
|
26 |
Width = 606
|
27 |
Anchors = [akTop, akLeft, akRight]
|
28 |
Color = clWindow
|
29 |
Columns = <
|
30 |
item
|
31 |
Title.Alignment = taCenter
|
32 |
Title.Caption = 'Line No.'
|
33 |
Width = 100
|
34 |
FieldName = 'LINE_NUM'
|
35 |
AutoSizeColumn = False
|
36 |
InitialSortColumn = False
|
37 |
DBLookupProperties.ItemHeight = 0
|
38 |
DBLookupProperties.ItemWidth = 0
|
39 |
DBLookupProperties.AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchAscending]
|
40 |
end
|
41 |
item
|
42 |
Title.Alignment = taCenter
|
43 |
Title.Caption = 'Content'
|
44 |
Width = 150
|
45 |
FieldName = 'CONTENT'
|
46 |
AutoSizeColumn = True
|
47 |
InitialSortColumn = False
|
48 |
DBLookupProperties.ItemHeight = 0
|
49 |
DBLookupProperties.ItemWidth = 0
|
50 |
DBLookupProperties.AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchAscending]
|
51 |
end>
|
52 |
DataSource = DataSource1
|
53 |
Scrollbars = ssAutoVertical
|
54 |
TabOrder = 0
|
55 |
ExpandEditorPanelBelowRow = False
|
56 |
Descending = False
|
57 |
EditorBorderStyle = bsSingle
|
58 |
DefaultPositionAtEnd = False
|
59 |
end
|
60 |
object Label2: TLabel
|
61 |
Left = 26
|
62 |
Height = 14
|
63 |
Top = 176
|
64 |
Width = 31
|
65 |
Caption = 'Lines'
|
66 |
ParentColor = False
|
67 |
end
|
68 |
object Memo1: TMemo
|
69 |
Left = 26
|
70 |
Height = 120
|
71 |
Top = 192
|
72 |
Width = 598
|
73 |
Anchors = [akTop, akLeft, akRight]
|
74 |
Lines.Strings = (
|
75 |
'Memo1'
|
76 |
)
|
77 |
ScrollBars = ssAutoBoth
|
78 |
TabOrder = 1
|
79 |
end
|
80 |
object Button1: TButton
|
81 |
Left = 520
|
82 |
Height = 28
|
83 |
Top = 351
|
84 |
Width = 107
|
85 |
Anchors = [akTop, akRight]
|
86 |
Caption = 'Populate Table'
|
87 |
OnClick = Button1Click
|
88 |
TabOrder = 2
|
89 |
end
|
90 |
object GetLinesBtn: TButton
|
91 |
Left = 520
|
92 |
Height = 28
|
93 |
Top = 390
|
94 |
Width = 107
|
95 |
Anchors = [akTop, akRight]
|
96 |
Caption = 'Get Lines'
|
97 |
OnClick = GetLinesBtnClick
|
98 |
TabOrder = 3
|
99 |
end
|
100 |
object Label3: TLabel
|
101 |
Left = 35
|
102 |
Height = 231
|
103 |
Top = 319
|
104 |
Width = 477
|
105 |
Anchors = [akTop, akLeft, akRight, akBottom]
|
106 |
AutoSize = False
|
107 |
Caption = 'This demonstrates the use of TIBStoredProc with the Firebird 3 packages example provided with the Firebird 3 source code. A database is created in a temporary location when the application is first run. Once this completes, click on "Populate Table". This uses IBStoredProc2 to call the global stored procedure "test", which populates the temporary table displayed above.'#10#10'Now click on Get Lines. This uses IBStoredProc1 to call the GET_LINES procedure in the FB$OUT package. It returns a text blob which is then shown in the TMemo control.'#10#10'After the database has been created you can inspect the TIBStoredProc properties. '
|
108 |
ParentColor = False
|
109 |
WordWrap = True
|
110 |
end
|
111 |
object IBDatabase1: TIBDatabase
|
112 |
Connected = False
|
113 |
CreateIfNotExists = True
|
114 |
AllowStreamedConnected = False
|
115 |
DatabaseName = '$DATADIR$sptest.fdb'
|
116 |
Params.Strings = (
|
117 |
'user_name=SYSDBA'
|
118 |
)
|
119 |
DefaultTransaction = IBTransaction1
|
120 |
IdleTimer = 0
|
121 |
TraceFlags = []
|
122 |
UseDefaultSystemCodePage = False
|
123 |
OnCreateDatabase = IBDatabase1CreateDatabase
|
124 |
left = 130
|
125 |
top = 65
|
126 |
end
|
127 |
object IBTransaction1: TIBTransaction
|
128 |
Active = False
|
129 |
DefaultDatabase = IBDatabase1
|
130 |
left = 240
|
131 |
top = 65
|
132 |
end
|
133 |
object IBStoredProc1: TIBStoredProc
|
134 |
AllowAutoActivateTransaction = False
|
135 |
Database = IBDatabase1
|
136 |
Transaction = IBTransaction1
|
137 |
PackageName = 'FB$OUT'
|
138 |
StoredProcName = 'GET_LINES'
|
139 |
Params = <
|
140 |
item
|
141 |
DataType = ftBlob
|
142 |
Name = 'LINES'
|
143 |
ParamType = ptOutput
|
144 |
end>
|
145 |
left = 454
|
146 |
top = 68
|
147 |
ParamData = <
|
148 |
item
|
149 |
DataType = ftBlob
|
150 |
Name = 'LINES'
|
151 |
ParamType = ptOutput
|
152 |
end>
|
153 |
end
|
154 |
object IBStoredProc2: TIBStoredProc
|
155 |
AllowAutoActivateTransaction = False
|
156 |
Database = IBDatabase1
|
157 |
Transaction = IBTransaction1
|
158 |
StoredProcName = 'TEST'
|
159 |
Params = <>
|
160 |
left = 551
|
161 |
top = 70
|
162 |
end
|
163 |
object IBQuery1: TIBQuery
|
164 |
AllowAutoActivateTransaction = False
|
165 |
Database = IBDatabase1
|
166 |
Transaction = IBTransaction1
|
167 |
BufferChunks = 1000
|
168 |
CachedUpdates = False
|
169 |
EnableStatistics = False
|
170 |
GenerateParamNames = False
|
171 |
GeneratorField.ApplyOnEvent = gaeOnNewRecord
|
172 |
MasterDetailDelay = 0
|
173 |
SQL.Strings = (
|
174 |
'Select A.LINE_NUM, A.CONTENT From FB$OUT_TABLE A'
|
175 |
)
|
176 |
Params = <>
|
177 |
DataSetCloseAction = dcDiscardChanges
|
178 |
left = 133
|
179 |
top = 128
|
180 |
end
|
181 |
object DataSource1: TDataSource
|
182 |
DataSet = IBQuery1
|
183 |
left = 56
|
184 |
top = 129
|
185 |
end
|
186 |
object ApplicationProperties1: TApplicationProperties
|
187 |
OnIdle = ApplicationProperties1Idle
|
188 |
left = 239
|
189 |
top = 131
|
190 |
end
|
191 |
object IBDatabaseInfo1: TIBDatabaseInfo
|
192 |
Database = IBDatabase1
|
193 |
left = 368
|
194 |
top = 130
|
195 |
end
|
196 |
end
|