Re: get database name
Posted in 1998
Gabor Heppes — — source: Informix-list mailing list archive (1991-1998)
Mauro,
I'm not sure when dbinfo() came in, I'm on 7.23 ...
Try
select sqs_dbname
from sysmaster:syssqlstat
where sqs_sessionid+0 = dbinfo('sessionid');
For some strange reason (on my system at least) it doesn't work without
the "+0".
Gabor
Mauro Stevanin wrote:
>
> Hello,
>
> Does anybody know how can I get the name of the database I'm connected
> in ?
> The goal is to put the database name into a variable in a spl procedure.
>
> I suppose there is some sql query to obtain the database name, but I
> didn't find anything in the documentation.
>
> Any input welcome.
>
> Mauro Stevanin
> University of Lausanne - Switzerland
> mauro.stevanin@ci.unil.ch