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 SERVER

Changes the definition of a foreign server.

2

ALTER TABLE

Change a base table's definition information.

3

ALTER USER

Change an HADB user's information.

4

ALTER VIEW

Re-create a viewed table.

5

CREATE AUDIT

Define audit targets.

6

CREATE FOREIGN TABLE

Define foreign tables.

7

CREATE INDEX

Define an index on a column in a base table.

8

CREATE SCHEMA

Define a schema.

9

CREATE SERVER

Define a foreign server.

10

CREATE TABLE

Define a base table.

11

CREATE USER

Create an HADB user.

12

CREATE VIEW

Define a viewed table.

13

DROP AUDIT

Delete the audit target definition.

14

DROP FOREIGN TABLE

Delete a foreign table.

15

DROP INDEX

Delete an index.

16

DROP SCHEMA

Delete a schema.

17

DROP SERVER

Delete foreign servers.

18

DROP TABLE

Delete a base table.

19

DROP USER

Delete an HADB user.

20

DROP VIEW

Delete a viewed table.

21

GRANT

Grant privileges to an HADB user.

22

REVOKE

Revoke privileges of an HADB user.

23

Data manipulation SQL

COPY

Output table search results to a file.

24

DELETE

Delete rows.

25

INSERT

Insert rows into a table.

26

PURGE CHUNK

Delete all the rows in a chunk.

27

SELECT

Retrieve data from a table.

28

TRUNCATE TABLE

Delete all the rows in a base table.

29

UPDATE

Update values in a row.

30

Control SQL

COMMIT

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

31

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 and COPY statements are called the retrieval SQL statement.

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