Start a new topic

MYSQL Functions

[This topic is migrated from our old forums. The original author name has been removed]

Hi, First congrats to all on a great new release! Love this product! Question: Why do i need to add comment clauses to compile my function definitions. see http://stackoverflow.com/questions/6628390/mysql-trouble-with-creating-user-defined-function-udf MYSQL Workbench also had this problem. I posted this question on experts-exchange. here is the function SET GLOBAL log_bin_trust_function_creators = 1; --/ 0 then set iVal = p_iVal - 1; end if; INSERT INTO test.sequence ( name, val, inc_val, first_val, max_val ) VALUES ( p_name, iVal, p_incVal, p_iVal, p_maxVal ); return 0; END /

[This reply is migrated from our old forums.]

Re: MYSQL Functions
Hi Jim, Thanks, glad to hear you're happy with 9.0! For the answer your question, please see the answer to this very similar question: http://www.dbvis.com/forum/thread.jspa?threadID=4254 Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: MYSQL Functions
Hi Hans, No that is not what I was looking for. When I create a function I have to add --/ whats up with that?
[This reply is migrated from our old forums.]

Re: MYSQL Functions
Jim, The reason is that DbVisualizer use semicolon ";" as a statement separator. For TRIGGERS, PROCEDURES and other objects, semicolon may be embedded in the block of code and due to this it will fail since DbVisualizer will split at each semicolon and run them separately. To workaround this the solutions in the post Hans referred too should be used. I hope this make sense. Regards Roger
[This reply is migrated from our old forums.]

Re: MYSQL Functions
Jim, --/ is the SQL Block begin delimiter, which is one of the alternatives to handle statements of this kind described in the post I referenced. Best Regards, Hans