SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 239 | Next

Marc Delisle

"Mastering phpMyAdmin 2.11 for Effective MySQL Management"


It might be tempting to open the book table on its Structure page and
look there for a list of procedures that manipulate this table, like our add_
page() procedure. However, all procedures are stored at the database
level, and there is no direct link between the code itself (UPDATE book)
and the place where the procedure is stored.
Manually Creating a Function
Functions are similar to stored procedures. However, a function may return just one
value, whereas a stored procedure can have more than one OUT parameter. On the
other hand, using a stored function from within a SELECT statement may seem more
natural and avoids the need of an intermediate SQL variable to hold the value of an
OUT parameter.
What is the goal of functions? As an example, a function can be used to calculate
the total cost of an order, including tax and shipping. Putting this logic inside the
database, instead of at the application level, helps to document the applicationdatabase
interface and avoids duplicating business logic in every application that
needs to deal with this logic.
We should not confuse MySQL 5.0's functions with UDF (User-Defined Functions),
which existed before MySQL 5.0. A UDF is constituted of code written in C or C++,
compiled into a shared object, and referenced with a CREATE FUNCTION statement
plus the SONAME keyword.


Pages:
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6