T<strong>SQL</strong> CommandsThe optional WITH CHECK OPTION clause prevents an update through the view that makes the record inaccessible tothat view. It does this by checking the WITH clause in the SELECT statement. WITH CHECK OPTION binds to <strong>Caché</strong><strong>SQL</strong> using the default of CASCADE.4.1.9 DROP VIEWDeletes a view definition. You can delete a single view, or a comma-separated list of views. DROP VIEW ignores anonexistent view name and completes without error.4.2 Data Management Language (DML) Statements4.2.1 DELETEDeletes rows of data from a table. Both DELETE and DELETE FROM are supported. Most other options are supported,with the following exceptions:• FROM table hints• rowset functions• OPTION clause• join hints• only very simple theta joins are supported (the FROM table clause is transformed into nested subqueries)• primary table hintsThe following table_hints are parsed but ignored: FASTFIRSTROW, HOLDINDEX, INDEX(name), NOLOCK, PAGLOCK,READCOMMITTED, READPAST, READUNCOMMITTED, REPEATABLEREAD, ROWLOCK, SERIALIZABLE,SHARED, TABLOCK, TABLOCKX, UPDLOCK, XLOCK. Table hints can be optionally preceded by the WITH keyword,and, if WITH is specified, optionally enclosed in parentheses. A list of table hints can be separated by either commas orblank spaces.DELETE sets the @@ROWCOUNT system variable to the number of rows deleted, and the @@IDENTITY systemvariable to the IDENTITY value of the last row deleted.4.2.2 INSERTInserts rows of data into a table. All three MS<strong>SQL</strong> syntactic forms are supported:INSERT column VALUES list_of_valuesINSERT column SELECT select_statementINSERT column EXECUTE stored_procedureThe corresponding Sybase list_of_values and SELECT syntactic forms are supported. (Sybase does not use the VALUESkeyword.)Most options are supported, with the following exceptions:• rowset functions• DEFAULT VALUES20 <strong>Caché</strong> <strong>Transact</strong>-<strong>SQL</strong> (T<strong>SQL</strong>) <strong>Migration</strong> <strong>Guide</strong>
Data Management Language (DML) StatementsThe following table_hints are parsed but ignored: FASTFIRSTROW, HOLDINDEX, INDEX(name), NOLOCK, PAGLOCK,READCOMMITTED, READPAST, READUNCOMMITTED, REPEATABLEREAD, ROWLOCK, SERIALIZABLE,SHARED, TABLOCK, TABLOCKX, UPDLOCK, XLOCK. Table hints can be optionally preceded by the WITH keyword,and, if WITH is specified, optionally enclosed in parentheses. A list of table hints can be separated by either commas orblank spaces.INSERT sets the @@ROWCOUNT system variable to the number of rows inserted, and the @@IDENTITY systemvariable to the IDENTITY value of the last row inserted.4.2.3 UPDATEUpdates values of existing rows of data in a table. Most options are supported, with the following exceptions:• rowset• OPTION• only very simple theta joins are supported (the FROM table clause is transformed into nested subqueries)• table hintsUPDATE supports the use of a local variable on the left-hand-side of a SET clause. This local variable can be either insteadof a column name or in addition to a column name. The following example shows a SET to a column name, a SET to alocal variable, and a SET to both a column name and a local variable:UPDATE table SET x=3,@v=b,@c=Count=Count+1If a local variable is specified on the left-hand-side of a SET, the right-hand-side cannot be DEFAULT.The following table_hints are parsed but ignored: FASTFIRSTROW, HOLDINDEX, INDEX(name), NOLOCK, PAGLOCK,READCOMMITTED, READPAST, READUNCOMMITTED, REPEATABLEREAD, ROWLOCK, SERIALIZABLE,SHARED, TABLOCK, TABLOCKX, UPDLOCK, XLOCK. Table hints can be optionally preceded by the WITH keyword,and, if WITH is specified, optionally enclosed in parentheses. A list of table hints can be separated by either commas orblank spaces.UPDATE sets the @@ROWCOUNT system variable to the number of rows updated, and the @@IDENTITY systemvariable to the IDENTITY value of the last row updated.4.2.4 READTEXT, UDATETEXT, WRITETEXTREADTEXT returns stream data from a column of a table. It requires a valid text pointer value, which can be retrievedusing the TEXTPTR function.UPDATETEXT updates stream data from a column of a table. It requires a valid text pointer value, which can be retrievedusing the TEXTPTR function.WRITETEXT writes data to a stream column of a table. It requires a valid text pointer value, which can be retrieved usingthe TEXTPTR function.4.2.5 TRUNCATE TABLEDeletes all rows from the specified table. Supported to the extent that it is considered a synonym for DELETE FROM tablewith no WHERE clause. However, TRUNCATE TABLE does not reset the IDENTITY field counter.<strong>Caché</strong> <strong>Transact</strong>-<strong>SQL</strong> (T<strong>SQL</strong>) <strong>Migration</strong> <strong>Guide</strong> 21