Describes the columns in a materialized view.
DESCRIBE can be abbreviated to DESC.
CREATE MATERIALIZED VIEW , DROP MATERIALIZED VIEW , ALTER MATERIALIZED VIEW , SHOW MATERIALIZED VIEWS
DESC[RIBE] MATERIALIZED VIEW <name>
Copy
Parameters¶name
Specifies the identifier for the materialized view to describe. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
The command output does not include the view definition. To see the materialized view’s definition, use SHOW MATERIALIZED VIEWS or GET_DDL.
DESC MATERIALIZED VIEW and DESCRIBE TABLE are interchangeable. Either command retrieves the details for the table or view that matches the criteria in the statement.
To post-process the output of this command, you can use the pipe operator (->>
) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.
The output column names for this command are generated in lowercase. If you consume a result set from this command with the pipe operator or the RESULT_SCAN function, use double-quoted identifiers for the column names in the query to ensure that they match the column names in the output that was scanned. For example, if the name of an output column is type
, then specify "type"
for the identifier.
Example setup:
CREATE MATERIALIZED VIEW emp_view AS SELECT id "Employee Number", lname "Last Name", location "Home Base" FROM emp;Copy
Describe the materialized view:
DESC MATERIALIZED VIEW emp_view;Copy
+-----------------+--------------+--------+-------+---------+-------------+------------+-------+------------+---------+ | name | type | kind | null? | default | primary key | unique key | check | expression | comment | |-----------------+--------------+--------+-------+---------+-------------+------------+-------+------------+---------| | Employee Number | NUMBER(38,0) | COLUMN | Y | NULL | N | N | NULL | NULL | NULL | | Last Name | VARCHAR(50) | COLUMN | Y | NULL | N | N | NULL | NULL | NULL | | Home Base | VARCHAR(100) | COLUMN | Y | NULL | N | N | NULL | NULL | NULL | +-----------------+--------------+--------+-------+---------+-------------+------------+-------+------------+---------+
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4