共用方式為


CosmosScripts.GetStoredProcedureQueryIterator Method

Definition

Overloads

GetStoredProcedureQueryIterator<T>(QueryDefinition, String, QueryRequestOptions, CancellationToken)

This method creates a query for stored procedures under a container using a SQL statement. It returns a FeedIterator. For more information on preparing SQL statements with parameterized values, please see QueryDefinition overload.

GetStoredProcedureQueryIterator<T>(String, String, QueryRequestOptions, CancellationToken)

This method creates a query for stored procedures under a container using a SQL statement. It returns a FeedIterator. For more information on preparing SQL statements with parameterized values, please see QueryDefinition overload.

GetStoredProcedureQueryIterator<T>(QueryDefinition, String, QueryRequestOptions, CancellationToken)

This method creates a query for stored procedures under a container using a SQL statement. It returns a FeedIterator. For more information on preparing SQL statements with parameterized values, please see QueryDefinition overload.

public abstract Azure.AsyncPageable<T> GetStoredProcedureQueryIterator<T> (Azure.Cosmos.QueryDefinition queryDefinition, string continuationToken = default, Azure.Cosmos.QueryRequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetStoredProcedureQueryIterator : Azure.Cosmos.QueryDefinition * string * Azure.Cosmos.QueryRequestOptions * System.Threading.CancellationToken -> Azure.AsyncPageable<'T>
Public MustOverride Function GetStoredProcedureQueryIterator(Of T) (queryDefinition As QueryDefinition, Optional continuationToken As String = Nothing, Optional requestOptions As QueryRequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of T)

Type Parameters

T

Parameters

queryDefinition
QueryDefinition

The cosmos SQL query definition.

continuationToken
String

(Optional) The continuation token in the Azure Cosmos DB service.

requestOptions
QueryRequestOptions

(Optional) The options for the item query request QueryRequestOptions

cancellationToken
CancellationToken

(Optional) CancellationToken representing request cancellation.

Returns

An iterator to read through the existing stored procedures.

Examples

This create the type feed iterator for sproc with queryDefinition as input.

CosmosScripts scripts = this.container.Scripts;
string queryText = "SELECT * FROM s where s.id like @testId";
QueryDefinition queryDefinition = new QueryDefinition(queryText);
queryDefinition.WithParameter("@testId", "testSprocId");
AsyncPageable<StoredProcedureProperties> iter = this.scripts.GetStoredProcedureQueryIterator<StoredProcedureProperties>(queryDefinition);

Applies to

GetStoredProcedureQueryIterator<T>(String, String, QueryRequestOptions, CancellationToken)

This method creates a query for stored procedures under a container using a SQL statement. It returns a FeedIterator. For more information on preparing SQL statements with parameterized values, please see QueryDefinition overload.

public abstract Azure.AsyncPageable<T> GetStoredProcedureQueryIterator<T> (string queryText = default, string continuationToken = default, Azure.Cosmos.QueryRequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetStoredProcedureQueryIterator : string * string * Azure.Cosmos.QueryRequestOptions * System.Threading.CancellationToken -> Azure.AsyncPageable<'T>
Public MustOverride Function GetStoredProcedureQueryIterator(Of T) (Optional queryText As String = Nothing, Optional continuationToken As String = Nothing, Optional requestOptions As QueryRequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of T)

Type Parameters

T

Parameters

queryText
String

The cosmos SQL query text.

continuationToken
String

(Optional) The continuation token in the Azure Cosmos DB service.

requestOptions
QueryRequestOptions

(Optional) The options for the item query request QueryRequestOptions

cancellationToken
CancellationToken

(Optional) CancellationToken representing request cancellation.

Returns

An iterator to read through the existing stored procedures.

Examples

This create the type feed iterator for sproc with queryText as input.

CosmosScripts scripts = this.container.Scripts;
string queryText = "SELECT * FROM s where s.id like '%testId%'";
AsyncPageable<StoredProcedureProperties> iter = this.scripts.GetStoredProcedureQueryIterator<StoredProcedureProperties>(queryText);

Applies to