469,903 Members | 1,598 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

how to get client workstation name

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
3 3445
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
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

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.

Similar topics

4 posts views Thread by Matt Frame | last post: by
1 post views Thread by Carl Jones via .NET 247 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.