There's a PDO adapter in Zend_Db, so I figured it would use PDO and not
ext/oci. There's also an adapter just called Oracle; maybe that uses
ext/oci.

I'm finding different info depending on where I look in the
documentation at php.net. I'll give the ORACLE_HOME/network/admin a try
though and see if that gives better results.

Thanks for clarifying the table question I had; that was exactly the
problem.

-Tim

till wrote:
> On Wed, Jun 10, 2009 at 4:29 PM, Tim Rupp<caphrim...@gmail.com> wrote:
>> Hi list,
>>
>> I'm using the Zend_Db classes to connect to an Oracle server and had a
>> couple questions.
>>
>> First, I have a tnsnames.ora file, which I put in /etc, but I can't get
>> ZF to make use of it. I'd like to skip specifying the hostname of the
>> server and just using the SID. Can this be done? I've gone so far as to
>> also do a
>>
>>        putenv(sprintf('TNS_ADMIN=%s', '/etc/tnsnames.ora'));
> 
> Hmm, I had to double-check this since straight PDO uses an environment
> variable called ORACLE_HOME. And then it checks for
> ORACLE_HOME/network/admin. Zend_Db seems to use ext/oci and not PDO
> (?) so you best double-check that a straight test works with your
> TNS_ADMIN enviroment variable.
> 
> Here's the standard PHP documentation:
> http://docs.php.net/manual/en/ref.oci8.php
> 
> If you catch a bug here, maybe you can file an issue.
> 
>> (...)
>> Next, I'm using quoteIdentifier in some of my code and when I do, the
>> SQL that is created is not working. In particular, something like
>>
>>        select * from "nodes"
>>
>> is created when I use $db->quoteIdentifier('nodes').
> 
>>From what I know the standard behavior is that oracle will "UPPER" all
> table and fieldnames unless you use quotes. Then it'll match the exact
> name provided in quotes. Can you double-check the table name here --
> e.g. NODES vs. nodes vs. Nodes, etc..?
> 
> In case quoteIdentifiers() is run automatically and adds the quotes
> regardless, you can disable it:
> 
> $options = array(Zend_Db::AUTO_QUOTE_IDENTIFIERS => false);
> $params = array(
> ...
> 'options' => $options,
> );
> 
> Zend_Db::factory('driver', $params);
> 
> Hope that helps,
> Till
> 

Reply via email to