Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Get OS user name in SQL script based trigger?

10 posts in Trigger Last posting was on 2007-11-22 10:00:58.0Z
Thomas Steinmaurer Posted on 2007-11-03 12:46:37.0Z
Date: Sat, 03 Nov 2007 13:46:37 +0100
From: Thomas Steinmaurer <t.steinmaurer_dontbugmewithspam_@upscene.com>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Get OS user name in SQL script based trigger?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 86.56.229.75
Message-ID: <472c6c52@solutions.advantagedatabase.com>
X-Trace: 3 Nov 2007 06:40:50 -0700, 86.56.229.75
Lines: 20
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!86.56.229.75
Xref: solutions.advantagedatabase.com Advantage.Trigger:350
Article PK: 1136413

Hello,

is there a way to get the connected OS user name in a SQL script based
trigger? There are several sp_ procedures available, which give me the
entire information for the server.

So, basically, I'm looking for a scalar procedure/function like
sp_GetApplicationID, which gives me some more information about the
connection, like e.g. OS user, client IP address, ...

Thanks!

--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com


Joachim Duerr (ADS) Posted on 2007-11-05 11:09:45.0Z
From: "Joachim Duerr (ADS)" <jojo.duerr@gmx.de>
Subject: Re: Get OS user name in SQL script based trigger?
Newsgroups: Advantage.Trigger
References: <472c6c52@solutions.advantagedatabase.com>
Organization: iAnywhere
User-Agent: XanaNews/1.18.1.2
X-Face: ,QMv7[luB)BpWAQ~:"kw6n%0ieY63.:g2K3n~8ky0;||5Xle*Xq+=~<Fy:0CVC2nx@8~vZ
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 10.56.66.108
Message-ID: <472ef9f9@solutions.advantagedatabase.com>
Date: 5 Nov 2007 04:09:45 -0700
X-Trace: 5 Nov 2007 04:09:45 -0700, 10.56.66.108
Lines: 27
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.56.66.108
Xref: solutions.advantagedatabase.com Advantage.Trigger:351
Article PK: 1136414


Thomas Steinmaurer wrote in <472c6c52@solutions.advantagedatabase.com>:

> is there a way to get the connected OS user name in a SQL script
> based trigger? There are several sp_ procedures available, which give
> me the entire information for the server.
>
> So, basically, I'm looking for a scalar procedure/function like
> sp_GetApplicationID, which gives me some more information about the
> connection, like e.g. OS user, client IP address, ...

a mix of:

select user() from system.iota (get the pc name)
and
execute procedure sp_mgGetConnectedUsers()

should do it. Unfortunately, if there are several users with the same
PC name (e.g. via a terminal server), you will get a list with distinct
user names/OS login names/ts addresses.

HTH

--
Joachim Duerr
System Consultant (Advantage Database Server)
Sybase iAnywhere
advantagesupport[AT]ianywhere.com


Thomas Steinmaurer Posted on 2007-11-06 14:37:54.0Z
Date: Tue, 06 Nov 2007 15:37:54 +0100
From: Thomas Steinmaurer <t.steinmaurer_dontbugmewithspam@upscene.com>
User-Agent: Thunderbird 1.5.0.13 (Windows/20070809)
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Get OS user name in SQL script based trigger?
References: <472c6c52@solutions.advantagedatabase.com> <472ef9f9@solutions.advantagedatabase.com>
In-Reply-To: <472ef9f9@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 193.186.164.88
Message-ID: <47307ac3@solutions.advantagedatabase.com>
X-Trace: 6 Nov 2007 07:31:31 -0700, 193.186.164.88
Lines: 35
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!193.186.164.88
Xref: solutions.advantagedatabase.com Advantage.Trigger:352
Article PK: 1136416

Hello Joachim,

>> is there a way to get the connected OS user name in a SQL script
>> based trigger? There are several sp_ procedures available, which give
>> me the entire information for the server.
>>
>> So, basically, I'm looking for a scalar procedure/function like
>> sp_GetApplicationID, which gives me some more information about the
>> connection, like e.g. OS user, client IP address, ...
>
> a mix of:
>
> select user() from system.iota (get the pc name)
> and
> execute procedure sp_mgGetConnectedUsers()
>
> should do it. Unfortunately, if there are several users with the same
> PC name (e.g. via a terminal server), you will get a list with distinct
> user names/OS login names/ts addresses.

user() will give me the ADS user (e.g. ADSSYS), or if "Logins required"
is disabled in the dictionary, it will give me 'Anonymous'. I don't see
a way to get the Windows Domain user, PC name or whatever.

Did I miss something?

--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com


Joachim Duerr (ADS) Posted on 2007-11-07 23:09:53.0Z
From: "Joachim Duerr (ADS)" <jojo.duerr@gmx.de>
Subject: Re: Get OS user name in SQL script based trigger?
Newsgroups: Advantage.Trigger
References: <472c6c52@solutions.advantagedatabase.com> <472ef9f9@solutions.advantagedatabase.com> <47307ac3@solutions.advantagedatabase.com>
Organization: iAnywhere
User-Agent: XanaNews/1.18.1.2
X-Face: ,QMv7[luB)BpWAQ~:"kw6n%0ieY63.:g2K3n~8ky0;||5Xle*Xq+=~<Fy:0CVC2nx@8~vZ
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 83.236.242.42
Message-ID: <473245c1@solutions.advantagedatabase.com>
Date: 7 Nov 2007 16:09:53 -0700
X-Trace: 7 Nov 2007 16:09:53 -0700, 83.236.242.42
Lines: 15
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!83.236.242.42
Xref: solutions.advantagedatabase.com Advantage.Trigger:354
Article PK: 1136415


Thomas Steinmaurer wrote in <47307ac3@solutions.advantagedatabase.com>:

> user() will give me the ADS user (e.g. ADSSYS), or if "Logins
> required" is disabled in the dictionary, it will give me 'Anonymous'.
> I don't see a way to get the Windows Domain user, PC name or whatever.
>
> Did I miss something?

sorry, you're right! my error.

--
Joachim Duerr
System Consultant (Advantage Database Server)
Sybase iAnywhere
advantagesupport[AT]ianywhere.com


Thomas Steinmaurer Posted on 2007-11-09 20:08:54.0Z
Date: Fri, 09 Nov 2007 21:08:54 +0100
From: Thomas Steinmaurer <t.steinmaurer_dontbugmewithspam_@upscene.com>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Get OS user name in SQL script based trigger?
References: <47307ac3@solutions.advantagedatabase.com> <6c56a922347ca8c9eebdac6011f4@devzone.advantagedatabase.com>
In-Reply-To: <6c56a922347ca8c9eebdac6011f4@devzone.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 86.56.229.75
Message-ID: <4734bce2@solutions.advantagedatabase.com>
X-Trace: 9 Nov 2007 13:02:42 -0700, 86.56.229.75
Lines: 16
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!86.56.229.75
Xref: solutions.advantagedatabase.com Advantage.Trigger:355
Article PK: 1136417

Hi Rodd,

thanks for taking the time and sharing your ideas!

I for one would prefer more built-in context variables. Perhaps we will
see some improvements in this area in one of the forthcoming ADS releases.


--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com


Thomas Steinmaurer Posted on 2007-11-10 17:53:21.0Z
Date: Sat, 10 Nov 2007 18:53:21 +0100
From: Thomas Steinmaurer <t.steinmaurer_dontbugmewithspam_@upscene.com>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Get OS user name in SQL script based trigger?
References: <4734bce2@solutions.advantagedatabase.com> <6c56a92234a028c9f13a201b4bd2@devzone.advantagedatabase.com>
In-Reply-To: <6c56a92234a028c9f13a201b4bd2@devzone.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 86.56.229.75
Message-ID: <4735ee9a@solutions.advantagedatabase.com>
X-Trace: 10 Nov 2007 10:47:06 -0700, 86.56.229.75
Lines: 31
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!86.56.229.75
Xref: solutions.advantagedatabase.com Advantage.Trigger:357
Article PK: 1136418

Hi Rodd,

>> thanks for taking the time and sharing your ideas!
>>
>> I for one would prefer more built-in context variables. Perhaps we
>> will see some improvements in this area in one of the forthcoming ADS
>> releases.
>
> Agreed and thank you for the ADS log manager.
> I have evaluated the trial and have put it on my technology buy list. I
> would anticipate an order in the next 12 months or when you have a good
> discount offer. I am not asking for a discount, only stating that there
> are many items on my buy list ahead of ADS log manager and good offers
> can change my priority order.

Even in our opinion that ADS LogManager is already "dead cheap" and pays
off very, very quickly, there might be a special offer from time to
time. If there is one, we let you guys know by posting an announcemnt in
the announcement group on this news server.

Thanks for your interest in our products.


--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com


Howard Weisberg Posted on 2007-11-12 17:42:08.0Z
From: "Howard Weisberg" <weisberg39@yahoo.com>
Newsgroups: Advantage.Trigger
References: <4734bce2@solutions.advantagedatabase.com> <6c56a92234a028c9f13a201b4bd2@devzone.advantagedatabase.com> <4735ee9a@solutions.advantagedatabase.com>
Subject: Re: Get OS user name in SQL script based trigger?
Date: Mon, 12 Nov 2007 09:42:08 -0800
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 64.60.46.158
Message-ID: <47388f38@solutions.advantagedatabase.com>
X-Trace: 12 Nov 2007 10:36:56 -0700, 64.60.46.158
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!64.60.46.158
Xref: solutions.advantagedatabase.com Advantage.Trigger:358
Article PK: 1136421

The normal price is very low compared to Lumigent Log Explorer, a somewhat
comparable product for SQL Server.

A big plus in my opinion would be the ability to log changes not only to ADT
tables, but also to DBF tables. However I believe this would require
Advantage to add a capability that it currently does not have, namely to
link triggers with DBF tables.

"Thomas Steinmaurer" <t.steinmaurer_dontbugmewithspam_@upscene.com> wrote in
message news:4735ee9a@solutions.advantagedatabase.com...
> Hi Rodd,
>
>>> thanks for taking the time and sharing your ideas!
>>>
>>> I for one would prefer more built-in context variables. Perhaps we
>>> will see some improvements in this area in one of the forthcoming ADS
>>> releases.
>>
>> Agreed and thank you for the ADS log manager. I have evaluated the trial
>> and have put it on my technology buy list. I would anticipate an order
>> in the next 12 months or when you have a good discount offer. I am not
>> asking for a discount, only stating that there are many items on my buy
>> list ahead of ADS log manager and good offers can change my priority
>> order.
>
> Even in our opinion that ADS LogManager is already "dead cheap" and pays
> off very, very quickly, there might be a special offer from time to time.
> If there is one, we let you guys know by posting an announcemnt in the
> announcement group on this news server.
>
> Thanks for your interest in our products.
>
>
> --
> Best Regards,
> Thomas Steinmaurer
> LogManager Series - Logging/Auditing Suites supporting
> InterBase, Firebird, Advantage Database, MS SQL Server and
> NexusDB V2
> Upscene Productions
> http://www.upscene.com


Thomas Steinmaurer Posted on 2007-11-12 19:58:49.0Z
Date: Mon, 12 Nov 2007 20:58:49 +0100
From: Thomas Steinmaurer <t.steinmaurer_dontbugmewithspam_@upscene.com>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Get OS user name in SQL script based trigger?
References: <4734bce2@solutions.advantagedatabase.com> <6c56a92234a028c9f13a201b4bd2@devzone.advantagedatabase.com> <4735ee9a@solutions.advantagedatabase.com> <47388f38@solutions.advantagedatabase.com>
In-Reply-To: <47388f38@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 86.56.229.75
Message-ID: <4738aefa@solutions.advantagedatabase.com>
X-Trace: 12 Nov 2007 12:52:26 -0700, 86.56.229.75
Lines: 20
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!86.56.229.75
Xref: solutions.advantagedatabase.com Advantage.Trigger:359
Article PK: 1136419


> The normal price is very low compared to Lumigent Log Explorer, a somewhat
> comparable product for SQL Server.
>
> A big plus in my opinion would be the ability to log changes not only to ADT
> tables, but also to DBF tables. However I believe this would require
> Advantage to add a capability that it currently does not have, namely to
> link triggers with DBF tables.

Triggers can be used with DBF tables, if the DBF tables are bound to a
data dictionary.


--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com


Howard Weisberg Posted on 2007-11-19 20:12:03.0Z
From: "Howard Weisberg" <weisberg39@yahoo.com>
Newsgroups: Advantage.Trigger
References: <4734bce2@solutions.advantagedatabase.com> <6c56a92234a028c9f13a201b4bd2@devzone.advantagedatabase.com> <4735ee9a@solutions.advantagedatabase.com> <47388f38@solutions.advantagedatabase.com> <4738aefa@solutions.advantagedatabase.com>
Subject: Re: Get OS user name in SQL script based trigger?
Date: Mon, 19 Nov 2007 12:12:03 -0800
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 64.60.46.158
Message-ID: <4741ecd7@solutions.advantagedatabase.com>
X-Trace: 19 Nov 2007 13:06:47 -0700, 64.60.46.158
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!64.60.46.158
Xref: solutions.advantagedatabase.com Advantage.Trigger:360
Article PK: 1136420

Just to be clear --

Suppose we have DBF tables that are modified by two applications. One
application accesses the tables via ADS, connecting to them as free tables.
The second application also accesses them via ADS, but connects to them as
bound tables via a data dictionary connection. Will Log Manager log changes
made by both applications or only the second?

"Thomas Steinmaurer" <t.steinmaurer_dontbugmewithspam_@upscene.com> wrote in
message news:4738aefa@solutions.advantagedatabase.com...
>> The normal price is very low compared to Lumigent Log Explorer, a
>> somewhat comparable product for SQL Server.
>>
>> A big plus in my opinion would be the ability to log changes not only to
>> ADT tables, but also to DBF tables. However I believe this would require
>> Advantage to add a capability that it currently does not have, namely to
>> link triggers with DBF tables.
>
> Triggers can be used with DBF tables, if the DBF tables are bound to a
> data dictionary.
>
>
> --
> Best Regards,
> Thomas Steinmaurer
> LogManager Series - Logging/Auditing Suites supporting
> InterBase, Firebird, Advantage Database, MS SQL Server and
> NexusDB V2
> Upscene Productions
> http://www.upscene.com


Thomas Steinmaurer Posted on 2007-11-22 10:00:58.0Z
Date: Thu, 22 Nov 2007 11:00:58 +0100
From: Thomas Steinmaurer <t.steinmaurer_dontbugmewithspam@upscene.com>
User-Agent: Thunderbird 1.5.0.13 (Windows/20070809)
MIME-Version: 1.0
Newsgroups: Advantage.Trigger
Subject: Re: Get OS user name in SQL script based trigger?
References: <4734bce2@solutions.advantagedatabase.com> <6c56a92234a028c9f13a201b4bd2@devzone.advantagedatabase.com> <4735ee9a@solutions.advantagedatabase.com> <47388f38@solutions.advantagedatabase.com> <4738aefa@solutions.advantagedatabase.com> <4741ecd7@solutions.advantagedatabase.com>
In-Reply-To: <4741ecd7@solutions.advantagedatabase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 193.186.164.88
Message-ID: <474551c0@solutions.advantagedatabase.com>
X-Trace: 22 Nov 2007 02:54:08 -0700, 193.186.164.88
Lines: 20
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!193.186.164.88
Xref: solutions.advantagedatabase.com Advantage.Trigger:361
Article PK: 1136423


> Just to be clear --
>
> Suppose we have DBF tables that are modified by two applications. One
> application accesses the tables via ADS, connecting to them as free tables.
> The second application also accesses them via ADS, but connects to them as
> bound tables via a data dictionary connection. Will Log Manager log changes
> made by both applications or only the second?

From my understanding, only the second, because triggers are a feature
of a data dictionary connection.


--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com