Re: [phplib-dev] DB_Sql: queries with priorities From: Alexander Aulbach (ssilk <email protected>)
Date: 09/07/00

On Mon, 4 Sep 2000, Sebastian Bergmann wrote:

}Eric Ries wrote:
}> Modifying queries is a bit tricky, which is why I urge everyone to check
}> out the SQL Abstraction Layer at http://enzyme.sourceforge.net - it's a
}> handy OO library for creating, combining, and modifying SQL statements.
}> It's GPL'ed too.
}
} SAL looks promising, but I think it would be overhead for inserting a
}single keyword into a query string.

In my opinion this it is the wrong way to built an SQL-API, that will
modify strings, without knowing what syntax is behind it. Think about the
following situation: We built in this option with the line:
if ($priority='high')
        $query=reg_replace("^SELECT","SELECT HIGH PRIORITY",$query);

Then you make the following line in your program:
$db->query("
                SELECT * FROM bla
");

What will happen? Nothing! You see, that the problem with syntax of
queries are not so easy.

Another reason is that LOW_PRIORITY and HIGH_PRIORITY are very, very
special parameters of mySQL. I don't know any other SQL, that will support
similar things. There are ways to make a query faster or slower, but they
are always very RDBMS-dependent and should be handled within your
application and not the the API cause optimization is a non
automizationable process.

-- 

SSilk - Alexander Aulbach - Herbipolis/Frankonia Minoris - (0931)22032

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-dev-unsubscribe <email protected> For additional commands, e-mail: phplib-dev-help <email protected>