EasyManuals Logo

HP NonStop SQL/MP User Manual

HP NonStop SQL/MP
331 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #191 background imageLoading...
Page #191 background image
Error and Status Reporting
HP NonStop SQL/MP Programming Manual for C—429847-008
9-11
Using the WHENEVER Directive
int main(void)
{
/* Begin TMF transaction: */
EXEC SQL BEGIN WORK;
in_parts_rec.in_partnum = 4120;
in_parts_rec.in_price = 6000000;
strcpy (in_parts_rec.in_partdesc,"V8 DISK OPTION");
/* Blank pad in_partdesc. "V8 DISK OPTION" occupies */
/* positions 0 through 13; start blank padding at */
/* position 14: */
for (ix = 14; ix <
; ix++)
in_parts_rec.in_partdesc[ix] = ' ';
...
/* Do an SQL INSERT into the parts table: */
EXEC SQL
INSERT INTO =parts (partnum, price, partdesc)
VALUES ( :in_parts_rec.in_partnum,
SETSCALE (:in_parts_rec.in_price, 2),
:in_parts_rec.in_partdesc);
/* End TMF transaction: */
EXEC SQL COMMIT WORK;
}
void handle_errors(void)
{
SQLCADISPLAY( (short *) &sqlca);
exit(EXIT_FAILURE);
}
void handle_warnings(void)
{
warning_sum++;
SQLCADISPLAY( (short *)&sqlca,,,,'N','Y');
}
Example 9-3. Using the WHENEVER Directive (page 2 of 2)

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP NonStop SQL/MP and is the answer not in the manual?

HP NonStop SQL/MP Specifications

General IconGeneral
BrandHP
ModelNonStop SQL/MP
CategorySoftware
LanguageEnglish

Related product manuals