42 |
|
TIBSelectSQLEditorForm = class(TForm) |
43 |
|
Button1: TButton; |
44 |
|
Button2: TButton; |
45 |
+ |
PackageNames: TIBLookupComboEditBox; |
46 |
|
InputProcGrid: TIBDynamicGrid; |
47 |
+ |
PackageNameLabel: TLabel; |
48 |
|
OutputProcGrid: TIBDynamicGrid; |
49 |
|
IncludeSysTables: TCheckBox; |
50 |
|
GenerateBtn: TButton; |
53 |
|
PrimaryKeysGrid: TIBDynamicGrid; |
54 |
|
IBSQLEditFrame1: TIBSQLEditFrame; |
55 |
|
ProcedureNames: TIBLookupComboEditBox; |
54 |
– |
SelectProcedure: TLabel; |
56 |
|
SelectSelectAll: TCheckBox; |
57 |
|
SelectTableNames: TIBLookupComboEditBox; |
58 |
|
TestBtn: TButton; |
72 |
|
procedure IncludeSysTablesChange(Sender: TObject); |
73 |
|
procedure InputProcGridDblClick(Sender: TObject); |
74 |
|
procedure OutputProcGridDblClick(Sender: TObject); |
75 |
+ |
procedure PackageNamesDblClick(Sender: TObject); |
76 |
|
procedure PrimaryKeysGridDblClick(Sender: TObject); |
77 |
|
procedure ProcedureNamesDblClick(Sender: TObject); |
78 |
|
procedure SelectSelectAllChange(Sender: TObject); |
83 |
|
procedure FormShow(Sender: TObject); |
84 |
|
procedure PrimaryKeyListDblClick(Sender: TObject); |
85 |
|
procedure SelectPageShow(Sender: TObject); |
84 |
– |
procedure UserProceduresAfterScroll(DataSet: TDataSet); |
86 |
|
private |
87 |
|
{ private declarations } |
88 |
|
procedure HandleUserTablesOpened(Sender: TObject); |
118 |
|
GenerateParams.Checked := DataSet.GenerateParamNames; |
119 |
|
end; |
120 |
|
IBSQLEditFrame1.SQLText.Lines.Assign(SelectSQL); |
121 |
+ |
IBSQLEditFrame1.SelectProcs := true; |
122 |
|
Result := ShowModal = mrOK; |
123 |
|
if Result then |
124 |
|
begin |
142 |
|
begin |
143 |
|
try |
144 |
|
SetSQLStatementType(IBSQLEditFrame1.SyncQueryBuilder); |
145 |
+ |
IncludeSysTables.Checked := IBSQLEditFrame1.IncludeSystemTables; |
146 |
|
except end; |
147 |
|
end; |
148 |
|
end; |
158 |
|
IBSQLEditFrame1.UserTables.Active := true; |
159 |
|
end; |
160 |
|
|
158 |
– |
procedure TIBSelectSQLEditorForm.UserProceduresAfterScroll(DataSet: TDataSet); |
159 |
– |
begin |
160 |
– |
SelectProcedure.Visible := DataSet.FieldByName('RDB$PROCEDURE_TYPE').AsInteger = 2; |
161 |
– |
end; |
162 |
– |
|
161 |
|
procedure TIBSelectSQLEditorForm.FieldListDblClick(Sender: TObject); |
162 |
|
begin |
163 |
|
IBSQLEditFrame1.InsertSelectedFieldName; |
191 |
|
IBSQLEditFrame1.InsertSelectedOutputParam; |
192 |
|
end; |
193 |
|
|
194 |
+ |
procedure TIBSelectSQLEditorForm.PackageNamesDblClick(Sender: TObject); |
195 |
+ |
begin |
196 |
+ |
IBSQLEditFrame1.InsertPackageName; |
197 |
+ |
end; |
198 |
+ |
|
199 |
|
procedure TIBSelectSQLEditorForm.PrimaryKeysGridDblClick(Sender: TObject); |
200 |
|
begin |
201 |
|
IBSQLEditFrame1.InsertSelectedPrimaryKey; |
224 |
|
procedure TIBSelectSQLEditorForm.ExecutePageShow(Sender: TObject); |
225 |
|
begin |
226 |
|
if (IBSQLEditFrame1.Database <> nil) and IBSQLEditFrame1.Database.Connected then |
227 |
< |
IBSQLEditFrame1.UserProcedures.Active := true; |
227 |
> |
IBSQLEditFrame1.OpenUserProcedures; |
228 |
|
end; |
229 |
|
|
230 |
|
procedure TIBSelectSQLEditorForm.HandleUserTablesOpened(Sender: TObject); |
231 |
|
begin |
232 |
|
SelectSelectAll.Checked := true; |
230 |
– |
SelectProcedure.Visible := false; |
233 |
|
end; |
234 |
|
|
235 |
|
procedure TIBSelectSQLEditorForm.Loaded; |
237 |
|
inherited Loaded; |
238 |
|
if IBSQLEditFrame1 <> nil then |
239 |
|
begin |
240 |
+ |
if PageControl <> nil then |
241 |
+ |
PageControl.ActivePage := SelectPage; |
242 |
|
IBSQLEditFrame1.OnUserTablesOpened := @HandleUserTablesOpened; |
243 |
|
if SelectTableNames <> nil then |
244 |
|
SelectTableNames.ListSource := IBSQLEditFrame1.UserTableSource; |
246 |
|
FieldNamesGrid.DataSource := IBSQLEditFrame1.FieldsSource; |
247 |
|
if PrimaryKeysGrid <> nil then |
248 |
|
PrimaryKeysGrid.DataSource := IBSQLEditFrame1.PrimaryKeySource; |
249 |
+ |
if PackageNames <> nil then |
250 |
+ |
PackageNames.ListSource := IBSQLEditFrame1.PackageNameSource; |
251 |
|
if ProcedureNames <> nil then |
252 |
|
ProcedureNames.ListSource := IBSQLEditFrame1.UserProcSource; |
253 |
|
if InputProcGrid <> nil then |