|
@@ -121,54 +121,54 @@ end;
|
|
|
|
|
|
function TdmSysTables.GetDBObjectNames(DatabaseIndex, TVIndex: Integer; var count: Integer): string;
|
|
|
begin
|
|
|
- Init(DatabaseIndex);
|
|
|
- sqQuery.Close;
|
|
|
- if TVIndex = 1 then // Tables
|
|
|
- sqQuery.SQL.Text:= 'select rdb$relation_name from rdb$relations where rdb$view_blr is null ' +
|
|
|
- ' and (rdb$system_flag is null or rdb$system_flag = 0) order by rdb$relation_name'
|
|
|
- else
|
|
|
- if TVIndex = 2 then // Generators
|
|
|
- sqQuery.SQL.Text:= 'select RDB$GENERATOR_Name from RDB$GENERATORS where RDB$SYSTEM_FLAG = 0 order by rdb$generator_Name'
|
|
|
- else
|
|
|
- if TVIndex = 3 then // Triggers
|
|
|
- sqQuery.SQL.Text:= 'SELECT rdb$Trigger_Name FROM RDB$TRIGGERS WHERE RDB$SYSTEM_FLAG=0 order by rdb$Trigger_Name'
|
|
|
- else
|
|
|
- if TVIndex = 4 then // Views
|
|
|
- sqQuery.SQL.Text:= 'SELECT DISTINCT RDB$VIEW_NAME FROM RDB$VIEW_RELATIONS order by rdb$View_Name'
|
|
|
- else
|
|
|
- if TVIndex = 5 then // Stored Procedures
|
|
|
- sqQuery.SQL.Text:= 'SELECT RDB$Procedure_Name FROM RDB$PROCEDURES order by rdb$Procedure_Name'
|
|
|
- else
|
|
|
- if TVIndex = 6 then // UDF
|
|
|
- sqQuery.SQL.Text:= 'SELECT RDB$FUNCTION_NAME FROM RDB$FUNCTIONS where RDB$SYSTEM_FLAG=0 order by rdb$Function_Name'
|
|
|
- else
|
|
|
- if TVIndex = 7 then // System Tables
|
|
|
- sqQuery.SQL.Text:= 'SELECT RDB$RELATION_NAME FROM RDB$RELATIONS where RDB$SYSTEM_FLAG=1 ' +
|
|
|
- 'order by RDB$RELATION_NAME'
|
|
|
- else
|
|
|
- if TVIndex = 8 then // Domains
|
|
|
- sqQuery.SQL.Text:= 'select RDB$FIELD_NAME from RDB$FIELDS where RDB$Field_Name not like ''RDB$%'' order by rdb$Field_Name'
|
|
|
- else
|
|
|
- if TVIndex = 9 then // Roles
|
|
|
- sqQuery.SQL.Text:= 'select RDB$ROLE_NAME from RDB$ROLES order by rdb$Role_Name'
|
|
|
- else
|
|
|
- if TVIndex = 10 then // Exceptions
|
|
|
- sqQuery.SQL.Text:= 'select RDB$EXCEPTION_NAME from RDB$EXCEPTIONS order by rdb$Exception_Name'
|
|
|
- else
|
|
|
- if TVIndex = 11 then // Users
|
|
|
- sqQuery.SQL.Text:= 'select distinct RDB$User from RDB$USER_PRIVILEGES where RDB$User_Type = 8 order by rdb$User';
|
|
|
+ Init(DatabaseIndex);
|
|
|
+ sqQuery.Close;
|
|
|
+ if TVIndex = 1 then // Tables
|
|
|
+ sqQuery.SQL.Text:= 'select rdb$relation_name from rdb$relations where rdb$view_blr is null ' +
|
|
|
+ ' and (rdb$system_flag is null or rdb$system_flag = 0) order by rdb$relation_name'
|
|
|
+ else
|
|
|
+ if TVIndex = 2 then // Generators
|
|
|
+ sqQuery.SQL.Text:= 'select RDB$GENERATOR_Name from RDB$GENERATORS where RDB$SYSTEM_FLAG = 0 order by rdb$generator_Name'
|
|
|
+ else
|
|
|
+ if TVIndex = 3 then // Triggers
|
|
|
+ sqQuery.SQL.Text:= 'SELECT rdb$Trigger_Name FROM RDB$TRIGGERS WHERE RDB$SYSTEM_FLAG=0 order by rdb$Trigger_Name'
|
|
|
+ else
|
|
|
+ if TVIndex = 4 then // Views
|
|
|
+ sqQuery.SQL.Text:= 'SELECT DISTINCT RDB$VIEW_NAME FROM RDB$VIEW_RELATIONS order by rdb$View_Name'
|
|
|
+ else
|
|
|
+ if TVIndex = 5 then // Stored Procedures
|
|
|
+ sqQuery.SQL.Text:= 'SELECT RDB$Procedure_Name FROM RDB$PROCEDURES order by rdb$Procedure_Name'
|
|
|
+ else
|
|
|
+ if TVIndex = 6 then // UDF
|
|
|
+ sqQuery.SQL.Text:= 'SELECT RDB$FUNCTION_NAME FROM RDB$FUNCTIONS where RDB$SYSTEM_FLAG=0 order by rdb$Function_Name'
|
|
|
+ else
|
|
|
+ if TVIndex = 7 then // System Tables
|
|
|
+ sqQuery.SQL.Text:= 'SELECT RDB$RELATION_NAME FROM RDB$RELATIONS where RDB$SYSTEM_FLAG=1 ' +
|
|
|
+ 'order by RDB$RELATION_NAME'
|
|
|
+ else
|
|
|
+ if TVIndex = 8 then // Domains
|
|
|
+ sqQuery.SQL.Text:= 'select RDB$FIELD_NAME from RDB$FIELDS where RDB$Field_Name not like ''RDB$%'' order by rdb$Field_Name'
|
|
|
+ else
|
|
|
+ if TVIndex = 9 then // Roles
|
|
|
+ sqQuery.SQL.Text:= 'select RDB$ROLE_NAME from RDB$ROLES order by rdb$Role_Name'
|
|
|
+ else
|
|
|
+ if TVIndex = 10 then // Exceptions
|
|
|
+ sqQuery.SQL.Text:= 'select RDB$EXCEPTION_NAME from RDB$EXCEPTIONS order by rdb$Exception_Name'
|
|
|
+ else
|
|
|
+ if TVIndex = 11 then // Users
|
|
|
+ sqQuery.SQL.Text:= 'select distinct RDB$User from RDB$USER_PRIVILEGES where RDB$User_Type = 8 order by rdb$User';
|
|
|
|
|
|
- // Put the result list as comma delemited string
|
|
|
- sqQuery.Open;
|
|
|
- while not sqQuery.EOF do
|
|
|
- begin
|
|
|
- Result:= Result + sqQuery.Fields[0].AsString;
|
|
|
- sqQuery.Next;
|
|
|
- if not sqQuery.EOF then
|
|
|
- Result:= Result + ',';
|
|
|
- end;
|
|
|
- Count:= sqQuery.RecordCount;
|
|
|
- sqQuery.Close;
|
|
|
+ // Put the result list as comma delimited string
|
|
|
+ sqQuery.Open;
|
|
|
+ while not sqQuery.EOF do
|
|
|
+ begin
|
|
|
+ Result:= Result + sqQuery.Fields[0].AsString;
|
|
|
+ sqQuery.Next;
|
|
|
+ if not sqQuery.EOF then
|
|
|
+ Result:= Result + ',';
|
|
|
+ end;
|
|
|
+ Count:= sqQuery.RecordCount;
|
|
|
+ sqQuery.Close;
|
|
|
end;
|
|
|
|
|
|
(*********** Get Trigger Info ***************)
|