问题描述
我不想如何从过程的参数传递数组类型参数以及如何将该参数数组值与同一过程体中的现有游标值进行比较。
示例:
i希望在该过程中传递{1,2,3,4,5} varchar类型。它将与现有游标值c_abc {1,2,4,9}进行比较。
I want to no how to pass array type parameter from a procedure's parameter and how i will compare that parameter array value with an existing cursor value in a same procedure body.
example:
i want to pass a{1,2,3,4,5} varchar type in that procedure. and it will compare with the existing cursor value c_abc {1,2,4,9}.
推荐答案
CREATE TYPE dbo.Products AS TABLE
( ID int, Description varchar(50) )
第2步:然后创建一个存储的程序
Step 2: Then create a Stored Prcedure
CREATE PROCEDURE getProductDetails
(@itemIDs dbo.Products)
AS
BEGIN
SELECT * FROM @Products
END
第3步:为了从c#或代码中传递数据,创建一个DataTable当我们传递给普通参数时,将对象传递给存储过程。
Step 3: In order to pass the data from c# or what ever the code, create a DataTable object and pass it to the Stored Procedure as we pass to the normal parameters.
这篇关于如何将数组类型参数和普通参数传递给pl / sql中的过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!