NetBase SQL Shadowing Handbook

NetBase SQL User Exits
____________________________________________________________
ver A0195 QUEST Software, Inc. 3-27
default:
sprintf (msg+22, "CANNOT DISPLAY DATATYPE %d", ctype);
PRINT (msg, -strlen(msg), 0);
break;
}
} /* end uexit_print_data */
/* uexit_process_data */
/* */
/* Get the column information for the column number passed and */
/* print the data. The function returns FALSE if processing */
/* should stop. */
/* */
int uexit_process_data (sqlca_type sqlca, char *data, int *offset,
int col, int lengthUsed, int *haveVAR)
{
EXEC SQL BEGIN DECLARE SECTION;
char columnName[21];
int colNumber;
int clen;
short ctype;
short precision;
short scale;
EXEC SQL END DECLARE SECTION;
char msg[90];
colNumber = col;
EXEC SQL SELECT COLNAME, LENGTH, TYPECODE, PRECISION, SCALE
INTO :columnName, :clen, :ctype, :precision, :scale
FROM SYSTEM.COLUMN
WHERE COLNUM = :colNumber AND TABLENAME = :tableName;
if (sqlca.sqlcode == 100) {
sprintf(msg, "NO ROWS QUALIFIED - SELECT OF SYSTEM.COLUMN FOR %d",
col);
PRINT (msg, -(strlen(msg)), 0);
return FALSE;
}
else
if (sqlca.sqlcode < 0) {
sprintf (msg, "ERROR GETTING COLUMN INFORMATION FOR %d",col);
PRINT (msg, -(strlen(msg)), 0);
PRINT (msg, 0, 0);
do { /* Print the error */
EXEC SQL SQLEXPLAIN :SQLMsg;
PRINT (SQLMsg, -strlen(SQLMsg), 0);
} while (sqlca.sqlcode != 0);
return FALSE;
}
if (ctype == 3) { /* VARCHAR */
clen = lengthUsed;