Posted by Jim Michaels on 01/15/06 01:56
I am on MySQL 4.1:
SET GLOBAL log_bin_trust_function_creators =1;
Unknown system variable 'log_bin_trust_function_creators'
-- the function
delimiter //
CREATE FUNCTION fn_rand() RETURNS DECIMAL
BEGIN
RETURN RAND();
END;
//
delimiter ;
so I took off the first line.
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 'delimiter //
CREATE FUNCTION fn_rand() RETURNS DECIMAL
BEGIN
RETURN RAND();
' at line 2
so I took off the dlimiters.
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 '() RETURNS
DECIMAL
BEGIN
RETURN RAND();
END' at line 1
MySQL 4.1 only allows functions in shared library files. I know what it's
going to expect next. SONAME and a shared library filename. maybe it's time
I upgrade to mysql 5. is it production yet? [just checked] yup. upgrade
complete.
"J.O. Aho" <user@example.net> wrote in message
news:42h3o3F1ietvjU1@individual.net...
> Jim Michaels wrote:
>> the syntax is wrong. the function must be compiled in a shared library
>> first an declared with SONAME.
>
>>> create function fn_rand() returns float
>>>
>>> begin
>>>
>>> return rand()
>>>
>>> end
>>>
>
>
> -- for just in case it's off
> SET GLOBAL log_bin_trust_function_creators =1;
>
> -- the function
> delimiter //
> CREATE FUNCTION fn_rand() RETURNS DECIMAL
> BEGIN
> RETURN RAND();
> END;
> //
> delimiter ;
>
>
> //Aho
Navigation:
[Reply to this message]
|