NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
L-41
Examples—LOAD
Examples—LOAD
Suppose the ODETAIL table on subvolume $VOL1.SALES is empty, and you want
to load it with data from an Enscribe file named OBASE that resides on subvolume
$VOL2.SALES. You also want to specify the following requirements for the load
operation:
°
The source file is unsorted; a temporary scratch file named
$SPOOL.SCR.TEMP is to be used during the sorting phase of the operation.
°
The source file is described by a DDL RECORD definition named OFORMAT.
This RECORD entry is located in a DDL dictionary on the $VOL2.SALES.
°
Each field in the DDL RECORD definition is to be mapped to a column of the
same name in the target table.
The following command performs the specified LOAD:
>> LOAD $VOL2.SALES.OBASE,$VOL1.SALES.ODETAIL
+> SCRATCH $SPOOL.SCR.TEMP
+> SOURCEDICT $VOL2.SALES
+> SOURCEREC OFORMAT
+> MOVEBYNAME;
LOCK TABLE Statement
LOCK TABLE is a DCL statement that locks a whole table (or the underlying tables of
a view) and its indexes, limiting other accesses to the table and its indexes while you or
your program execute DML statements.
name
is the name (or an equivalent DEFINE) of a table or view to lock.
SHARE or EXCLUSIVE
specifies the locking mode, as follows:
If you request a SHARE lock on a table locked with an EXCLUSIVE lock by
another user, your request waits until the EXCLUSIVE lock is released.
LOCK TABLE { name } IN { SHARE } MODE
{ EXCLUSIVE }
SHARE Others can read, but not delete, insert, or update the table or view.
EXCLUSIVE Others can read with BROWSE access, but cannot read with STABLE
or REPEATABLE access and cannot delete, insert, or update.