snowflake.core.procedure.ProcedureResource¶

class snowflake.core.procedure.ProcedureResource(name_with_args: Annotated[str, Strict(strict=True)], collection: ProcedureCollection)¶

Bases: SchemaObjectReferenceMixin[ProcedureCollection]

Represents a reference to a Snowflake procedure.

With this procedure reference, you can create and fetch information about procedures, as well as perform certain actions on them.

Attributes

database¶
fully_qualified_name¶
root¶

Methods

call(call_argument_list: CallArgumentList | None = None) → object¶

Call this procedure.

Examples

Calling a procedure with no arguments using its reference:

>>> procedure_reference.call(call_argument_list=CallArgumentList(call_arguments=[]))
Copy

Calling a procedure with 2 arguments using its reference:

>>> procedure_reference.call(call_argument_list=CallArgumentList(call_arguments=[
...     CallArgument(name="id", datatype="NUMBER", value=1),
...     CallArgument(name="tableName", datatype="VARCHAR", value="my_table_name"),
... ]))
Copy
drop() → None¶

Drop this procedure.

Examples

Dropping a procedure using its reference:

>>> procedure_reference.drop()
Copy
fetch() → Procedure¶

Fetch the details of a procedure.

Examples

Fetching a reference to a procedure to print its name:

>>> my_procedure = procedure_reference.fetch()
>>> print(my_procedure.name)
Copy