[cx-oracle-users] makedsn SID vs SERVICE_NAME
Brought to you by:
atuining
From: jo <jos...@sf...> - 2011-12-16 16:24:44
|
Hi all, I'm trying to access to an oracle service name but makedsn compile the dsn string with a SID, like this: dsn = cx_Oracle.makedsn('myhost',1521,'mydb') print dsn (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521)))(CONNECT_DATA=(SID=mydb))) I'm using this ugly workaround by replacing 'SID' with 'SERVICE_NAME': dsn = cx.makedsn('myhost',1521,'mydb').replace('SID','SERVICE_NAME') print dsn (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=mydb))) It works but I don't like it. Is there another way to do that? Thanks for any help. j |