Reputation: 4647
Using MySQLWorkbench, when I try to create this view:
SELECT myAttribute01, myAttribute02, myAttribute03 INTO @myVar01 , @myVar02, @myVar03 FROM mytable01 WHERE myAttribute01 = 1;
I get a 1350 error. However, I can execute the above SQL from an SQL tab with no problems. I only get the error when I try to make it into a view. See attached screen snip.
Upvotes: 0
Views: 196
Reputation: 2480
As written in the error, you can't use a "SELECT ... INTO" statement to create a view.
Futhermore as written in the guide
A view definition is subject to the following restrictions:
The SELECT statement cannot refer to system variables or user-defined variables.
Upvotes: 2