从 mysql 中的视图调用存储过程。可能吗?如果没有,还有其他选择吗?
Invoke a stored procedure from a view in mysql. Is it possible? If not, any alternatives?
我有一个场景,其中有一个视图 'MyView'、一个存储过程 'MyProc' 和一个 Table 'MyTable'。
调用 MyProc 时,它会清除 MyTable 中的现有数据,并根据特定条件,用正确的数据填充 MyTable。 MyView 的工作是 return 返回 MyTable 中包含的数据。
每次调用 MyView 时,都需要调用 MyProc 来填充 MyTable。
问题是,如何link MyProc with MyView。是否可以从视图调用存储过程?如果不能,是否还有其他解决方法?
Can a stored procedure be invoked from a view
否,只能使用函数,因为视图只是 stored/saved 查询。
is there any other work around?
是的,作为替代方案,您可以将所有这些步骤包装在另一个存储过程中并调用该过程,该过程将依次调用您的 myproc
我有一个场景,其中有一个视图 'MyView'、一个存储过程 'MyProc' 和一个 Table 'MyTable'。
调用 MyProc 时,它会清除 MyTable 中的现有数据,并根据特定条件,用正确的数据填充 MyTable。 MyView 的工作是 return 返回 MyTable 中包含的数据。
每次调用 MyView 时,都需要调用 MyProc 来填充 MyTable。
问题是,如何link MyProc with MyView。是否可以从视图调用存储过程?如果不能,是否还有其他解决方法?
Can a stored procedure be invoked from a view
否,只能使用函数,因为视图只是 stored/saved 查询。
is there any other work around?
是的,作为替代方案,您可以将所有这些步骤包装在另一个存储过程中并调用该过程,该过程将依次调用您的 myproc