You can use the Portatibility Connection for this:
Doctrine\DBAL\Portability\Connection:
$connection = DriverManager::getConnection(array('wrapperClass' =>
'Doctrine\DBAL\Portability\Connection', 'portability' =>
\octrine\DBAL\Portability\Connection::PORTABILITY_ALL));
On Wed, Dec 17, 2014 at 10:51 PM, Pablo <[email protected]> wrote:
>
> Staff are implementing the framework doctrine in our application, with the
> intention that it becomes multi-bank.
>
> We started the project with mysql and now to test, try to run with
> postgress and oracle.
>
> What did apparently happens is when postgress brings the data bank, it
> converts the column names to minuscule, as the oracle is on the contrary,
> takes the column names to uppercase.
>
> This brings me a big problem as I recover the data bank accessing the
> spine position each fetch.
>
> Ex (got the internet just for clarity):
>
> <?php
> $connection = $this->getDatabaseConnection();
>
> $sql = "SELECT Nome
> FROM pessoa
> WHERE id = :id
> AND ativo = '1'
> ";
>
> $stmt = $connection->prepare($sql);
> $stmt->bindValue("id", $id);
> $stmt->execute();
> $resultado = $stmt->fetchAll();?>
>
>
> When Postgress use the $result array is:
>
> Array(
> [0] => Array
> (
> [nome] => pablo
> ))
>
>
> When using the Oracle $result array is:
>
> Array(
> [0] => Array
> (
> [NOME] => pablo
> ))
>
>
> When I use the MySQL $result array is:
>
> Array(
> [0] => Array
> (
> [Nome] => pablo
> ))
>
>
> So in my application there was something like:
>
> echo $ result ['name'];
>
> This works only for MySQL as the key to postgress is lowercase and
> uppercase is oracle.
>
> I have not found an elegant way to solve this problem.
>
> --
> You received this message because you are subscribed to the Google Groups
> "doctrine-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/doctrine-user.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.