
Signature
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
WAIUG Conference
http://www.iiug.org/waiug/present/Forum2006/Forum2006.html
> The long term solution will be to provide a new class of "variables" akin
> of special registers and make application id such a variable.
That will be a welcome improvement.
(and you can't believe how many iterations of that line i went through so it
didn't sound insulting.
"At least you're open to improvment."
"i'm grateful future developers will have that feature."
"It's a nice idea, but too late for me."
i was really trying to give a positive response; i had to ask a colleague
for help. :)
Serge Rielau - 04 Jan 2007 19:20 GMT
> i was really trying to give a positive response; i had to ask a colleague
> for help. :)
I know how hard that is for you. :-)

Signature
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
WAIUG Conference
http://www.iiug.org/waiug/present/Forum2006/Forum2006.html
Amanda - 06 Jan 2007 00:56 GMT
> I know how hard that is for you. :-)
Oh no; i've acquired a reputation! :)
Ian Boyd - 06 Jan 2007 04:19 GMT
Wow, that's scary. i have no idea how my name got changed to "Amanda"
>> I know how hard that is for you. :-)
>
> Oh no; i've acquired a reputation! :)
> It boils down to the fact that application_id() is deterministic within a
> query, and even a session, but not constant as required to be used in e.g.
[quoted text clipped - 4 lines]
> The long term solution will be to provide a new class of "variables" akin
> of special registers and make application id such a variable.
Might want to tell someone to update this technical article
http://www-128.ibm.com/developerworks/db2/library/techarticle/0302stolze/0302sto
lze.html
Near the bottom in the audit log section, there is a trigger named auditT1.
Take a look at the SELECT query into the logins table filtered on
application_id()
> SELECT user_id FROM login L WHERE L.appl_id=application_id()
Knut Stolze - 15 Jan 2007 19:42 GMT
>> It boils down to the fact that application_id() is deterministic within a
>> query, and even a session, but not constant as required to be used in
[quoted text clipped - 6 lines]
>
> Might want to tell someone to update this technical article
http://www-128.ibm.com/developerworks/db2/library/techarticle/0302stolze/0302sto
lze.html
> Near the bottom in the audit log section, there is a trigger named
> auditT1. Take a look at the SELECT query into the logins table filtered on
> application_id()
>
>> SELECT user_id FROM login L WHERE L.appl_id=application_id()
Actually, the function in the article is defined as DETERMINISTIC. The
article existed before DB2 incorporated its own APPLICATION_ID() function.
Therefore, the trigger works fine and would use an index if present (and
deemed as a good thing by the optimizer).
What we should update, however, is the description on the determinism of
that function...

Signature
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany