The CURRENT DATE special register specifies a date that is based on a reading of the time-of-day clock when the SQL statement is executed at the application server. If this special register is used more than once within a single SQL statement, or used with CURRENT TIME or CURRENT TIMESTAMP within a single statement, all values are based on a single clock reading.
In a federated system, CURRENT DATE can be used in a query intended for data sources. When the query is processed, the date returned will be obtained from the CURRENT DATE register at the federated server, not from the data sources.
Using the PROJECT table, set the project end date (PRENDATE) of the MA2111 project (PROJNO) to the current date.
UPDATE PROJECT SET PRENDATE = CURRENT DATE WHERE PROJNO = 'MA2111'
The CURRENT DEFAULT TRANSFORM GROUP special register specifies a VARCHAR (18) value that identifies the name of the transform group used by dynamic SQL statements for exchanging user-defined structured type values with host programs. This special register does not specify the transform groups used in static SQL statements or in the exchange of parameters and results with external functions of methods.
Its value can be set by the SET CURRENT DEFAULT TRANSFORM GROUP statement. If no value is set, the initial value of the special register is the empty string (a VARCHAR with a zero length).
In a dynamic SQL statement (that is, one which interacts with host variables), the name of the transform group used for exchanging values is the same as the value of this special register, unless this register contains the empty string. If the register contains the empty string (no value was set by using a SET CURRENT DEFAULT TRANSFORM GROUP statement), the DB2_PROGRAM transform group is used for the transform. If the DB2_PROGRAM transform group is not defined for the structured type subject, an error is raised at run time (SQLSTATE 42741).
Set the default transform group to MYSTRUCT1. The TO SQL and FROM SQL functions defined in the MYSTRUCT1 transform are used to exchange user-defined structured type variables with the host program.
SET CURRENT DEFAULT TRANSFORM GROUP = MYSTRUCT1
Retrieve the name of the default transform group assigned to this special register.
VALUES (CURRENT DEFAULT TRANSFORM GROUP)