Also sprach "Rui Domingos" <rui.domingos@psidoc.pt> :
:Can anyone give an exmple on using the SQLBreak function using ESQL/C?
You'll typically use sqlbreak() in a signal catching routine, so when the user
hits the interrupt key, the signal is caught and sqlbreak() is used to send the
appropriate interrupt to the server. You also want to use sqldone() to verify
that the server is currently in the midst of some processing on your behalf,
else there is no reason to send an sqlbreak() in the first place.
Here's a sample (adopted from the latest ESQL/C training manual):
void catch_alrm(int sig)
{
if (sqldone() == -439)
//Database server is currently processing an SQL task.
{
sqlbreak();
}
}
main()
{
signal(SIGINT, catch_alrm);
// rest of program
}
Dave
Dave (posting from home, speaking as a representative of nobody but himself)
**********
"Everybody plays the fool, sometimes."