Hi

I use Oracle as external database for obtain some data. At some SQL (oracle functions or precedures), execution with PDO fails and I need to use OCI. At this situation, I do:

$conn = oci_connect($login,$password, $url); 
if ($conn)
{

 $cursor = OCIParse($conn, $sql);
 OCIExecute($cursor);
 $result=array(); 
 $numrows = oci_fetch_all($cursor, $result, null, null, OCI_FETCHSTATEMENT_BY_ROW);
 //CODE
}
 oci_close($conn);

It's possible to obtain connection and avoid establish and close this connection?

I try to use $conn= Database::getConnection('oracle'); where 'oracle' it's the connection to my external database, but if ($conn) returns false.
When I use pdo I use db_set_active('oracle') and it's works ok....

Thanks!

Comments

aaaristo’s picture

Status: Active » Closed (won't fix)

Database::getConnection('oracle') returns a PDO connection... that is not usable by the oci module because of different underlying implementations.... so no you cant.

Anonymous’s picture

Ok, thanks!

Anonymous’s picture

Issue summary: View changes

add more information