Hitachi

Hitachi Advanced Database SQL Reference


2.1 List of SQL statements

The following table lists the SQL statements supported by HADB.

Table 2‒1: List of SQL statements supported by HADB

No.

Classification

SQL statement supported by HADB

Description

1

Definition SQL

ALTER TABLE

Change a base table's definition information.

2

ALTER USER

Change an HADB user's information.

3

ALTER VIEW

Re-create a viewed table.

4

CREATE AUDIT

Define audit targets.

5

CREATE INDEX

Define an index on a column in a base table.

6

CREATE SCHEMA

Define a schema.

7

CREATE TABLE

Define a base table.

8

CREATE USER

Create an HADB user.

9

CREATE VIEW

Define a viewed table.

10

DROP AUDIT

Delete the audit target definition.

11

DROP INDEX

Delete an index.

12

DROP SCHEMA

Delete a schema.

13

DROP TABLE

Delete a base table.

14

DROP USER

Delete an HADB user.

15

DROP VIEW

Delete a viewed table.

16

GRANT

Grant privileges to an HADB user.

17

REVOKE

Revoke privileges of an HADB user.

18

Data manipulation SQL

DELETE

Delete rows.

19

INSERT

Insert rows into a table.

20

PURGE CHUNK

Delete all the rows in a chunk.

21

SELECT

Retrieve data from a table.

22

TRUNCATE TABLE

Delete all the rows in a base table.

23

UPDATE

Update values in a row.

24

Control SQL

COMMIT

Validate the database contents that were updated by a transaction, and terminate the transaction normally.

25

ROLLBACK

Invalidate the database contents that were updated by a transaction, and cancel the transaction.

Notes:

You can execute the above SQL statements from application programs or by using the adbsql command. However, control SQL statements (COMMIT and ROLLBACK) cannot be used in application programs.

  • If you are using the JDBC driver, use the commit method or rollback method in the Connection interface. For details about these methods, see the HADB Application Development Guide.

  • If you are using the ODBC driver, use the ODBC function SQLEndTran. For details about SQLEndTran, see the HADB Application Development Guide.

  • If you are using CLI functions, use a_rdb_SQLEndTran(). For details about a_rdb_SQLEndTran(), see the HADB Application Development Guide.

Note
  • The SELECT statement is also called the retrieval SQL statement.

  • The INSERT, UPDATE, DELETE, PURGE CHUNK, and TRUNCATE TABLE statements are generically called update SQL statements.