Pathmaker Programming Guide
Modifying a Server Skeleton or Service Skeleton
Advanced Pathmaker Programming Topics
067868 Tandem Computers Incorporated 9–51
Changing the Logic of Error Handling
The following excerpt lists the portion of the sql_advisory function that contains the
logic for SQL error handling. Again, the code shown here is reformatted for
reproduction in this manual.
You can disable this portion of the sql_advisory function or rewrite the code to handle
default error handling differently. This section of code also contains a message that
you can reformat if you wish. The message appears in bold:
.
.
.
/* Search the subsystem errors in the SQLCA for a file system
or other non-SQL error, or for an SQL error that we have
special text for. Non-SQL errors typically indicate the
root cause of the failure. */
for ( i = 0 ;
SQLCAGETINFOLIST ( sqlca, ss_items, 5,
(short *) &ss_info, (short) sizeof ss_info,
i, , (short) sizeof ss_info.param - 1 ) == 0 ;
++i )
{
if ( ss_info.suppress ) continue;
if ( ss_info.idchar != 'S' ) break;
e = ( ss_info.errcode >= 0 ? ss_info.errcode : -
ss_info.errcode );
for ( p = 0 ; e < advisory_phrase [ p].lowcode ||
e > advisory_phrase [ p].highcode ;
++p );
if ( advisory_phrase [ p ].template )
{
msgp += sprintf (msgp, "SQL error %hd, ", ss_info.errcode );
ss_info.param [ _max ( ss_info.paramlen, 0 ) ] = '\0';
msgp += sprintf (msgp, advisory_phrase [ p ].template,
ss_info.param );
break;
}
}