0

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?

Sathish D
  • 4,854
  • 31
  • 44
TKLA
  • 3
  • 1
  • Are all those statements addressing the same table? What does "MySQL does not accept the parameter" mean? It's maybe a good idea to post the whole procedure. – fancyPants Feb 26 '14 at 10:32
  • It addresses various tables all of which have the user_id as a field. – TKLA Feb 28 '14 at 07:24

0 Answers0