13.07.2015 Views

Caché Transact-SQL (TSQL) Migration Guide - InterSystems ...

Caché Transact-SQL (TSQL) Migration Guide - InterSystems ...

Caché Transact-SQL (TSQL) Migration Guide - InterSystems ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!