I have a MySQL
database which is used by many registered users.
I have a stored procedure comprising of about 50 statements.
For each statement, I have to add the clause "WHERE USER_ID = 123"
to make sure that they act only on the login users.
I tried to create a VIEW with the clause "WHERE USER_ID = parameter"
but MySQL
does not accept the parameter.
Is there a short cut to avoid having to write the "WHERE"
clause in 50 statements, as there is the risk that it may behave wrongly and work on the data belonging to other users?