Re: [PHP] Database Preference? -- Manuel, Michael, Miles

2001-08-30 Thread James Potts

Manuel,

Thanx again for your help.  I will check it out this evening.  Sounds like
you're a busy man. ;-)  Keep up the good work.

James Potts


"Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> James Potts wrote:
> >
> > Manuel,
> >
> > Thanx for the excellent overview of metabase.  I will give it a test
drive.
> > A couple further questions, if you have time:
> >
> > Do you execute meta commands like you do with the other db interface
> > functions, e.g., odbc_connect(), odbc_select(), etc., or are you able to
> > encapsulate  SQL between tags, e.g.
> >
> > 
> > SELECT bar FROM foo WHERE barname = "chocolate";
> > 
> >
> > Using a function set can be cumbersome, compared to embedded language
> > interfaces where you just put SQL between tags, just like PHP is handled
> > between the  tags.
>
> That is the subject of some other project that I have which is an actual
> meta-language defined in XML. You write what you want to do with XML
> tags, and  there is a compiler that translates that in to code of a
> target language, like PHP. This is not yet a released project although I
> have given a talk on this in San Diego O'Reilly Open Source conference
> in July, and if all goes well I will give another talk in November in
> PHP conference in Frankfurt. More information on that is available here:
>
> http://www.meta-language.net/
>
>
> > Also, can you PREPARE, DECLARE, and OPEN cursors like, say, in Informix,
so
> > you can use variable SELECT parameters?  For example, using Informix
ESQL/C
> > you can PREPARE a statement, use it to DECLARE a CURSOR, and the OPEN
the
> > CURSOR USING multiple values, as in:
> >
> > sprintf( query, "%s %s %s %s %s %s %s %s %s",
> > "begin work;",
> > "update account set balance = balance + ?,"
> > "where acct_number = ?;",
> > "update teller set balance = balance + ?",
> > "where teller_number = ?;",
> > "update brance set balance = balance + ?",
> > "where branch_number = ?;"
> > "insert into history values (?, ?);",
> > "commit work;" );
> > $prepare qid from $query;
> > $execute qid using $delta, $acct_number, $delta, $teller_number,
> > $delta, $branch_number, $timestamp, $values;
>
> Metabase supports prepared queries which you can execute as many times
> as you want with different values, if it is that what you are asking.
>
>
>
> > I should be able to check metabase out later this evening.  If it can
handle
> > the above native database language, I think it will be an asset,
especially
> > for some of our older applications.
>
> I am not sure if it is exactly what you are asking. In any case there is
> an extensive manual and a tutorial that details all it can do.
>
> Regards,
> Manuel Lemos



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Database Preference? -- Manuel, Michael, Miles

2001-08-30 Thread Manuel Lemos

James Potts wrote:
> 
> Manuel,
> 
> Thanx for the excellent overview of metabase.  I will give it a test drive.
> A couple further questions, if you have time:
> 
> Do you execute meta commands like you do with the other db interface
> functions, e.g., odbc_connect(), odbc_select(), etc., or are you able to
> encapsulate  SQL between tags, e.g.
> 
> 
> SELECT bar FROM foo WHERE barname = "chocolate";
> 
> 
> Using a function set can be cumbersome, compared to embedded language
> interfaces where you just put SQL between tags, just like PHP is handled
> between the  tags.

That is the subject of some other project that I have which is an actual
meta-language defined in XML. You write what you want to do with XML
tags, and  there is a compiler that translates that in to code of a
target language, like PHP. This is not yet a released project although I
have given a talk on this in San Diego O'Reilly Open Source conference
in July, and if all goes well I will give another talk in November in
PHP conference in Frankfurt. More information on that is available here:

http://www.meta-language.net/

 
> Also, can you PREPARE, DECLARE, and OPEN cursors like, say, in Informix, so
> you can use variable SELECT parameters?  For example, using Informix ESQL/C
> you can PREPARE a statement, use it to DECLARE a CURSOR, and the OPEN the
> CURSOR USING multiple values, as in:
> 
> sprintf( query, "%s %s %s %s %s %s %s %s %s",
> "begin work;",
> "update account set balance = balance + ?,"
> "where acct_number = ?;",
> "update teller set balance = balance + ?",
> "where teller_number = ?;",
> "update brance set balance = balance + ?",
> "where branch_number = ?;"
> "insert into history values (?, ?);",
> "commit work;" );
> $prepare qid from $query;
> $execute qid using $delta, $acct_number, $delta, $teller_number,
> $delta, $branch_number, $timestamp, $values;

Metabase supports prepared queries which you can execute as many times
as you want with different values, if it is that what you are asking.


 
> I should be able to check metabase out later this evening.  If it can handle
> the above native database language, I think it will be an asset, especially
> for some of our older applications.

I am not sure if it is exactly what you are asking. In any case there is
an extensive manual and a tutorial that details all it can do.

Regards,
Manuel Lemos

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Database Preference? -- Manuel, Michael, Miles

2001-08-30 Thread James Potts

Manuel,

Thanx for the excellent overview of metabase.  I will give it a test drive.
A couple further questions, if you have time:

Do you execute meta commands like you do with the other db interface
functions, e.g., odbc_connect(), odbc_select(), etc., or are you able to
encapsulate  SQL between tags, e.g.


SELECT bar FROM foo WHERE barname = "chocolate";


Using a function set can be cumbersome, compared to embedded language
interfaces where you just put SQL between tags, just like PHP is handled
between the  tags.

Also, can you PREPARE, DECLARE, and OPEN cursors like, say, in Informix, so
you can use variable SELECT parameters?  For example, using Informix ESQL/C
you can PREPARE a statement, use it to DECLARE a CURSOR, and the OPEN the
CURSOR USING multiple values, as in:

sprintf( query, "%s %s %s %s %s %s %s %s %s",
"begin work;",
"update account set balance = balance + ?,"
"where acct_number = ?;",
"update teller set balance = balance + ?",
"where teller_number = ?;",
"update brance set balance = balance + ?",
"where branch_number = ?;"
"insert into history values (?, ?);",
"commit work;" );
$prepare qid from $query;
$execute qid using $delta, $acct_number, $delta, $teller_number,
$delta, $branch_number, $timestamp, $values;

I should be able to check metabase out later this evening.  If it can handle
the above native database language, I think it will be an asset, especially
for some of our older applications.

Thanx again,
James Potts


"Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> James wrote:
> > Regarding a database abstraction package: does Metabase handle all
> > "standard" SQL constructs (as opposed to vendor-specific SQL
extensions)?
> > The GUI applications to be ported were built with JAM, which basically
> > provides an abstraction layer via its JPL language.  JPL has not been
> > restrictive in terms of required functionality, nor was there any real
> > performance hits.  Can the same be said of Metabase?  Also, would
Metabase
> > present a significant learning curve for experienced C and SQL
programmers?
> >
> > I will download PostgreSQL and check it out.
>
> Metabase does much more than you probably may want. Basically you can
> just submit any queries to the database server. Metabase doesn't touch
> them. What it does is when you are composing your queries with constant
> values, it may convert the respective data type values from a database
> independent data type set to the target database data types.
>
> Let's say you have strings or date constant values. Each database may
> have different ways to escape strings or format dates. Metabase provides
> functions to do that translation if you want to use direct queries. I
> you want to use prefered queries, with placeholders ( ? ) in the queries
> that are replace with constant values when the queries are executed, the
> functions to set those values perform the translations for you.
>
> For retrieving result data returned by SELECT queries, Metabase also
> provides functions to translate the data to a database independent
> format, so in your applications you only have to handle one universal
> format that you do not need to adapt if you decide to switch to your
> database backend.
>
> That is not all. Metabase also provides unique features, that are very
> important for Web programming, all in a database independent way. One is
> the ability to create and access to database sequence objects. Sequences
> are objects that can generate sequential integer unique numbers. They
> are often used to generate id values for table primary keys. Sequence
> number generation is guaranteed to be atomic, so it is adequate for
> environments where many users access the database concurrently, like the
> Web. Sequences are implemented with real sequence objects in databases
> that support it like Oracle and Postgres, but others that don't support
> real sequence objects are emulated with tables with a single
> auto-incremented integer field.
>
> Another important feature is the ability for Web programming is the
> ability to limit the range of rows that are returned from a select
> query, like MySQL LIMIT clause, but in a way that is supported by all
> databases supported by Metabase. This is great to let you develop
> applications that display query results split in multiple pages if they
> have too many rows.
>
> Metabase is not also good for develop applications to access databases.
> It is also able to install databases for you creating tables, fields,
> indexes and sequence from a database independent schema description
> defined in a specific XML format. Also, if later you need to change your
> database schema, all you need to do is change the schema description XML
> file. Metabase manager is able to figure the differences between the new
> and the previously 

Re: [PHP] Database Preference? -- Manuel, Michael, Miles

2001-08-30 Thread Manuel Lemos

Hello,

James wrote:
> Regarding a database abstraction package: does Metabase handle all
> "standard" SQL constructs (as opposed to vendor-specific SQL extensions)?
> The GUI applications to be ported were built with JAM, which basically
> provides an abstraction layer via its JPL language.  JPL has not been
> restrictive in terms of required functionality, nor was there any real
> performance hits.  Can the same be said of Metabase?  Also, would Metabase
> present a significant learning curve for experienced C and SQL programmers?
> 
> I will download PostgreSQL and check it out.

Metabase does much more than you probably may want. Basically you can
just submit any queries to the database server. Metabase doesn't touch
them. What it does is when you are composing your queries with constant
values, it may convert the respective data type values from a database
independent data type set to the target database data types.

Let's say you have strings or date constant values. Each database may
have different ways to escape strings or format dates. Metabase provides
functions to do that translation if you want to use direct queries. I
you want to use prefered queries, with placeholders ( ? ) in the queries
that are replace with constant values when the queries are executed, the
functions to set those values perform the translations for you.

For retrieving result data returned by SELECT queries, Metabase also
provides functions to translate the data to a database independent
format, so in your applications you only have to handle one universal
format that you do not need to adapt if you decide to switch to your
database backend.

That is not all. Metabase also provides unique features, that are very
important for Web programming, all in a database independent way. One is
the ability to create and access to database sequence objects. Sequences
are objects that can generate sequential integer unique numbers. They
are often used to generate id values for table primary keys. Sequence
number generation is guaranteed to be atomic, so it is adequate for
environments where many users access the database concurrently, like the
Web. Sequences are implemented with real sequence objects in databases
that support it like Oracle and Postgres, but others that don't support
real sequence objects are emulated with tables with a single
auto-incremented integer field.

Another important feature is the ability for Web programming is the
ability to limit the range of rows that are returned from a select
query, like MySQL LIMIT clause, but in a way that is supported by all
databases supported by Metabase. This is great to let you develop
applications that display query results split in multiple pages if they
have too many rows.

Metabase is not also good for develop applications to access databases.
It is also able to install databases for you creating tables, fields,
indexes and sequence from a database independent schema description
defined in a specific XML format. Also, if later you need to change your
database schema, all you need to do is change the schema description XML
file. Metabase manager is able to figure the differences between the new
and the previously installed schema and then it just alters the database
without affecting the data that was stored after the database was
installed for the first time or changed for the last time. This saves
you toons of hours and maintenance headache.

Metabase is easy to learn. In the site there is a tutorial document that
get you started real quick. If you need further help, you may join to
the Metabase development mailing list that is listed in the Metabase
page links sections. Look also in the database section of the PHP
Classes site for components ready to use with Metabase.

Regards,
Manuel Lemos

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Database Preference? -- Manuel, Michael, Miles

2001-08-29 Thread james

I appreciate all your thoughts.

Miles, regarding the price-per-seat issue, it isn't a question of the number
of developers but the number of simultaneous connections to the database.
For example, a 64-user Informix license is over $5,000 ...  While I doubt we
will need to maintain persistent connections, I could envision longer
transactions creating a queue in the WAIT line.

While most of our SQL code is fairly vanilla, the code has lots of
sub-queries, unions, outer joins, and transactions, etc.  That appears to
rule-out MySQL.

Regarding a database abstraction package: does Metabase handle all
"standard" SQL constructs (as opposed to vendor-specific SQL extensions)?
The GUI applications to be ported were built with JAM, which basically
provides an abstraction layer via its JPL language.  JPL has not been
restrictive in terms of required functionality, nor was there any real
performance hits.  Can the same be said of Metabase?  Also, would Metabase
present a significant learning curve for experienced C and SQL programmers?

I will download PostgreSQL and check it out.

Again, your input is appreciated and helpful.

James Potts



"Miles Thompson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> If you are used to Informix, MySQL will be unsatisfying - no stored
> procedures, outer joins, sub-queries, transactions. MySQL is much like
> early dBase II.
>
> I'm not familiar with MS SQL on a price per seat basis, but how many
> developers do you have? If you are doing this web-based you don't have
that
> many "seats". Given that your developers are used to working in MS SQL it
> may be cheaper in terms of overall developer costs.
>
> The downside of that course is that you are locked into MSFT's plans for
> the product and Windows NT/2000/XP.
>
> A robust and reliable open source alternative is PostgreSQL. It has
> features your developers are used to, is adequately fast, and is certainly
> robust. It would probably be the easiest port. Drivers are kept current in
> PHP, Python, Perl and of course ODBC.
>
> Regards - Miles Thompson
>
> At 09:50 PM 8/28/01 -0400, james wrote:
> >We have several GUI applications that we are preparing to convert to
> >web-based applications, based primarily on PHP.  The applications are
based
> >on Informix On-Line (on a SCO Unix server) and MS SQL (on NT).  Since we
> >will be doing a port, in any case, I am wondering your thoughts on
whether
> >MySQL may be a better database solution.  This is particularly important
> >from a price-performance point of view since the other two databases are
> >quite pricy on a per-seat basis.
> >
> >TIA,
> >James
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]