Reply to Re: MySQL function error

Your name:

Reply:


Posted by Jerry Stuckle on 11/08/07 13:45

coosa wrote:
> dear all,
>
> I have a table called "distributor" having "distributor_id" as a PK
> and taking an integer data type as well as "distributor_parent_id"
> which also takes an integer data type but can accept null values;
>
> I tried to make this simple function that returns the parent_id by
> taking a parameter representing the distributor id; still it fails, I
> assume due to the delimiters.
>
> I appreciate any assistance to this regard.
>
> DELIMITER $$
>
> CREATE FUNCTION last_inserted_parent_id ( inserted_id INT )
> RETURNS INT
> BEGIN
> DECLARE parent_id INT$$
> SET parent_id = (
> SELECT distributor_parent_id
> FROM distributor
> WHERE distributor_id = inserted_id
> )
> RETURN parent_id$$
> END$$
>
> DELIMITER ;
>
>

comp.databases.mysql is thataway ==>.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация