Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Problem loading procedure store in phpMyAdmin
Old 09-07-2012, 06:52 AM Problem loading procedure store in phpMyAdmin
Junior Talker

Posts: 1
Trades: 0
Hi everybody,
I've a problem loading procedure store in phpMyAdmin ..
i've used wamp server ver. 5.0.1
I've tried to use "import " for loading the whole function.. there is a error message " error of syntax.."
then i've tried with sql for loading each function....there is a error message " #1064...error of syntax.."

please help
here is my procedure
--
-- database: `formation`
--

DELIMITER $$
CREATE FUNCTION `ajoutinscription`(idparticipant int, seance int, idstatut int, v_ret int) RETURNS int(11) deterministic
begin

declare v_count int;
declare v_place int;
declare continue handler for sqlstate '23000' set v_ret = -2;
set v_ret=-1;
select count(*) into v_count from inscription i where i.idparticipant =idparticipant and i.idseance=seance;
if v_count =0 then
--start transaction;
--update seance set nbplaces =nbplaces -1 where idseance=seance;
--insert into inscription values (null, idparticipant,seance,idstatut);
select nbplaces into v_place from seance where idseance=seance;
if v_place >= 1 and v_ret =-1 then
update seance set nbplaces =nbplaces -1 where idseance=seance;
insert into inscription values (null, idparticipant,seance,idstatut);
--commit;
set v_ret=last_insert_id();
--else
--rollback;
end if;
end if;
return v_ret;
end$$


DELIMITER ;
bamiday is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-08-2012, 05:35 PM Re: Problem loading procedure store in phpMyAdmin
chrishirst's Avatar
Defies a Status

Posts: 43,966
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And the "error of syntax" is at which line of code??

And PLEASE use code delimiters when posting blocks of code.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Problem loading procedure store in phpMyAdmin
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15319 seconds with 11 queries