iamari
asked on
how do i get the hostname in sql?
i've created a view on a db2 v9.1 on AIX
i need to extract the hostname in a variable, and use that variable in a query instead of hardcoding the hostname
how do i get the hostname (actual machine name) in sql?
i need to extract the hostname in a variable, and use that variable in a query instead of hardcoding the hostname
how do i get the hostname (actual machine name) in sql?
select col1, 'MY_HARDCODED_HOST_NAME' as hostName, col2, etc
The netnerds article is perhaps only partially correct. Apparently, what it's a solution for is the 'database name' rather than the hostname. Although those names are often the same, they're also often different. (The SQL0114 at the end of the article seems to reach the goal.)
So, please clarify _exactly_ what name is being sought.
A hostname would be useful for DNS resolution to an IP address. A database name would be useful for remote SQL requests.
Tom
So, please clarify _exactly_ what name is being sought.
A hostname would be useful for DNS resolution to an IP address. A database name would be useful for remote SQL requests.
Tom
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks a lot, momi!
I hope this helps.