[nycphp-talk] PHP, ODBC, ORACLE
Tim Gales
tgales at tgaconnect.com
Sat Jun 19 20:19:54 EDT 2004
Hans Zaunere writes:
(in response to)
> >
> > 1. Can ODBC_CONNECT be used to go against an oracle database? If
> > yes, what would be the essential pieces?
>
> I don't believe so. From:
>
> http://us2.php.net/manual/en/ref.uodbc.php
>
> "The following databases are supported by the Unified ODBC
> functions: Adabas D, IBM DB2, iODBC, Solid, and Sybase SQL Anywhere."
>
> > 2. What would be the syntax for oracle connect statements (plz point
> > me to a ref)-from connect to select?
>
> Not 100% here either. But why not use OCI8 and connect to
> Oracle directly?
>
Yes, unless you really have some very compelling reason, you
should try and connect to Oracle in its 'native tongue'.
The 'unified ODBC' functions are something different than
ODBC.
In the manual it says: "several databases that have borrowed the
semantics of the ODBC API to implement their own API."
And it goes on the name the databases (see above))
Then is says:
"Note: There is no ODBC involved when connecting to the above databases."
Around 1992 there was a group called the SQL Access Group.
They put out something called the SQL Access Group Call
Level Interface.
It was an interoperability initiative. The basic idea
was to have an intersection of the most popular SQL
dialects of the day. That way you could have the same
code (sort of like embedded universal sql) which would
work in the same way but against different databases.
The concept included common error codes, common data
types, and a common means of getting a connection to
the different databases.
Sounds a lot like ODBC right? That's because Microsoft
took the SAG CLI concept and extended it -- and that's
what became ODBC.
Microsoft's ODBC Manager hooks up the ODBC version
('ODBC extended') SAG CLI sql to one or more dynamically loaded
libraries (dll's or so's depending on the operating system),
which are known in ODBC parlance as ODBC drivers.
The 'unified odbc' functions are probably (but here I am guessing)
a separate implementation of the old SAG CLI specification --
with the same names as the ODBC functions.
Anyway, there definitely exist ODBC managers for most
of the unix-style operating systems (as well as other
more esoteric os's).
And yes, there exist ODBC drivers for Oracle --
and from more than one source.
But ODBC drivers come in many flavors.
There are single tier drivers and multiple tier
drivers. Some drivers only support the ODBC core
api. Some drivers support the level 1 api -- some
say they are conformant with level 2 of the ODBC
api.
And just when you think you have all the functionality
mapped out, you can get hit with performance problems.
So if you (still) are seriously considering ODBC, I
would advice you to make a prototype (to make
sure you have the functionality you want) and
hit it with some pretty good volume tests.
T. Gales & Associates
'Helping People Connect with Technology'
http://www.tgaconnect.com
More information about the talk
mailing list