Nested if-statement in MySQL -


I am creating a process that includes a place ("staed") and I would like to check whether the input tap However, whenever I mark CRASH your code (bottom) tries to add I- statement to start around me, so I have my syntax that get an error saying "DECLARE varStedskodeID INT; " But it is not true which is part of the IF-statement after I am trying to add the part.

The syntax of my if-statement in my eyes is inside the code, but only check-in-my-null-only if-statement also crashes with just a simple (right) .

Can someone give me this hint that, could it be due to the accident?

  if the drop process is included; DELIMITER then & lt involved in the process of making $$ in (these Inputstensanan VARCHAR (255), IN input Seststep VARCHAR (255), IN input Kmmandn VARCHAR (255)) BEGIN if (TRUE); & Lt; ------ CRASH DECLARE varStedskodeID INT; DECLARE varKommunenr INT; If (where Stadstep the selected ID (Stadkodaidi) Kodnwn = input Stestep limit 1) = 0 Then Insert Stadstep value (default, Inputsastiple); end if; SET varStedskodeID = (SELECT StedkodeID from stststype WHERE codenavn = inputStedstype LIMIT 1); If (SELECT COUNT (Kmunr) from Comun where Comunen = input Kmunenj Limet 1) = 1 resets worker = ((Choose from Comun Comun where Comuneshn = input communion 1), enter values ​​(default, Inputstensnwn, Warsesscodid, Vrkmeshn); If end; if end;  

DECLARE allowed only one BEGIN ... end compound statement and

MySQL In the beginning of the stored procedure you announcements variables, tables, etc ...

change the stored procedure like this

  DECLARE varStedskodeID INT; DECLARE varKommunenr INT; if (true) then (SELECT COUNT (Stadkodaidi) from Stadstep where Kodnwn = input Stestep limit 1) = 0 then Insert Stadstep value (default, input Stest type); If end; SET varStedskodeID = (SELECT StedkodeID from stststype WHERE codenavn = inputStedstype LIMIT 1); If (SELECT COUNT (Kmunr) from Comun where Comunen = input Kmunenj Limet 1) = 1 resets worker = ((Choose from Comun Comun where Comuneshn = input communion 1), enter values ​​(default, Inputstensnwn, Warsesscodid, Vrkmeshn); If end; if end;  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -