Subject Re: Server and application names
Author Roberto Freitas
--- In firebird-support@yahoogroups.com, "Ann W. Harrison"
<aharrison@...> wrote:
>
> Roberto Freitas wrote:
> >
> > In this situation, it has been necessary the application to pass
> > a kind of "inoffensive" string to the database server, so we can
> > decide some actions in a trigger depending on that string value,
> > as I've been doing with SQL Server, through string connection
> > parameters. I haven't yet gived up to do it with FireBird ...
>
> Would it be possible to do something like that at the application
> level? Once you've connected to the database, store a record (or
> in V2 set a variable) that identifies your application and make
> tests based on that?
> Regards,
> Ann

I've developed a kind of Distributed Database; in this structure I
need to known (inside triggers) some parameters values coming from
client (the client who is making the update). After implementing this
structure, I've got a great performance improvement in some
applications. It's working very well with SQL Server. In SQL Server
there is a function APP_NAME() that returns a string I
can "inoffensively" set from client, rided on Connection String.
I'm not sure I've correctly understood what you mean, Ann, are you
asking something?
If you are, Adam has proposed a solution on message #74061 that seems
to be a good one: to store these values in an auxiliary table
controlled by CURRENT_CONNECTION number.
I haven't yet implemented it, but it seems to me that it's a good
idea.
With FB2, he has proposed to use the two system functions
RDB$GET_CONTEXT and RDB$SET_CONTEXT to set and get values as I need,
but I don't know if these variables are linked to each client
connection, as necessary. Are they?
Roberto