Hi all,
I'm currently working on project, where I need implement some functions to formate
SQL queries.
It's necessary to add these functions into MySQL.
I read about UDF (user def. functions)  and I mean, that it is almost what I want.
For examlple,
QUERY()  ... UDF function, whitch returns string like: "SELECT * FROM tab;"
What I need is to execute this string like MySQL query.
I know, that it could be done by PHP script (function) like this
>function DB_Query( $query, $connection )
> {
>       $tmpquery   = "SELECT QUERY( $query );";
>       $result         = MySQL_Query( $tmpquery, $connection );
>       $entry         = SQL2_Fetch_Array( $result );
>
>       $dbquery        = $entry[ 1 ];
>       $result         = MySQL_Query( $tmpquery, $connection );
>
>       return ($result);
> }

But the problem is, that it requires two DB calls.
It's necessary to add these functions into MySQL,  because if I use other API (for 
example
DBI, etc.) I need to write all functions like above again.

Is it possible to create QUERY() function which would execute the query?
(not to return string with query, but return query results)

thanx

--Nykolas
______________________________________________________________________
Setrite na leto? Lepsi zamestnani pro Vas a dovolene zdarma za 100 000 Kc
na http://www.jobpilot.cz/go/prazdniny.

______________________________________________________________________
Setrite na leto? Lepsi zamestnani pro Vas a dovolene zdarma za 100 000 Kc
na http://www.jobpilot.cz/go/prazdniny.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to