[英]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.