|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
MDB2 / OCI8 and "is null" in a query
Hello,
Is someone can help me ? I have to make queries like: &db->query(select name from people where name.name='' ) to be compatible on an ORACLE database. It works with mysql. Is there a way with mdb2/oci8 to automaticaly convert the query? ie: the " ='' " become " is null " ? thx a lot. |
|
#2
|
|||
|
|||
|
No, MDB2 doesn't abstract such semantical issues, it just abstracts the functions that PHP (like ...connect()) or the DBMS (like SUBSTR()) offers.
Can't you make your table schemes compatible in both DBMS, so that you can use "IS NULL" with both MySQL and Oracle? |
|
#3
|
|||
|
|||
|
thx for your answer !
I 'm not allowed to create databases, so i think i'd have to modify the MDB2_OCI8 driver (if possible). In fact i've to work with (oracle and mysql and sqlserver), so could you explain how could I modify the "table scheme" to be compatible with all theses databases? ie: how to say mysql to understand the "is null" ? thx. |
|
#4
|
|||
|
|||
|
I found a barbarian way to make it work !!
in the oci8.php : in the modifyquery function: $query=preg_replace('`= *\'\'`',' is null ', $query); it seems to work ! |
|
#5
|
|||
|
|||
|
Modifying the OCI8 driver from MDB2 might work, but you will lose your changes if you update MDB2 (or the driver).
MySQL knows "IS NULL" for comparisions, but IIRC there are some differences between MySQL and Oracle in regard of NULL values. (Sorry, I can't tell you more details about it, maybe Google or another forum member can help you.) |
|
#6
|
|||
|
|||
|
Quote:
Yes I know I'd always have to make my changes each time I update OCI PEAR Package... thx. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > MDB2 / OCI8 and "is null" in a query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|