Link to home
Start Free TrialLog in
Avatar of SamsonChung
SamsonChungFlag for Canada

asked on

MySQL Stored Procedure Calling MySQL Stored Procedure

I have two MySQL Stored Procedure,

CREATE Procedure proc1(
  IN alpha VARCHAR(10)
  , OUT Beta VARCHAR(55)
 ) --blah blah blah code for proc

CREATE Procedure proc2()
  BEGIN
      DECLARE l_alpha VARCHAR(10);
      DECLARE l_beta VARCHAR(55);
      CALL proc1(l_alpha, l_beta);
  END

Why am I getting

ERROR 1414 (42000): OUT or INOUT argument 2 for routine schema.proc1 is not a variable or NEW pseudo-variable in BEFORE trigger

??

Is there any other method around this? best practice?

Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

the error message seems to indicate that you try to use that inside a trigger?
can you clarify about that?
Avatar of SamsonChung

ASKER

No triggers what so ever...

What i was trying at the time when I got that message was to have one stored Proc call another stored Proc.

so, proc 2 calls proc 1. proc 1 does it thing, then return the result using INOUT variables of MySQL and return that to proc 2.

I was trying to get proc 2 to read this returned variable and use it. Then this problem showed up when I tried to create th proc.
I've found out what I did wrong,

It was a silly mistake.
can you post here, then the question can be PAQed with points refunded.
angelIII, zone advisor
ASKER CERTIFIED SOLUTION
Avatar of SamsonChung
SamsonChung
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial