SHOW WARNINGS command¶
The SHOW WARNINGS command shows the warning resulted from the previous GQL query execution in the current session.
Warnings alert users to non-critical issues without raising an exception or terminating the query. When the query is executed successfully but returns the number of warnings in ngql, NebulaGraph Studio, or NebulaGraph Database Console, you can execute this command to view the warning details.
The following table describes the returned information:
| Column | Description |
|---|---|
code |
The warning code. |
message |
The detailed warning message. |
Prerequisites¶
ngql must be in the nowarnings state for this command to return results. Otherwise, warnings generated from the previous query executions are automatically displayed by ngql, and the SHOW WARNINGS command always returns an empty result. For more information, see Displaying and hiding of warnings.
Syntax¶
- show_warnings_command
show_warnings_command ::=
'SHOW' 'WARNINGS'
Examples¶
-
Use the deprecated syntax to set the home schema for the current session.
SESSION SET SCHEMA "/default_schema"Return:
Warnings: 1 Execution succeeded (time spent 1.233ms/2.386812ms)The preceding example is executed successfully but the ngql client prompts that 1 warning is generated.
-
View the warning resulted from the previous executions in the current session.
SHOW WARNINGSReturn:
+-------+-------------------------------------------------------------------------------------------------------------------------------+ | code | message | +-------+-------------------------------------------------------------------------------------------------------------------------------+ | 01005 | Warning: deprecated syntax: using backticks(``) or double quotes(\"\") to enclose schema path is deprecated in the new syntax | +-------+-------------------------------------------------------------------------------------------------------------------------------+