On Aug 04, Joseph Lukas wrote:
> I am trying to test the command in using a stored function. The log file
> stops at the DELIMITER every time and will not set however I have no issues
> with running the commands outside the test suite in normal MySQL. The
> content of the test is at the bottom of the e-mail.
I'll reply to this below
> I also do realize that the variables I am setting do not really have
> anything to do with the commands in the test. I am mainly running the test
> in order to check the function with different types of commands.
> So I figured I should simply be testing that they are set, returned,
> and works properly after errors and with various commands.
Yes, it's ok.
> A question as well of how do you change the date_format variable, or any
> other date type variable to another setting such as %M/%D/%Y or similar?
The manual says "This variable is unused."
> DELIMITER :
> CREATE FUNCTION myProc (cost DECIMAL(10,2))
> RETURNS DECIMAL(10,2)
> SQL SECURITY DEFINER
> tax: BEGIN
> DECLARE order_tax DECIMAL(10,2);
> SET order_tax = cost * .05;
> RETURN order_tax;
> DELIMITER ;
Two problems. First - you have the delimiter (colon) in the body of
your function. Try a different delimiter, e.g. |
Second - see how delimiter is used in, e.g., sp.test:
create procedure empty()
That is, you need to terminate the delimiter command with the *old*
Regards / Mit vielen Grüßen,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Engineer/Server Architect
/_/ /_/\_, /___/\___\_\___/ Sun Microsystems GmbH, HRB München 161028
<___/ Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring