List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:January 4 2002 5:17am
Subject:Information on writing a procedure
View as plain text  
Hi!

>>>>> "Michael" == Michael C Neel <neel@stripped> writes:

Michael> Hi all,
Michael> I'm looking for information on writing a procedure for use in a
Michael> select statement (not a stored procedure).  The manual is scarce and the
Michael> source code it points two is not commented very well for learning how to
Michael> write a procedure.  I have written UDF's before, so I'm not completely
Michael> lost here - just asking if anyone has done or knows of a good guide to
Michael> writing these things.  Just for FYI, what I'm looking to write is a
Michael> procedure that would replace the value of the fields with a more user
Michael> friendly label, i.e. a domain field with value mysql.com would become
Michael> MySQL AB.  This could be done with a join, but I have to label 5
Michael> different fields and that would require 5 label tables so that the join
Michael> would work.  I'd rather have one label table with a type field, and not
Michael> have the query mucked up with a lot of joins just to label.

Sorry, but we don't have any documentation for this yet :(
We are working on writing a documentation for the MySQL code, but it
will take some months before this is usable.

Take a look at the code in sql/sql_analyse.cc, sql/procedure.cc and
sql/procedure.h 

These should show give you some idea of what you can do with this.

Regards,
Monty
Thread
Information on writing a procedureMichael C. Neel3 Jan
  • Information on writing a procedureMichael Widenius4 Jan