Page 1 of 1

TNSNames.ora alias extraction problem GetOraServerList

Posted: Thu 07 Jul 2005 08:00
by MITSA
Hello
With ODAC 5.10.2.8, Delphi 7, Oracle 10g there is a small problem when ODAC extracts the alias names from the TNSNames.ora file va the GetOraServerList procedure.

An alias such as :

xxx-aaa-10g.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = sss-bbb-ccc)(PORT = 0000))
)
(CONNECT_DATA =
(SERVICE_NAME = xxx)
)
)

becomes xxx-aaa-g.world. If we remove the - before the 10g ie: xxx-aaa10g.world or use xxx-aaa_10g.world then the returned value is correct.

In ODacGui.inc GetOraServerList there is a test on the '-' ,

if (Bracket = 0) and ((Code = lcIdent) or (St = '-')) then

but I'm not sure what the significance is, nor what is going on...

Is there a way to fix this my modifiying the source code ?

Best Regards

Paul

Found the problem and a possible solution

Posted: Fri 08 Jul 2005 07:27
by MITSA
Whats hapening is with xxx-aaa-10g.world the parser returns 'xxx' followed by '-' then 'aaa' then '-' then '10' and then 'g' - all parts of the alias are correctly returned by the parser.

When the parser retuns 10 the code is set to lcNumber. The test

if (Bracket = 0) and ((Code = lcIdent) or (St = '-')) then

is not "true" and the parser continues to the g
This gives the result of xxx-aaa-g.world

If I change the test above to :
(Bracket = 0) and ((Code = lcIdent) or (Code = lcNumber) or (St = '-'))
then it evaluates to "true" and the result is correct ie. xxx-aaa-10g.world

Could you please inform as to whether or not the modification I propose will break anything else.

Regards

Paul

Posted: Fri 08 Jul 2005 10:51
by Alex
You are quite right with this issue in ODAC TnsNames alias parsing. As to your fix - I couldn't discover any troubles with it, so you can use it freely. We will fix this issue in the next ODAC build.