Defines the SQL Communications Area (SQLCA) in an Embedded SQL program.
exec sql include sqlca;
exec sql include SQLCA;
...
exec sql update t1 set c1 = 123 where c2 >
47;
if (sqlca.sqlcode == 0)
{
printf(“%d rows updated/n", sqlca.sqlerrd[2]);
}
else if (sqlca.sqlcode == 100)
{
printf("No rows matched the query\n");
} else {
printf("An error occured\n%s\n",
sqlca.sqlerrm.sqlerrmc);
}
The include sqlca statement can be used anywhere that host language declarations are allowed.
begin declare section