SQL Programming Manual for TAL
NonStop SQL Statements and Directives
HP NonStop SQL Programming Manual for TAL—527887-001
3-17
DROP
The size depends on the expected size and number of columns in the SELECT
statement. This example uses the arbitrary values 5 and 39; you can use different
values, or you can declare a template and dynamically allocate the memory.
! Global declarations
EXEC SQL INCLUDE SQLDA (sqlda1, 5, namebuf, 39);
EXEC SQL BEGIN DECLARE SECTION;
STRING intext [0:200];
EXEC SQL END DECLARE SECTION;
...
EXEC SQL
PREPARE dynstatement FROM :intext;
EXEC SQL
DESCRIBE dynstatement INTO :sqlda1
NAMES INTO :namebuf;
...
DROP
The DROP statement deletes a catalog, constraint, index, program, table, or view. To
drop an object, a program's process accessor ID (PAID) must have read and write
access to all catalogs that describe the objects affected by the drop. For specific SQL
objects, a program's PAID must have access as follows:
Examples
In this example, the statements drop an index for the PARTS table before dropping the
table. The last statement drops a program.
EXEC SQL
DROP INDEX $vol1.sales.xpartdes;
EXEC SQL
DROP TABLE $vol1.sales.parts;
EXEC SQL
DROP PROGRAM $vol3.subvol3.proga;
Table, view, or program Purge access
Index or constraint Must be the local or remote owner of the underlying table
with purge access (or the local super ID user)
Catalog Read and purge access for the catalog tables
SQL.CATALOGS Read and write access