跳到主要内容

Context Functions

This page provides reference information for the context-related functions in Databend. These functions return information about the current session, database, or system context.

Session Information Functions

FunctionDescriptionExample
CONNECTION_IDReturns the connection ID for the current connectionCONNECTION_ID()42
CURRENT_USERReturns the user name and host for the current connectionCURRENT_USER()'root'@'%'
LAST_QUERY_IDReturns the query ID of the last executed queryLAST_QUERY_ID()'01890a5d-ac96-7cc6-8128-01d71ab8b93e'

Database Context Functions

FunctionDescriptionExample
CURRENT_CATALOGReturns the name of the current catalogCURRENT_CATALOG()'default'
DATABASEReturns the name of the current databaseDATABASE()'default'

System Information Functions

FunctionDescriptionExample
VERSIONReturns the current version of DatabendVERSION()'DatabendQuery v1.2.252-nightly-193ed56304'
开始使用 Databend Cloud
低成本
快速分析
多种数据源
弹性扩展
注册