Server name in Connection()

Not sure if its because its Friday but I can;t seem to be able to crack this…

I’m trying to locate the server name in the connection string so that I can display only that information.

Eg. In our environment all the connections start INFBO so I’d like to be able to locate that in the string and then find the next 5 characters which tells me what server I’m on…

I was expecting to be able to use LOCATE or LOC and then work it out from there but there not available as options.

Any ideas greatly appreciated

DB2 v9 with Webi XIr2 sp2

cheers


malc001 :new_zealand: (BOB member since 2005-09-26)

=Substr(Connection([Query]);n;n)

you’ll need to put the appropriate figures for the n’s.


dessa :madagascar: (BOB member since 2004-01-29)

Thanks for that - a definite Friday moment!

Final Syntax incase anyone needs it later (although its very simple)

=Substr(Connection([Query Name]);(Pos(Connection([Query Name]);"DATABASE="))+10;6)

Our Database’s have a 6 character name so change as required

thanks again!


malc001 :new_zealand: (BOB member since 2005-09-26)