zend+pdo+db2

This is a discussion on zend+pdo+db2 within the PHP Language forums, part of the PHP Programming Forums category; Hi there, i'm not sure, if it is a php or a database problem, but i would consider it ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-27-2008
Christian Welzel
 
Posts: n/a
Default zend+pdo+db2

Hi there,

i'm not sure, if it is a php or a database problem, but i would
consider it the first.
i'm programming some code with zend_db and pdo to access a db2
database. additionally a want to be able to replace the db2 on the
localhost with mysql (easier to maintain for a developer). This should
be no problem, as long as i stick to ansi-sql...
But now my problem arises:
I initialize my table-classes in zend like this:

class Core_Db_Table_Actions extends Zend_Db_Table_Abstract
{
protected $_name = 'actions';
}

this works fine on mysql but db2 is compaining about the not
defined table "actions". If i write it all uppercase (ACTIONS)
db2 is happy...
So i wonder if it shouldn't be the task of zend/pdo to hide those
differences from the programmer? Or have i overseen or misunderstood
something?

--
MfG, Christian Welzel aka Gawain@Regenbogen

GPG-Key: http://www.camlann.de/key.asc
Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15
Reply With Quote
  #2 (permalink)  
Old 04-27-2008
Jerry Stuckle
 
Posts: n/a
Default Re: zend+pdo+db2

Christian Welzel wrote:
> Hi there,
>
> i'm not sure, if it is a php or a database problem, but i would
> consider it the first.
> i'm programming some code with zend_db and pdo to access a db2
> database. additionally a want to be able to replace the db2 on the
> localhost with mysql (easier to maintain for a developer). This should
> be no problem, as long as i stick to ansi-sql...
> But now my problem arises:
> I initialize my table-classes in zend like this:
>
> class Core_Db_Table_Actions extends Zend_Db_Table_Abstract
> {
> protected $_name = 'actions';
> }
>
> this works fine on mysql but db2 is compaining about the not
> defined table "actions". If i write it all uppercase (ACTIONS)
> db2 is happy...
> So i wonder if it shouldn't be the task of zend/pdo to hide those
> differences from the programmer? Or have i overseen or misunderstood
> something?
>



Nope. Identifiers in SQL are case sensitive. And if you're running
MySQL on Linux instead of Windows, you'll find the table names are case
sensitive there, also (if you take the defaults).

The non-standard operation here is MySQL not having case sensitive table
names on Windows.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Reply With Quote
  #3 (permalink)  
Old 04-28-2008
Christian Welzel
 
Posts: n/a
Default Re: zend+pdo+db2

Jerry Stuckle schrieb:

> Nope. Identifiers in SQL are case sensitive. And if you're running
> MySQL on Linux instead of Windows, you'll find the table names are case
> sensitive there, also (if you take the defaults).


Thanks for your advise. I never hit this problem before, because i always
create tables lowercase. But now the mtk from ibm created them in uppercase...
So this confused me a bit.

--
MfG, Christian Welzel aka Gawain@Regenbogen

GPG-Key: http://www.camlann.de/key.asc
Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15
Reply With Quote
  #4 (permalink)  
Old 04-28-2008
Jerry Stuckle
 
Posts: n/a
Default Re: zend+pdo+db2

Christian Welzel wrote:
> Jerry Stuckle schrieb:
>
>> Nope. Identifiers in SQL are case sensitive. And if you're running
>> MySQL on Linux instead of Windows, you'll find the table names are
>> case sensitive there, also (if you take the defaults).

>
> Thanks for your advise. I never hit this problem before, because i always
> create tables lowercase. But now the mtk from ibm created them in
> uppercase...
> So this confused me a bit.
>


Yep, it's all a matter of style, just like variable names in PHP. But,
like variable names, case is important.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:06 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0