How to store Hostaddress in Team Developer

Discussion forum about all things SqlBase or SqlTalk
ankish4u

How to store Hostaddress in Team Developer

Post by ankish4u » 19 Jan 2012, 11:33

Hi

I am trying to use the below query to store Hostaddress to a variable.But the variable is always been NULL.

strSql ='SELECT SYS.UTL_INADDR.GET_HOST_ADDRESS INTO :DateBaseIpAddress FROM dual '

SYS.UTL_INADDR.GET_HOST_ADDRESS is a package provided from Oracle.

Could some one in the forum help on this.

Jeff Luther

Re: How to store Hostaddress in Team Developer

Post by Jeff Luther » 19 Jan 2012, 16:34

Your INTO var. does not show the var's data type. It needs to be a string.

I just ran the query from TD's SQLTalk:
SELECT SYS.UTL_INADDR.GET_HOST_ADDRESS FROM dual;

and got back a valid IP address, so I am not sure why you get 0. THOUGH... saying 0 (zero) tells me your var. might be a number. Note that '123.456.789.012' is not a number so the var. must be a string. If your SQL did not fetch anything, then the (string) var would be '', empty. It will not be a zero; that would be the return for a number var.

If you cannot get this to work, zip/rar and attach a simple TD test case that shows what you are coding.

Return to “SqlBase General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests