By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,844 Members | 836 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,844 IT Pros & Developers. It's quick & easy.

how to get client workstation name

P: n/a
Hello,

i have a problem determining the workstation name of the client user.
i try to do a

SELECT CURRENT CLIENT_WRKSTNNAME .....

but i get an empty string.

I read the manual (SQL Reference 1)...and it says that i must use the
API sqleseti to
set the CLIENT_WRKSTNNAME variable...

But...how can i do that from SQL ?
It's possible to call sqleseti from command line?
or i must write a C function?

Dec 6 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
alessandro menchini wrote:
Hello,

i have a problem determining the workstation name of the client user.
i try to do a

SELECT CURRENT CLIENT_WRKSTNNAME .....

but i get an empty string.

I read the manual (SQL Reference 1)...and it says that i must use the
API sqleseti to
set the CLIENT_WRKSTNNAME variable...

But...how can i do that from SQL ?
It's possible to call sqleseti from command line?
or i must write a C function?
Use VALUES like this: VALUES CLIENT WRKSTNNAME

By default it is blank. It must be set by that API call.

B.

Dec 6 '06 #2

P: n/a
Brian Tkatch wrote:
alessandro menchini wrote:
>Hello,

i have a problem determining the workstation name of the client user.
i try to do a

SELECT CURRENT CLIENT_WRKSTNNAME .....

but i get an empty string.

I read the manual (SQL Reference 1)...and it says that i must use the
API sqleseti to
set the CLIENT_WRKSTNNAME variable...

But...how can i do that from SQL ?
It's possible to call sqleseti from command line?
or i must write a C function?

Use VALUES like this: VALUES CLIENT WRKSTNNAME

By default it is blank. It must be set by that API call.
I believe that's sqleseti()

Alternatively, you could use the application id (from function
APPLICATION_ID()), parse the IP address encoded therein and then do an
nslookup (C function gethostbyname()). This is also described here:
http://tinyurl.com/9sjqh

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Dec 6 '06 #3

P: n/a

I have found (searching this newsgroup) a solution using
APPLICATION_ID()...

The sql query is...

SELECT * FROM TABLE(SNAPSHOT_APPL_INFO('DBNAME',-1))
AS SNAPSHOT_APPL_INFO
WHERE APPL_ID = application_id();

Thank you to all
A.M.

Dec 6 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.