SQL Statements
When running multiple sql statements as part of the same statement, it is possible that the execution is not as you might expect. For example:
create index i1 on t1 (a); update t1 set b = 5 where a = 6;
In the above instance, the index is created and the update is executed as part of the same statement. At the time that this update is compiled, the index will not yet exist and therefore will not be used.
Statement Reference
The supported SQL statements are:
-
ALTER FUNCTION
— change a user defined function -
ALTER PROCEDURE
— change a stored procedure -
ALTER SEQUENCE
— change the definition of a sequence generator -
ALTER TABLE
— change the definition of a table -
ALTER TRIGGER
— change the definition of a trigger -
ALTER USER
— change attributes of a NuoDB account -
ALTER VIEW
— change the definition of a view -
ANALYZE
— generate table and index statistics -
CALL
— execute a stored procedure -
COMMIT
— commit the current transaction -
CREATE FUNCTION
— create a user defined function -
CREATE INDEX
— define a new index -
CREATE JAVACLASS
— load a Java class for use in stored procedures -
CREATE PROCEDURE
— define a stored procedure -
CREATE ROLE
— define a new database role -
CREATE SCHEMA
— define a new schema -
CREATE SEQUENCE
— define a new sequence generator -
CREATE TABLE
— define a new table -
CREATE TRIGGER
— define a new trigger -
CREATE USER
— define a new database role -
CREATE VIEW
— define a new view -
DELETE
— delete rows of a table -
DROP FUNCTION
— remove a user defined function -
DROP INDEX
— remove an index -
DROP JAVACLASS
— unload a Java class -
DROP PROCEDURE
— remove a stored procedure or function from storage -
DROP ROLE
— remove a database role -
DROP SCHEMA
— remove a schema -
DROP SEQUENCE
— remove a sequence -
DROP TABLE
— remove a table -
DROP TRIGGER
— remove a trigger -
DROP USER
— remove a database user -
DROP VIEW
— remove a view -
EXECUTE
— execute a stored procedure -
EXPLAIN
— show the execution plan of a statement -
GRANT
— define access privileges -
INSERT
— create new rows in a table -
RELEASE SAVEPOINT
— destroy a previously defined savepoint -
RENAME TABLE
— rename a table -
REPLACE
— update or replace values in a table -
REVOKE
— remove access privileges -
ROLLBACK
— abort the current transaction -
SAVEPOINT
— define a new savepoint within the current transaction -
SELECT
— retrieve rows from a table or view -
START TRANSACTION
— start a transaction block -
TRUNCATE
— empty a table or set of tables -
UPDATE
— update rows of a table -
USE
— specify a schema
For SQL commands, see SQL Commands.