PEAR Packages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPEAR Packages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old October 30th, 2007, 02:44 PM
golgot59 golgot59 is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 4 golgot59 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 5 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old October 30th, 2007, 05:09 PM
wiesemann wiesemann is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 174 wiesemann User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 7 m 34 sec
Reputation Power: 3
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?

Reply With Quote
  #3  
Old October 31st, 2007, 03:12 AM
golgot59 golgot59 is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 4 golgot59 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 5 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old October 31st, 2007, 05:58 AM
golgot59 golgot59 is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 4 golgot59 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 5 sec
Reputation Power: 0
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 !

Reply With Quote
  #5  
Old October 31st, 2007, 08:02 AM
wiesemann wiesemann is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 174 wiesemann User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 7 m 34 sec
Reputation Power: 3
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.)

Reply With Quote
  #6  
Old October 31st, 2007, 12:30 PM
golgot59 golgot59 is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 4 golgot59 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 5 sec
Reputation Power: 0
Quote:
Originally Posted by wiesemann
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.)


Yes I know I'd always have to make my changes each time I update OCI PEAR Package...

thx.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPEAR Packages > MDB2 / OCI8 and "is null" in a query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek