DISCARD
Function
This syntax releases internal resources associated with a database session.
![](https://support.huaweicloud.com/intl/en-us/sqlreference-820-dws/public_sys-resources/note_3.0-en-us.png)
In cluster 8.2.0, only resources associated with VOLATILE temporary tables can be released.
Precautions
After the DISCARD operation is performed, all volatile temporary table resources in the current session are cleared. A single volatile temporary table resource cannot be cleared.
Syntax
1
|
DISCARD VOLATILE { TEMPORARY | TEMP } |
Parameter Description
- VOLATILE { TEMPORARY | TEMP }
Releases resources related to the VOLATILE temporary table in the current session.
Examples
After the DISCARD operation is performed, all resources related to volatile temporary tables in the current session are cleared.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
CREATE VOLATILE TEMP TABLE TX1(A INT) DISTRIBUTE BY HASH(A); CREATE TABLE CREATE VOLATILE TEMP TABLE TX2(A INT) DISTRIBUTE BY HASH(A); CREATE TABLE SELECT * FROM TX1; a --- (0 rows) SELECT * FROM TX2; a --- (0 rows) DISCARD VOLATILE TEMP; DISCARD VOLATILE TEMP SELECT * FROM TX1; ERROR: relation "tx1" does not exist LINE 1: SELECT * FROM TX1; ^ SELECT * FROM TX2; ERROR: relation "tx2" does not exist LINE 1: SELECT * FROM TX2; |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot