gjking
-
Posts
2 -
Joined
-
Last visited
Never
Posts posted by gjking
-
-
Hellllo there,
I want to create stored functions. I checked out the MySQL manual how to do this. But in the process of doing this I wanted to get a list with info of all these stored functions
The manual says this can be done with "SHOW FUNCTION STATUS"
However this does not work...I tried it by executing this query from 3 places:
PHPMyAdmin
direct in the command line
from a php script which I've written myself
I use MySQL version 4.1.10a-nt
I also have problems creating a stored function...I tried the following example (from the command line):
[code]
delimiter ||
CREATE FUNCTION WEIGHTED_AVERAGE (n1 INT, n2 INT, n3 INT, n4 INT)
RETURNS INT
DETERMINISTIC
BEGIN
DECLARE avg INT;
SET avg = (n1+n2+n3*2+n4*4)/8;
RETURN avg;
END||
[/code]
But I get the following error:
[code]
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '(n1 I
NT, n2 INT, n3 INT, n4 INT)
RETURNS INT
DETERMINISTIC
BEGIN
D' at line 1
[/code]
Hope someone can help me out....
Best wishes,
GJ
UDF on Windows XP
in MySQL Help
Posted
Does anyone have experience with creating a UDF by means of a *.dll on a Windows XP platform.
I use the following software:
Windows XP
PHP 5.1.4
MySQL 5.0.21-community-nt
Apache/2.0.55 (Win32)
DevCpp IDE to compile the src
I compiled the udf_example.cpp from the example (contained in the MySQL src distribution):
C:\DevCpp\bin>g++ -shared -o c:\wamp\mysql\udf_example.dll c:\wamp\mysql\
udf_example.cpp -I c:\wamp\mysql\include -I c:\devcpp\include
And then I put the dll in c:\wamp\mysql\bin (where also the libmySQL.dll resides)
And then I tried to link a function in by means of:
CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.dll'
But I get the following error: #1127 - Can't find function 'metaphon' in library
---------------------------------------------------------------------------------------------------
[list][*]Did I put the dll in the wrong place ?[*]Or do I have to compile it necessarily with VC++ ?[*]Or do I have to set some environment variable so MySQL knows where the dll can be found ?[*]................[/list]
Hope anyone can help me out...
Kind regards, GJ