Udostępnij za pośrednictwem


DocumentClient.CreateStoredProcedureQuery Method

Definition

Overloads

CreateStoredProcedureQuery(String, FeedOptions)

Overloaded. This method creates a query for stored procedures under a collection in an Azure Cosmos DB service. It returns An IOrderedQueryable{StoredProcedure}.

CreateStoredProcedureQuery(Uri, FeedOptions)

Extension method to create query for stored procedures in the Azure Cosmos DB service.

CreateStoredProcedureQuery(String, SqlQuerySpec, FeedOptions)

Overloaded. This method creates a query for stored procedures under a collection in an Azure Cosmos DB database using a SQL statement using a SQL statement with parameterized values. It returns an IQueryable{dynamic}. For more information on preparing SQL statements with parameterized values, please see SqlQuerySpec.

CreateStoredProcedureQuery(String, String, FeedOptions)

Overloaded. This method creates a query for stored procedures under a collection in an Azure Cosmos DB database using a SQL statement. It returns an IQueryable{dynamic}.

CreateStoredProcedureQuery(Uri, SqlQuerySpec, FeedOptions)

Extension method to create query for stored procedures in the Azure Cosmos DB service.

CreateStoredProcedureQuery(Uri, String, FeedOptions)

Extension method to create query for stored procedures in the Azure Cosmos DB service.

CreateStoredProcedureQuery(String, FeedOptions)

Overloaded. This method creates a query for stored procedures under a collection in an Azure Cosmos DB service. It returns An IOrderedQueryable{StoredProcedure}.

public System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.StoredProcedure> CreateStoredProcedureQuery (string collectionLink, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateStoredProcedureQuery : string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.StoredProcedure>
override this.CreateStoredProcedureQuery : string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.StoredProcedure>
Public Function CreateStoredProcedureQuery (collectionLink As String, Optional feedOptions As FeedOptions = Nothing) As IOrderedQueryable(Of StoredProcedure)

Parameters

collectionLink
String

The link to the parent collection resource.

feedOptions
FeedOptions

The options for processing the query result feed. For details, see FeedOptions

Returns

An IOrderedQueryable{StoredProcedure} that can evaluate the query with the provided SQL statement.

Implements

Examples

This example below queries for stored procedures by id.

StoredProcedure storedProcedure = client.CreateStoredProcedureQuery(collectionLink).Where(c => c.Id == "helloWorld").AsEnumerable().FirstOrDefault();

See also

Applies to

CreateStoredProcedureQuery(Uri, FeedOptions)

Extension method to create query for stored procedures in the Azure Cosmos DB service.

public System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.StoredProcedure> CreateStoredProcedureQuery (Uri storedProceduresUri, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateStoredProcedureQuery : Uri * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.StoredProcedure>
override this.CreateStoredProcedureQuery : Uri * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.StoredProcedure>
Public Function CreateStoredProcedureQuery (storedProceduresUri As Uri, Optional feedOptions As FeedOptions = Nothing) As IOrderedQueryable(Of StoredProcedure)

Parameters

storedProceduresUri
Uri

the URI to the stored procedures.

feedOptions
FeedOptions

The options for processing the query results feed.

Returns

The query result set.

Implements

Applies to

CreateStoredProcedureQuery(String, SqlQuerySpec, FeedOptions)

Overloaded. This method creates a query for stored procedures under a collection in an Azure Cosmos DB database using a SQL statement using a SQL statement with parameterized values. It returns an IQueryable{dynamic}. For more information on preparing SQL statements with parameterized values, please see SqlQuerySpec.

public System.Linq.IQueryable<dynamic> CreateStoredProcedureQuery (string collectionLink, Microsoft.Azure.Documents.SqlQuerySpec querySpec, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateStoredProcedureQuery : string * Microsoft.Azure.Documents.SqlQuerySpec * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
override this.CreateStoredProcedureQuery : string * Microsoft.Azure.Documents.SqlQuerySpec * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
Public Function CreateStoredProcedureQuery (collectionLink As String, querySpec As SqlQuerySpec, Optional feedOptions As FeedOptions = Nothing) As IQueryable(Of Object)

Parameters

collectionLink
String

The link to the parent collection resource.

querySpec
SqlQuerySpec

The SqlQuerySpec instance containing the SQL expression.

feedOptions
FeedOptions

The options for processing the query result feed. For details, see FeedOptions

Returns

An IQueryable{dynamic} that can evaluate the query with the provided SQL statement.

Implements

Examples

This example below queries for stored procedures by id.

var query = new SqlQuerySpec("SELECT * FROM sprocs s WHERE s.id = @id", new SqlParameterCollection(new SqlParameter[] { new SqlParameter { Name = "@id", Value = "HelloWorld" }}));
StoredProcedure storedProcedure = client.CreateStoredProcedureQuery(collectionLink, query).AsEnumerable().FirstOrDefault();

Remarks

Refer to https://docs.microsoft.com/azure/cosmos-db/sql-query-getting-started/ for syntax and examples.

See also

Applies to

CreateStoredProcedureQuery(String, String, FeedOptions)

Overloaded. This method creates a query for stored procedures under a collection in an Azure Cosmos DB database using a SQL statement. It returns an IQueryable{dynamic}.

public System.Linq.IQueryable<dynamic> CreateStoredProcedureQuery (string collectionLink, string sqlExpression, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateStoredProcedureQuery : string * string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
override this.CreateStoredProcedureQuery : string * string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
Public Function CreateStoredProcedureQuery (collectionLink As String, sqlExpression As String, Optional feedOptions As FeedOptions = Nothing) As IQueryable(Of Object)

Parameters

collectionLink
String

The link to the parent collection resource.

sqlExpression
String

The SQL statement.

feedOptions
FeedOptions

The options for processing the query result feed. For details, see FeedOptions

Returns

An IQueryable{dynamic} that can evaluate the query with the provided SQL statement.

Implements

Examples

This example below queries for stored procedures by id.

StoredProcedure storedProcedure = client.CreateStoredProcedureQuery(collectionLink, "SELECT * FROM sprocs s WHERE s.id = 'HelloWorld'").AsEnumerable().FirstOrDefault();

Remarks

Refer to https://docs.microsoft.com/azure/cosmos-db/sql-query-getting-started/ for syntax and examples.

See also

Applies to

CreateStoredProcedureQuery(Uri, SqlQuerySpec, FeedOptions)

Extension method to create query for stored procedures in the Azure Cosmos DB service.

public System.Linq.IQueryable<dynamic> CreateStoredProcedureQuery (Uri storedProceduresUri, Microsoft.Azure.Documents.SqlQuerySpec querySpec, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateStoredProcedureQuery : Uri * Microsoft.Azure.Documents.SqlQuerySpec * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
override this.CreateStoredProcedureQuery : Uri * Microsoft.Azure.Documents.SqlQuerySpec * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
Public Function CreateStoredProcedureQuery (storedProceduresUri As Uri, querySpec As SqlQuerySpec, Optional feedOptions As FeedOptions = Nothing) As IQueryable(Of Object)

Parameters

storedProceduresUri
Uri

the URI to the stored procedures.

querySpec
SqlQuerySpec

The sql query.

feedOptions
FeedOptions

The options for processing the query results feed.

Returns

The query result set.

Implements

Applies to

CreateStoredProcedureQuery(Uri, String, FeedOptions)

Extension method to create query for stored procedures in the Azure Cosmos DB service.

public System.Linq.IQueryable<dynamic> CreateStoredProcedureQuery (Uri storedProceduresUri, string sqlExpression, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = default);
abstract member CreateStoredProcedureQuery : Uri * string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
override this.CreateStoredProcedureQuery : Uri * string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
Public Function CreateStoredProcedureQuery (storedProceduresUri As Uri, sqlExpression As String, Optional feedOptions As FeedOptions = Nothing) As IQueryable(Of Object)

Parameters

storedProceduresUri
Uri

the URI to the stored procedures.

sqlExpression
String

The sql query.

feedOptions
FeedOptions

The options for processing the query results feed.

Returns

The query result set.

Implements

Applies to