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); |
114 |
|
try |
115 |
|
if assigned(DataSet) then |
116 |
|
begin |
117 |
< |
IBSQLEditFrame1.Database := DataSet.Database; |
118 |
< |
GenerateParams.Checked := DataSet.GenerateParamNames; |
117 |
> |
IBSQLEditFrame1.Database := DataSet.Database; |
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 |
153 |
|
|
154 |
|
procedure TIBSelectSQLEditorForm.SelectPageShow(Sender: TObject); |
155 |
|
begin |
156 |
< |
IBSQLEditFrame1.UserTables.Active := true; |
157 |
< |
end; |
156 |
< |
|
157 |
< |
procedure TIBSelectSQLEditorForm.UserProceduresAfterScroll(DataSet: TDataSet); |
158 |
< |
begin |
159 |
< |
SelectProcedure.Visible := DataSet.FieldByName('RDB$PROCEDURE_TYPE').AsInteger = 2; |
156 |
> |
if (IBSQLEditFrame1.Database <> nil) and IBSQLEditFrame1.Database.Connected then |
157 |
> |
IBSQLEditFrame1.UserTables.Active := true; |
158 |
|
end; |
159 |
|
|
160 |
|
procedure TIBSelectSQLEditorForm.FieldListDblClick(Sender: TObject); |
190 |
|
IBSQLEditFrame1.InsertSelectedOutputParam; |
191 |
|
end; |
192 |
|
|
193 |
+ |
procedure TIBSelectSQLEditorForm.PackageNamesDblClick(Sender: TObject); |
194 |
+ |
begin |
195 |
+ |
IBSQLEditFrame1.InsertPackageName; |
196 |
+ |
end; |
197 |
+ |
|
198 |
|
procedure TIBSelectSQLEditorForm.PrimaryKeysGridDblClick(Sender: TObject); |
199 |
|
begin |
200 |
|
IBSQLEditFrame1.InsertSelectedPrimaryKey; |
222 |
|
|
223 |
|
procedure TIBSelectSQLEditorForm.ExecutePageShow(Sender: TObject); |
224 |
|
begin |
225 |
< |
IBSQLEditFrame1.UserProcedures.Active := true; |
225 |
> |
if (IBSQLEditFrame1.Database <> nil) and IBSQLEditFrame1.Database.Connected then |
226 |
> |
IBSQLEditFrame1.OpenUserProcedures; |
227 |
|
end; |
228 |
|
|
229 |
|
procedure TIBSelectSQLEditorForm.HandleUserTablesOpened(Sender: TObject); |
230 |
|
begin |
231 |
|
SelectSelectAll.Checked := true; |
228 |
– |
SelectProcedure.Visible := false; |
232 |
|
end; |
233 |
|
|
234 |
|
procedure TIBSelectSQLEditorForm.Loaded; |
236 |
|
inherited Loaded; |
237 |
|
if IBSQLEditFrame1 <> nil then |
238 |
|
begin |
239 |
+ |
if PageControl <> nil then |
240 |
+ |
PageControl.ActivePage := SelectPage; |
241 |
|
IBSQLEditFrame1.OnUserTablesOpened := @HandleUserTablesOpened; |
242 |
|
if SelectTableNames <> nil then |
243 |
|
SelectTableNames.ListSource := IBSQLEditFrame1.UserTableSource; |
245 |
|
FieldNamesGrid.DataSource := IBSQLEditFrame1.FieldsSource; |
246 |
|
if PrimaryKeysGrid <> nil then |
247 |
|
PrimaryKeysGrid.DataSource := IBSQLEditFrame1.PrimaryKeySource; |
248 |
+ |
if PackageNames <> nil then |
249 |
+ |
PackageNames.ListSource := IBSQLEditFrame1.PackageNameSource; |
250 |
|
if ProcedureNames <> nil then |
251 |
|
ProcedureNames.ListSource := IBSQLEditFrame1.UserProcSource; |
252 |
|
if InputProcGrid <> nil then |