Re: PEAR DB Oracle woes
| From: | Justin Patrin | Date: | Sat, 31 Jul 2004 19:18:07 +0000 |
| Subject: | Re: PEAR DB Oracle woes | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-13926@lists.php.net to get a copy of this message | ||
On Thu, 29 Jul 2004 13:38:31 -0700, Moffet, Scott <smoffet@linkpoint.com> wrote:
> Linux RH 9.0
> PEAR 1.3.2
> DB 1.6.5
> PHP 4.3.8 (compiled with both 'with-Oracle' and 'with-Oci8')
> Oracle 8i
>
> In connecting to a networked Oracle 8i database, PHP's method 'ocilogon' seems
> to work just fine.
>
> I'm trying to move app over to use PEAR::DB, but I'm having trouble connecting.
> (I've googled on this problem all day before I come to this list)
>
> This works in PHP (without PEAR) just fine:
> _______________________________
>
> $db = "(DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS = (PROTOCOL = TCP)(HOST = 123.456.78.90)(PORT = 1521))
> )
> (CONNECT_DATA =
> (SERVICE_NAME = CLEAR)
> )
> )";
>
> $con = ocilogon("login", "password",$db);
>
> #success....
> _______________________________
>
> but I can't get the correct connect string using PEAR
> I'm trying something about like this:
>
> require_once 'DB.php';
> ;
> ;
> $db = "(DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS = (PROTOCOL = TCP)(HOST = 123.456.78.90)(PORT = 1521))
> )
> (CONNECT_DATA =
> (SERVICE_NAME = CLEAR)
> )
> )";
>
> $user = 'abc';
> $pass = 'xyz';
> $host = '192.168.40.33:1521';
>
> $dsn = "oci8://$user:$pass@$host/$db";
>
> $db = DB::connect($dsn);
> _______________________________
>
> I've tried many many variations on all the above values.
>
> but this error always comes back:
>
> [nativecode=ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect
> descriptor] ** oci8://....
>
> So what am I doing wrong in my connection???
> HELP
>
I thought I helped you with this the other day....put what you have in
$db on $host instead.
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--