Q
Q
Qairat2017-02-06 12:45:23
MySQL
Qairat, 2017-02-06 12:45:23

How we receive result of procedure in the trigger?

Hi all!
I cannot equate result of procedure in the trigger. Here is the code:

DROP TRIGGER IF EXISTS `InsertBuildingAnalysis`;
CREATE TRIGGER `InsertBuildingAnalysis` BEFORE INSERT ON `MDepartments` FOR EACH ROW 
BEGIN
  DECLARE population INT;

  SET  population = (CALL GetPopulationNumber(new.MOId));

END

The error is not correct syntax.
Help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
entermix, 2017-02-06
@entermix

And to attach the text of an error not destiny? Let them guess? Ok
Try something like this:

SELECT * INTO population FROM (CALL GetPopulationNumber(new.MOId))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question