简体   繁体   English

在用户定义的 function 中执行存储过程

[英]Execute a stored procedure inside user defined function

I want to execute a few diferents store procedure in a ACID transaction but it can't do only with stored procedures, so I want to know if there is a way to execute stored procedures inside UDF in CosmosDB我想在 ACID 事务中执行一些不同的存储过程,但它不能只使用存储过程,所以我想知道是否有办法在 CosmosDB 中的 UDF 中执行存储过程

That is not possible.这是不可能的。 Stored Procedures can be invoked from a client only, not from a user defined function.存储过程只能从客户端调用,不能从用户定义的 function 调用。

You cannot chain multiple Stored procedure executions in the same transactional scope either.您也不能在同一个事务 scope 中链接多个存储过程执行。

The only alternative, depending on what your stored procedures do, would be to use Transactional Batch , so define a group of item operations as a single transaction unit, the limitation is that these are operations that cannot be feedback from one another (you cannot put a Read operation with a condition to perform a Write operation in the same batch, batches do not support conditions), so it really depends on the logic of your stored procedures.根据您的存储过程所做的唯一选择是使用Transactional Batch ,因此将一组项目操作定义为单个事务单元,限制是这些操作不能相互反馈(您不能将一个带条件的读操作在同一个批次中执行一个写操作,批次不支持条件),所以这真的取决于你的存储过程的逻辑。 Transactional batch cannot be invoked from user defined functions, only from the client.事务批处理不能从用户定义的函数调用,只能从客户端调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将用户定义的函数转换为EF的存储过程 - Convert user-defined function to stored procedure for EF 如何使用 Oracle 中的用户定义数据类型参数从 .NET 前端执行 Oracle 存储过程 - How to execute Oracle stored procedure with User Defined DataTypes Parameters in Oracle from .NET Front-End 在实体框架事务中执行存储过程 - execute stored procedure inside Entity Framework transaction 使用用户定义的参数调用存储过程 - Call stored procedure with user defined parameter 如何在FluentNHibernate Mapping中执行并从存储过程中返回值? - How to execute and return value form a stored procedure inside FluentNHibernate Mapping? 在 SQL 存储过程中使用用户定义的表 - 无效数据类型 - using user defined tables in SQL Stored Procedure - invalid data type 如何将用户定义类型的数组传递给存储过程 - How to pass array of user defined type to a stored procedure C#中具有用户定义类型的Oracle存储过程 - Oracle Stored Procedure with User Defined Type in C# CLR SQL用户定义的类型将ID传递给存储过程的列表 - CLR SQL User Defined type pass list of ID to stored procedure 使用用户定义的表类型作为存储过程的参数 - Use User defined Table Type as a parameter to Stored Procedure
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM