To help you develop DB2 applications for Windows 32-bit operating systems, the DB2 Personal Developer's Edition and DB2 Universal Developer's Edition products include:
These samples are supplied with the DB2 Software Developer's Kit for Windows 32-bit operating systems only.
To enable you to use more informative SQL object identifiers, DB2 Universal Database Version 6 increases the maximum length of table names, view names, summary table names, alias names and correlation names from 18 bytes to 128 bytes. The maximum length of column names has been increased from 18 bytes to 30 bytes. For more information on SQL object identifier lengths , refer to the SQL Reference .
In DB2 Universal Database Version 6, the maximum SQL statement size is 65 535 bytes. You can use longer statements to create more complex SQL statements in your applications. For more information on SQL statement sizes, refer to the SQL Reference .
Object-relational support in DB2 Universal Database Version 6 has been enhanced to enable you to make better use of row types. The following extensions to table and view hierarchies have been introduced. For more information on typed tables and row types, refer to the SQL Reference .
Instead of only representing reference types with the underlying type VARCHAR(16) FOR BIT DATA, you can now choose the underlying type from any supported data type. Use the CREATE TYPE statement to name the representation type used for references to the new structured type.
For more information on the CREATE TYPE statement, refer to the SQL Reference .
DB2 Version 6 makes it easier for you to define object views, also called typed views, on tables. You can use the UNCHECKED option in your CREATE VIEW statement to prevent DB2 from checking for a unique object identifier. This option is useful, for example, when you know that your data conforms to the uniqueness rule but it does not comply with the rules that allows DB2 to prove uniqueness.
You can create typed view hierarchies that range over multiple legacy tables, legacy views, or typed table hierarchies. To create a view covering multiple hierarchies, use the unchecked OID feature previously described in "Create Views Without Object Identifier (OID) Checks" and declare the view using one of the following techniques:
You can drop entire hierarchies of tables or views using the DROP TABLE HIERARCHY and DROP VIEW HIERARCHY statements, respectively.
DB2 Version 6 improves the security of your database for SELECT, UPDATE, or DELETE statements with an ONLY clause. To issue such a statement, a user requires SELECT privilege on the target table and all of its sub-tables. This restriction prevents a user who is authorized to access a table but not one of its subtables from discovering which rows in the table are rows of the subtable.
For example, a user who is authorized to access the EMPLOYEE table but not the MANAGER subtable should not be allowed to discover which employees are managers by executing the query (SELECT NAME FROM EMP) EXCEPT (SELECT NAME FROM ONLY(EMP)).
You can explicitly name the hierarchy table that implements a typed table using the HIERARCHY clause in the CREATE TABLE statement for the typed root table.
DB2 Version 6 extends support for TYPE predicates by supporting the use of the NOT keyword, as well as the optional phrase OF DYNAMIC TYPE.
You can attach check constraints to a typed table. The check constraint is enforced against any action that affects a row of the typed table, even if the action is initiated against a supertable or subtable of the typed table.
Stored procedures offer improved compatibility both with industry standards and with the DB2 family. When you write DB2 Universal Database Version 6 stored procedures, you can use the CREATE PROCEDURE statement to register the stored procedure in the database and define their behavior. To help you create and debug stored procedures on the AIX, OS/390, and Windows 32-bit operating systems, you can use the Stored Procedure Builder.
Some of the ways in which CREATE PROCEDURE allows you to control the behavior of your stored procedures include:
Host and AS/400 clients can invoke a stored procedure and retrieve multiple row result sets from the stored procedure on a DB2 Universal Database Version 6 server. For more information on writing stored procedures that return multiple result sets, refer to the Application Development Guide .
DB2 Universal Database Version 6 enables you to specify the privilege model used by a dynamic SQL application via the DYNAMICRULES bind option. If you bind an application using the DYNAMICRULES BIND option, any user with EXECUTE privilege on the package inherits the privileges of your authorization ID. To associate a different authorization ID with the package, you can use the OWNER BIND option.
For more information on dynamic SQL security options, refer to the BIND command in the Command Reference .
You can use C macros in a declaration within a declare section of a C/C++ application if you preprocess the source file with an external C preprocessor. For more information on C Macro Expansion , refer to the Application Development Guide .
DB2 Universal Database Version 6 supports the ability to scroll through a cursor using DB2 Call Level Interface (DB2 CLI), Open Database Connectivity (ODBC), Java Database Connectivity (JDBC), or Embedded SQL for Java (SQLJ):
The following table summarizes the two types of scrollable cursor support
provided by DB2 Universal Database Version 6:
Table 1. Scrollable Cursor Support
Cursor Type | Description | Application Support |
---|---|---|
static, read-only | cannot add, delete, or modify any values, and is not affected by other applications that access the same data as the cursor |
|
keyset-driven | can detect changes to the underlying data, and can use the cursor to make changes to the underlying data |
|
For more information on DB2 CLI and ODBC scrollable cursors , refer to the CLI Guide and Reference . For more information on JDBC scrollable cursors and SQLJ result set iterators , refer to the Application Development Guide .