Re: [cx-oracle-users] makedsn SID vs SERVICE_NAME
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2011-12-16 17:39:42
|
Yes, the latest version adds service_name as an optional parameter. makedsn('myhost', '1521', service_name = 'mydb') or if you prefer to use all keywords makedsn(host = 'myhost', port = 1521, service_name = 'mydb') Hope that helps! Anthony On Fri, Dec 16, 2011 at 9:24 AM, jo <jos...@sf...> wrote: > > 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 > > > > ------------------------------------------------------------------------------ > Learn Windows Azure Live! Tuesday, Dec 13, 2011 > Microsoft is holding a special Learn Windows Azure training event for > developers. It will provide a great way to learn Windows Azure and what it > provides. You can attend the event by watching it streamed LIVE online. > Learn more at http://p.sf.net/sfu/ms-windowsazure > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |