PostgreSQL

Скачать в pdf «PostgreSQL»


EXEC SQL DECLARE foo_bar CURSOR FOR SELECT number, ascii FROM foo ORDER BY ascii;


EXEC SQL FETCH foo_bar INTO :FooBar, DooDad;


EXEC SQL CLOSE foo_bar;


EXEC SQL COMMIT;


Updates:


EXEC SQL UPDATE foo SET ascii = ‘foobar’ WHERE number = 9999;


EXEC SQL COMMIT;


Notes


There is no EXEC SQL PREPARE statement.


The complete structure definition MUST be listed inside the declare section.


See the TODO file in the source for some more missing features.

D.50 end


Name


END — Commits the current transaction


end [ work i transaction ]


Inputs


WORK, TRANSACTION Optional keywords. They have no effect.


Outputs


COMMIT Message returned if the transaction is successfully committed.


NOTICE: COMMIT: no transaction in progress If there is no transaction in progress.


Description


END is a Postgres extension, and is a synonym for the SQL92-compatible COMMIT. Notes


The keywords WORK and TRANSACTION are noise and can be omitted.


Use ROLLBACK to abort a transaction.


Usage


To make all changes permanent:


END WORK;


Compatibility


SQL92


END is a PostgreSQL extension which provides functionality equivalent to COMMIT.

D.51 EXPLAIN


Name


EXPLAIN — Shows statement execution plan EXPLAIN [ VERBOSE ] query


Inputs


VERBOSE Flag to show detailed query plan, query Any query.


Outputs


NOTICE: QUERY PLAN: plan Explicit query plan from the Postgres backend.


EXPLAIN Flag sent after query plan is shown.

Скачать в pdf «PostgreSQL»