MySQL DECLARE/SELECT INTO Syntax error? -


I honestly do not know what I'm doing wrong.

  Regular Name: ProcInsertName Type: Process Parameters: IN Name VARCHAR 30 Charset Deplerler TempNameID INT; Name Name Right Name Name WHERE Value = @ Name; If no tempNameID name (value) value (name @); end if; Determinant is: Uncheck defender: & lt; Blank & gt; Security type: DEFINER SQL data access: contains SQL: & lt; Blank & gt;   

I'm coming out with an error:

  One or more errors occurred while processing your request: The following query has failed : "Create Process" procInsertName` (`name` in VARCHAR) (30) Not included Definition SQL SQL Definition Definer declaration tempNameID INT; Select nameID from tempNameID name Where value = @Name, if tempNameID then name (value) in value Insert is zero (@ name); if end, "MySQL said: # 1064 - an error in your SQL syntax It is; Closest 'DECLARE tempNameID INT; To use, check the manual related to your MySQL server version for the correct syntax; Selection nameID will be appreciated by the help of name tempNameID WHERE in row 1, 

Any help would be appreciated, I've spent the past 30 minutes looking around online and can not find anything. Thank you.

I think the error is lying in the @ symbol. You must come from a SQL Server background; MySQL does not use @ notation for variables, so your parameter is effectively called simply name . Try changing the name of your name parameter to p_Name and then with p_Name in the body @Name Instead of 2 examples of your stored work.

Ie like this:

  Process `procInsertName` (` p_Name` in VARCHAR (30)) Not included Definition SQL SQL Definition Definer declaration create tempNameID INT; Name in TempNameID, select name WHERE value = p_Name; If tempNameID is not a name then (value) value (p_Name); end if;    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -