Stored Procedure Reference
Casabase Cube provides client-callable stored procedures for querying, discovery, modeling, administration, migration, diagnostics, security, governance, and integration.
All client-callable procedures documented in this reference are available in the CUBE schema of the installed Casabase Cube application.
Examples in this reference use the sample FINANCE cube where a runnable example is useful. Substitute your own application and cube names as appropriate.
Application Roles
Section titled “Application Roles”Each procedure page identifies the lowest application role that can call the procedure.
| Role | Access |
|---|---|
CUBE_PUBLIC |
Query and discovery operations. |
CUBE_ADMIN |
Modeling and administrative operations. Inherits CUBE_PUBLIC, so an administrator needs only CUBE_ADMIN. |
Calling Conventions
Section titled “Calling Conventions”Procedures that return TABLE
Section titled “Procedures that return TABLE”Read the result directly, or use Snowflake RESULT_SCAN when you need to filter or join the returned rows.
CALL CUBE.LIST_CUBES();
SELECT *FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()))WHERE HAS_SECURITY;Procedures that return VARIANT
Section titled “Procedures that return VARIANT”A VARIANT result contains a JSON object. Capture the result and use the standard Snowflake operators to navigate its contents.
Procedures that return VARCHAR
Section titled “Procedures that return VARCHAR”A VARCHAR result is a human-readable status message. Read the returned message rather than assuming that every non-success condition throws an exception. Some procedures can report partial success in their returned status.
Optional parameters
Section titled “Optional parameters”Optional parameters can be omitted from the right side of the procedure call or passed explicitly by name.
CALL CUBE.PURGE_AUDIT_LOG( p_retention_days => 365, p_confirm => FALSE);Parameter tables in this reference use:
| Marker | Meaning |
|---|---|
req |
The parameter must be supplied. |
opt |
The parameter has a default and may be omitted. |
Procedure Categories
Section titled “Procedure Categories”| Category | Description |
|---|---|
| Querying | Stored procedures for querying. |
| Discovery | Stored procedures for discovery. |
| Cube Lifecycle | Stored procedures for cube lifecycle. |
| Dimension Management | Stored procedures for dimension management. |
| Attribute Dimensions | Stored procedures for attribute dimensions. |
| Dimension Snapshots | Stored procedures for dimension snapshots. |
| Data Loading | Stored procedures for data loading. |
| Formulas | Stored procedures for formulas. |
| Variables & Dynamic Time Series | Stored procedures for variables & dynamic time series. |
| Saved Queries & Scheduling | Stored procedures for saved queries & scheduling. |
| Security | Stored procedures for security. |
| Governance & Compliance | Stored procedures for governance & compliance. |
| Audit Log | Stored procedures for audit log. |
| Health, Diagnostics & Performance | Stored procedures for health, diagnostics & performance. |
| Oracle Import & Migration | Stored procedures for import & migration. |
| AI Integration | Stored procedures for ai integration. |
| Agent Procedures | Stored procedures for agent procedures. |
| Maintenance Utilities | Stored procedures for maintenance utilities. |
Alphabetical Procedure Index
Section titled “Alphabetical Procedure Index”The role shown below is the lowest application role that can call the procedure.
