TDINFUDT

Description

Retrieves information about the client-defined datatype for a column.

Syntax

COPY SYGWCOB.
01 TDPROC        PIC S9(9)  USAGE COMP SYNC.
01 RETCODE       PIC S9(9)  USAGE COMP SYNC.
01 COLUMN-NUMBER PIC S9(9)  USAGE COMP SYNC.
01 USER-DATATYPE PIC S9(9)  USAGE COMP SYNC.
CALL 'TDINFUDT' USING TDPROC, RETCODE, COLUMN-NUMBER,
                USER-DATATYPE.

Parameters

TDPROC

(I) Handle for this client/server connection. This must be the same value specified in the associated TDACCEPT call. The TDPROC handle corresponds to the connection and command handles in Open Client Client-Library.

RETCODE

(O) Variable where the result of function execution is returned. Its value is one of the codes listed in Table 3-21.

COLUMN-NUMBER

(I) Number of the column with the datatype that is being queried. Columns are numbered sequentially; the first column in a row is number 1.

USER-DATATYPE

(O) Variable where the user-defined datatype is returned. This can be any datatype assigned to the column by a client.

Returns

The RETCODE argument can contain any of the return values listed in Table 3-21.

Table 3-21: TDINFUDT return values

Return value

Meaning

TDS-OK (0)

Function completed successfully.

TDS-ENTRY-NOT-FOUND (-8)

The specified column number, transaction number, or parameter does not exist.

TDS-INVALID-PARAMETER (-4)

Invalid parameter value. The value assigned to one or more of the arguments supplied in the call is not valid. The operation failed.

TDS-INVALID-TDPROC (-18)

Error in specifying a value for the TDPROC argument.

Examples

Example 1

The following code fragment illustrates a typical use of TDINFUDT. This example is taken from the sample program, SYCCSAR2, in Appendix B, “Sample RPC Application for CICS.”

* 	 Here we let TDESCRIB convert from DB2 varchar (TDSVARYCHAR)
* 	 to DBCHAR.
 
      CALL 'SYGETAD' USING DB-DESCRIBE-HV-PTR, EMPLOYEE-ED.
      CALL 'SYGETAD' USING DB-COLUMN-NAME-HV-PTR, CN-ED.
      MOVE LENGTH OF EMPLOYEE-ED TO WRKLEN1.
      MOVE LENGTH OF CN-ED       TO WRKLEN2.
      MOVE TDSINT2               TO DB-HOST-TYPE.
      MOVE TDSINT2               TO DB-CLIENT-TYPE.
      PERFORM DESCRIBE-COLUMN.

 *    Get the user defined datatype of EMPLOYEE-ED column.
 
      CALL 'TDINFUDT' USING GWL-PROC, GWL-RC, CTR-COLUMN,
                            GWL-INFUDT-USER-TYPE.
 
 *    Set the user defined datatype of EMPLOYEE-ED column.
 
      CALL 'TDSETUDT' USING GWL-PROC, GWL-RC, CTR-COLUMN,
                            GWL-INFUDT-USER-TYPE.

*-----------------------------------------------------------------
  DESCRIBE-COLUMN.
*-----------------------------------------------------------------
      SET ADDRESS OF LK-DESCRIBE-HV    TO DB-DESCRIBE-HV-PTR.
      SET ADDRESS OF LK-COLUMN-NAME-HV TO DB-COLUMN-NAME-HV-PTR.
      ADD 1                            TO CTR-COLUMN.
 
      CALL 'TDESCRIB' USING GWL-PROC, GWL-RC, CTR-COLUMN,
                            DB-HOST-TYPE, WRKLEN1, LK-DESCRIBE-HV,
                            DB-NULL-INDICATOR, TDS-FALSE,
                            DB-CLIENT-TYPE, WRKLEN1,
                            LK-COLUMN-NAME-HV, WRKLEN2.

Usage

See also

Related functions