Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

T-SQL enhancements – PB Docs 2019 – PowerBuilder Library

T-SQL enhancements – PB Docs 2019

T-SQL enhancements

MERGE statement

The MERGE Transact-SQL statement performs INSERT, UPDATE, or
DELETE operations on a target table or view based on the results of a
join with a source table. You can use MERGE statement in the ISQL
painter and in PowerScript using dynamic SQL. For example

Using the MERGE statement in ISQL

A MERGE statement must be terminated by a semicolon. By default
the ISQL painter uses a semicolon as a SQL terminating character, so
to use a MERGE statement in ISQL, the terminating character must be
changed to a colon (:), a forward slash (/), or some other special
character.

Grouping sets

GROUPING SETS is an extension of the GROUP BY clause that lets you
define multiple groupings in the same query. GROUPING SETS produce a
single result set, making aggregate querying and reporting easier and
faster. It is equivalent to a UNION ALL operation for differently
grouped rows.

The GROUPING SETS, ROLLUP, and CUBE operators are added to the
GROUP BY clause. A new function, GROUPING_ID, returns more
grouping-level information than the existing GROUPING function. (The
WITH ROLLUP, WITH CUBE, and ALL syntax is not ISO compliant and is
therefore obsolete.)

The following example uses the GROUPING SETS operator and the
GROUPING_ID function:

You can use the GROUPING SETS operator in the ISQL painter, in
PowerScript (embedded SQL and dynamic SQL) and in DataWindow objects
(syntax mode).

Row constructors

Transact-SQL now allows multiple value inserts within a single
INSERT statement. You can use the enhanced INSERT statement in the ISQL
painter and in PowerScript (embedded SQL and dynamic SQL). For
example:

When including multiple values in a single INSERT statement with
host variables, you must set the DisableBind DBParm to 1. If you use
literal values as in the above example, you can insert multiple rows in
a single INSERT statement regardless of the binding setting.

Compatibility level

In SQL Server 2008, the ALTER DATABASE statement allows you to set
the database compatibility level (SQL Server version), replacing the
sp_dbcmptlevel procedure. You can use this syntax in the ISQL painter
and in PowerScript (dynamic SQL). For example:

Compatibility level affects behaviors for the specified database
only, not for the entire database server. It provides only partial
backward compatibility with earlier versions of SQL Server. You can use
the database compatibility level as an interim migration aid to work
around differences in the behaviors of different versions of the
database.

Table hints

The FORCESEEK table hint overrides the default behavior of the
query optimizer. It provides advanced performance tuning options,
instructing the query optimizer to use an index seek operation as the
only access path to the data in the table or view that is referenced by
the query. You can use the FORCESEEK table hint in the ISQL painter, in
PowerScript (embedded SQL and dynamic SQL), and in DataWindow objects
(syntax mode).

For example:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x