sqlbreak and ESQL-C
Posted in 2000
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
Hello, I am trying to use the sqlbreak() fkt. to interrupt an long sql-statement with Informix SE-Database. I defined a sqlbreakcallback() etc. like below. But it doesn't interrupt the SQL-Staement. I see the callback is called every second. And the sqlbreak() returned 0 as exit code. But nothing happens. No SQLCODE -213 like discribed in "fm", but why ? TIA Dirk /*--------------------------------------------------------------------------*/ void ListenBreak(int status) { // eine Callback-Routine zum Abbrechen einer langwierigen Abfrage fprintf(ferr, "ListenBreak %d ", status); if ( status==2 ) { int xCH=rkey(); // get keyboard input fprintf(ferr, "und rKey=%d ", xCH); if ( xCH==cESC ) { int xB=sqlbreak(); fprintf(ferr, "und sqlbreak=%d ", xB); } } fprintf(ferr, "\\n"); fflush(ferr); } /*--------------------------------------------------------------------------*/ ... sqlbreakcallback(1000, ListenBreak); ... $open... sqlbreakcallback(-1L, (void*)NULL); ... /*--------------------------------------------------------------------------*/
Hi, and the example programm "timeout.ec" does'nt work, too. TIA Dirk Dirk Niemeier schrieb: > Hello, > I am trying to use the sqlbreak() fkt. to interrupt an long > sql-statement with Informix SE-Database. > I defined a sqlbreakcallback() etc. like below. But it doesn't interrupt > the SQL-Staement. > I see the callback is called every second. And the sqlbreak() returned 0 > as exit code. But nothing happens. > No SQLCODE -213 like discribed in "fm", but why ? > > TIA > Dirk > > /*--------------------------------------------------------------------------*/ > > void ListenBreak(int status) > { // eine Callback-Routine zum Abbrechen einer langwierigen Abfrage > > fprintf(ferr, "ListenBreak %d ", status); > > if ( status==2 ) > { > int xCH=rkey(); // get keyboard input > > fprintf(ferr, "und rKey=%d ", xCH); > > if ( xCH==cESC ) > { > int xB=sqlbreak(); > > fprintf(ferr, "und sqlbreak=%d ", xB); > > } > } > > fprintf(ferr, "\\n"); > fflush(ferr); > > } > > /*--------------------------------------------------------------------------*/ > > ... > sqlbreakcallback(1000, ListenBreak); > ... > $open... > > sqlbreakcallback(-1L, (void*)NULL); > ... > /*--------------------------------------------------------------------------*/
Hi,
does anyone know about an other method to interrupt an current statement ?
Because in dbaccess and isql it works fine.
Dirk
Dirk Niemeier schrieb:
> Hello,
> I am trying to use the sqlbreak() fkt. to interrupt an long
> sql-statement with Informix SE-Database.
> I defined a sqlbreakcallback() etc. like below. But it doesn't interrupt
> the SQL-Staement.
> I see the callback is called every second. And the sqlbreak() returned 0
> as exit code. But nothing happens.
> No SQLCODE -213 like discribed in "fm", but why ?
>
> TIA
> Dirk
>
> /*--------------------------------------------------------------------------*/
>
> void ListenBreak(int status)
> { // eine Callback-Routine zum Abbrechen einer langwierigen Abfrage
>
> fprintf(ferr, "ListenBreak %d ", status);
>
> if ( status==2 )
> {
> int xCH=rkey(); // get keyboard input
>
> fprintf(ferr, "und rKey=%d ", xCH);
>
> if ( xCH==cESC )
> {
> int xB=sqlbreak();
>
> fprintf(ferr, "und sqlbreak=%d ", xB);
>
> }
> }
>
> fprintf(ferr, "\\n");
> fflush(ferr);
>
> }
>
> /*--------------------------------------------------------------------------*/
>
> ...
> sqlbreakcallback(1000, ListenBreak);
> ...
> $open...
>
> sqlbreakcallback(-1L, (void*)NULL);
> ...
> /*--------------------------------------------------------------------------*/