ODBC Server Reference Manual
Transact-SQL Language
HP NonStop ODBC Server Reference Manual—429151-002
4-97
Examples
Examples
The following example updates the salary of employee number 1002:
update test_disk01_persnl..employee
set salary = salary * 1.1
where empnum = 1002
NonStop ODBC Server Compared With SQL Server
When used through the NonStop ODBC Server, UPDATE differs from the SQL Server
implementation in the following ways:
FROM Clause
In programs used with the NonStop ODBC Server, you cannot specify the SQL Server
FROM clause with the UPDATE statement. You can, however, sometimes achieve the
same results by using a subquery.
The following UPDATE statement is used with the NonStop ODBC Server. It updates
the salaries of all employees working for the manager whose ID number is 1001. The
statement uses a subquery to select all departments for manager is number 1001:
update employee
set salary = salary * 1.1
where deptnum in
(select deptnum from dept where manager = 1001)
In SQL Server, you could execute the previous statement by using a FROM clause:
update persnl.employee
set salary = salary * 1.1
from dept
where employee.deptnum = dept.deptnum
and dept.manager = 1001
Feature In SQL Server
In Programs Used With the NonStop
ODBC Server
FROM clause available? Yes No; if you use it, the NonStop ODBC
Server generates an error message.
See FROM Clause
on page 4-64.
Locking mode used Exclusive The NonStop SQL/MP REPEATABLE
ACCESS mode, which is functionally
similar to the SQL Server default of
exclusive mode.
Are aggregate functions
allowed in the expression?
Yes No