From: Philippe Poelvoorde <[EMAIL PROTECTED]>
Reply-To: "'mysql@lists.mysql.com '" <mysql@lists.mysql.com>
To: "'mysql@lists.mysql.com '" <mysql@lists.mysql.com>
Subject: Re: Queries inside UDF
Date: Mon, 21 Mar 2005 11:05:39 +0000

sguazt sguazt wrote:
Hi!

From: Philippe Poelvoorde <[EMAIL PROTECTED]>
Reply-To: "'mysql@lists.mysql.com '" <mysql@lists.mysql.com>
To: mysql@lists.mysql.com
Subject: Re: Queries inside UDF
Date: Thu, 17 Mar 2005 08:22:46 +0000

..


You can actually access a DB within a UDF, but you should do the same than when you're using the C api of mysql. So you need a way to get database name, user/passwd and port without user-input, and do mysql_init, mysql_connect, mysql_query, and so on, like when you are accessing that database using a 'external' C program. Also bear in mind that it should be thread-safe ;)
a way to extend udf, is ... stored procedure ?


Yes I did it ... look my first post (http://lists.mysql.com/mysql/181361)
There you can find and example of a C-code I used to write my UDF ... but when using the UDF inside MySQL I've got "Can't connect to MySQL server on 'localhost' (111)"

you should check the permission.


Instead compiling the C-code as stand-alone program (removing the xxx_init/xxx_deinit functions and adding a main) all is OK, the query is executed and the program normally exits.

did you execute it on your DB server ? (not on your WS)


yes I did.
The strange fact is just the stand alone program works and the library doesn't even if the connection parameters (host, port, user, password) are the same.
The DBMS is on my machine, so to connect to it I use:
host: localhost (I've also tried 127.0.0.1, NULL, ...)
port: 3306 (I've also tried 0)
user: root
password: NULL (I've also tried "")


-- Marco

_________________________________________________________________
Ricerche online pił semplici e veloci con MSN Toolbar! http://toolbar.msn.it/



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to