0

I made this procedure from phpmyadmin, but it don't works, I replaced the last word from record_id to a specified string id and worked, but when I use the parameter not working.

DROP PROCEDURE `prcd_update_record`;
CREATE DEFINER=`root`@`localhost` 
PROCEDURE `prcd_update_record`(
    IN `talep_id` VARCHAR(24), 
    IN `vall` INT(10)
) 
NOT DETERMINISTIC 
MODIFIES SQL DATA SQL 
SECURITY INVOKER 

UPDATE      `talep_malzeme` 
SET         `kalan_miktar` = vall
WHERE       `talep_malzeme`.`id` = talep_id;

The I execute it like this:

SET @p0='33'; SET @p1='57fb7911ea91e9efa'; CALL `prcd_update_record`(@p0, @p1);
1
  • What error you are getting? Add the error you are getting Commented Dec 15, 2016 at 12:53

3 Answers 3

1
DROP PROCEDURE IF EXISTS `prcd_sevk_toplam`;
create procedure prcd_sevk_toplam(talep_id int, vall VARCHAR(255))
BEGIN
    UPDATE  `talep_malzeme` SET `kalan_miktar` = vall WHERE `talep_malzeme`.`id` = talep_id;
END;

Hope this will help you.

Sign up to request clarification or add additional context in comments.

Comments

1

Looks like you has wrong parameter order, try

CALL `prcd_sevk_toplam`(@p1, @p0);

Comments

1

You should provide proper value to your parameter per your parameter definition. Your procedure accepts parameter as below

PROCEDURE `prcd_sevk_toplam`(
    IN `talep_id` VARCHAR(24), 
    IN `vall` INT(10)

And you are setting both of them to varchar. That could be the issue here. You should set them as

SET @p0=33; 
SET @p1='57fb7911ea91e9efa'; 
CALL `prcd_sevk_toplam`(@p1, @p0);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.