NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
D-78
Dynamic SQL
CATALOG clause specifies a catalog on \NEWSYS in which to describe the new
objects.
>> DUP $VOL1.INVENT.PARTLOC,
+> MAP NAME ( $VOL1.*.* TO \NEWSYS.$NVOL1.*.*,
+> $WHS2.*.* TO \NEWSYS.$NVOL2.*.*,
+> $WHS3.*.* TO \NEWSYS.$NVOL3.*.* )
+> CATALOG \NEWSYS.$NVOL.DB FOR \NEWSYS.*.*.* NO LISTALL;
The following command duplicates all tables, collations, and files, but no indexes or
views, that reside on subvolume $VOL1.PERSNL to subvolume $VOL1.NWPERS:
>> DUP $VOL1.PERSNL.*, *.NWPERS.*, INDEXES OFF, VIEWS OFF
+> NO LISTALL;
The PERSNL subvolume contains the EMPLOYEE, DEPT, and JOB tables and the
EMPLIST and MGRLIST views. The following commands duplicate all tables and
their indexes, but only the MGRLIST view:
>> DUP $VOL1.PERSNL.*, *.NWPERS.*, VIEWS OFF NO LISTALL;
>> DUP $VOL1.PERSNL.M*, $VOL1.NWPERS.*, VIEWS EXPLICIT
+> NO LISTALL;
If other files or tables on the PERSNL subvolume have names that also begin with
the letter M, you must provide a more specific source fileset list in the second
command: for example, $VOL1.PERSNL.MGRL* or $VOL1.PERSNL.MGRLIST.
Dynamic SQL
Dynamic SQL is a form of embedded SQL that allows you to build, compile, and
execute SQL DCL, DDL, and DML statements during program execution. You can use
dynamic SQL in programs that build SQL statements at execution time or that process
SQL statements entered by users or generated by applications on personal computers.
Two dynamic SQL statements, PREPARE and EXECUTE, can also be used outside
embedded SQL programs to eliminate the need to recompile SQL statements that you
execute multiple times in a single SQLCI session.
The following table summarizes dynamic SQL statements: