Welcome Guest, Not a member yet? Register   Sign In
drop mysql view
#1

[eluser]vickel[/eluser]
is there a way to drop a mysql view?

Code:
$sql="drop view if exists my_view";
$this->db->query($sql);

doesn't work
#2

[eluser]Edy S[/eluser]
Please check whether you've doing this in your applications:
1. You have a privilege that allow an account that you use to drop your view
2. You are mention to the right view name, remember that in this case, View name, Column name, Table name are case sensitive
#3

[eluser]vickel[/eluser]
well,I'm using the CI (codeigniter) framework on localhost, so
@1 YES
@ 2 YES

its a generic question: "is there a way to drop a mysql view using:

$sql="drop view if exists my_view";
$this->db->query($sql);
#4

[eluser]TheFuzzy0ne[/eluser]
Are you getting any errors? If not, then I suspect it is a problem with your privileges, as Edy S said.
#5

[eluser]vickel[/eluser]
I found the error 1356:
View 'my_view' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them.

After looking deeper inside the matter, I found this was due to underlying table/view structures being updated.

hope that helps someone.




Theme © iAndrew 2016 - Forum software by © MyBB