Re: [PHP-DB] Cross DB application

2002-04-15 Thread Manuel Lemos

Hello,

Andrew Hill wrote:
> 
> ARcadius,
> 
> You may use an abstraction library such as PEARDB or ADODB, or
> simply the unified ODBC functions.

Andrew, you always suggest ODBC as a good solution for portable database
application development, but AFAIK it is not a good solution at all
because for crucial things you still have to resort to database specific
code to handle database differences.

I already asked you this before but I don't recall ever getting a
satisfactory answer. I don't know if the problem is in PHP ODBC API or
is really an ODBC limitation, but for instance, when you want to
implement auto-incremented sequences of integer values that are
fundamental for database aplications to use in primary key fields, with
ODBC you there seems to be no database independent way to create and
retrieve the next sequence value.

The other important issue, especially for Web development, is query
results paging. In most current databases there some clause like for
instance MySQL LIMIT. Others use different syntaxes or clause for
restricting the range of rows that are returned by the server to the
client. This is importa, especially when you want to show a small number
of rows of a very large result set.

Once you suggested to use ODBC cursors, but that is not the same as
limiting the result rows in the actual queries. For instance, if you
need to get the first from row 10 to 19 of a result set of 1.000.000
rows, using the LIMIT clause will make the server stop the query after
20 rows. Using cursors, AFAIK will not stop the query making the
database server hog the machine needlessly to traverse 1.000.000 rows of
data that an application is not interested in.

I don't know if there are better and portable solutions using PHP ODBC
API functions, but with your ODBC knowledge is there a way to solve
these issues with a complete ODBC API (besides what PHP ODBC API can
offer)?

I would like to make a better ODBC driver class for Metabase so users
can develop portable database applications using Metabase via ODBC, but
it seems that I will have to develop subclasses for each type of ODBC
data source (MS Access, IBM DB2, SAP-DB, etc...) to handle database
specific issues that the ODBC API does not handle by itself.

Regards,
Manuel Lemos

Regards,
Manuel Lemos

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Cross DB application

2002-04-15 Thread Gurhan Ozen

Hi Arcadius,
If you know Object-oriented programming , you can write a class that
includes both MySQL and PostGreSQL functions and you can inherit from that
class.
Or, you can just stick all mysql, postgresql functions in a functions.php
file and include that file to be able to use the functions. I guess it would
work best if you have a configuration file where the user chooses either DB
and your code uses the corresponding function for that database.
I am sure there are database wrapper classes for php to address your issue
somewhere on the net , I just don't know where, since i have never searched
for it. I will personally email you if i come across any ...

Gurhan


-Original Message-
From: Arcadius A. [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 15, 2002 7:56 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Cross DB application



Hello !
I'm planning to write a database application for  MySQL, and then port it to
PostrgeSQL.
Is there any library or class that could help me to write/maintain just one
source code for both MySQL and PostgreSQL ?

Thanks.

ARcadius



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Cross DB application

2002-04-15 Thread Andrew Hill

ARcadius,

You may use an abstraction library such as PEARDB or ADODB, or
simply the unified ODBC functions.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software

>
> Hello !
> I'm planning to write a database application for  MySQL, and then
port
> it to PostrgeSQL.
> Is there any library or class that could help me to write/maintain just
> one source code for both MySQL and PostgreSQL ?
>
> Thanks.
>
> ARcadius
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php