38.1 Description
The adbsql command enables you to execute SQL statements interactively. You can enter an SQL statement from the standard input and then output the execution results to the standard output.
The adbsql command establishes a connection to the HADB server as an HADB client.
The adbsql command can execute the following SQL statements.
- Definition SQL
-
-
ALTER TABLE
-
ALTER USER
-
ALTER VIEW
-
CREATE AUDIT
-
CREATE INDEX
-
CREATE SCHEMA
-
CREATE TABLE
-
CREATE USER
-
CREATE VIEW
-
DROP AUDIT
-
DROP INDEX
-
DROP SCHEMA
-
DROP TABLE
-
DROP USER
-
DROP VIEW
-
GRANT
-
REVOKE
-
- Data manipulation SQL
-
-
DELETE
-
INSERT
-
SELECT
-
UPDATE
-
TRUNCATE TABLE
-
PURGE CHUNK
You can specify dynamic parameters in these SQL statements. For details, see 38.6 Operating method when dynamic parameters are specified in an SQL statement.
-
- Control SQL
-
-
COMMIT
-
ROLLBACK
-
You can also execute adbsql subcommands. The adbsql subcommands are used for operations such as disconnecting from HADB. For details about the adbsql subcommands, see 38.5 adbsql subcommands.
- Prerequisites for using the adbsql command
-
The adbsql command uses the client definition to connect to the HADB server. Therefore, you must set up an HADB client environment and specify environment variables. For details about setting up an HADB client environment and specifying environment variables, see Setting Up an Environment for an HADB Client (If the ODBC Driver and CLI Functions Are Used) in the HADB Application Development Guide.
To connect to the HADB server, you must use the authorization identifier of an HADB user with the CONNECT privilege.