人大金仓CKA04到07
04-命令行工具KSQL
\c 切换
环境变量
export KINGBASE_HOST=x.x.x.x
export KINGBASE_PORT=54321
export KINGBASE_DATABASE=test
export KINGBASE_USER=system
当前会话信息
SELECT inet_client_addr(),inet_client_port(),inet_server_addr(),inet_server_port(),current_database(),current_user;
表、视图、序列、索引
\d[S+] NAME describe table, view, sequence, or index
group已弃用
\s
\s [FILE] display history or save it to file
\?
General
\copyright show Kingbase usage and distribution terms
\crosstabview [COLUMNS] execute query and display results in crosstab
\errverbose show most recent error message at maximum verbosity
\g [FILE] or ; execute query (and send results to file or |pipe)
\gdesc describe result of query, without executing it
\gexec execute query, then execute each value in its result
\gset [PREFIX] execute query and store results in ksql variables
\gx [FILE] as \g, but forces expanded output mode
\q quit ksql
\watch [SEC] execute query every SEC seconds
Help
\? [commands] show help on backslash commands
\? options show help on ksql command-line options
\? variables show help on special variables
\h [NAME] help on syntax of SQL commands, * for all commands
Query Buffer
\e [FILE] [LINE] edit the query buffer (or file) with external editor
\ef [FUNCNAME [LINE]] edit function definition with external editor
\ev [VIEWNAME [LINE]] edit view definition with external editor
\p show the contents of the query buffer
\r reset (clear) the query buffer
\s [FILE] display history or save it to file
\w FILE write query buffer to file
Input/Output
\copy ... perform SQL COPY with data stream to the client host
\echo [STRING] write string to s