Subject Re: Check if an alias is defined
Author Milan Babuskov
Stefan Heymann wrote:
> I agree that aliasing is primarily for security. However, it's also
> about simplification. So for setups that do not try to be Fort Knox,
> it could IMHO be allowed to query the aliases or even manage the
> aliases from a remote machine.

I guess a simple UDF should do the job. Since firebird process has
privileges to read the aliases config file, this UDF could simply open
it and fetch the contents as a string or it could provide a facility
to read the file line-by-line by supplying the line number as parameter:

execute block
returns (line varchar(3000))
as
declare variable lineno integer;
begin
lineno = 1;
while (lineno = 1 and line != '') do
begin
select get_aliases(:lineno) from rdb$database into :line;
lineno = lineno + 1;
suspend;
end
end