It works for me on Windows as well. The problem occurred only on unix.
ODBC Driver doesn't read data to the buffer yet according the driver trace:

Thu Dec  5 10:07:43 2002
Entering SQLPrepare()
hstmt: 4049b018
StatementText: select count(*) from amount where amount > 1200
TextLength: 47

Thu Dec  5 10:07:43 2002
Returning from SQLPrepare()
Retcode = SQL_SUCCESS

Thu Dec  5 10:07:43 2002
Entering SQLExecute()
hstmt: 4049b018

Execute doesn't finished yet. Also I checked on the server, query is in
'execute' mode.
Any ideas?

Vassiliy


Jeff Urlwin wrote:

> >
> > Hello everybody.
> >
> > I call SQLCancel function to cancel my query and got an error:
> > DBD: no statement executing err=-1.
> > It looks like statement is not defined in
> > DBIc_ACTIVE(imp_sth). I run it on osf1 unix 4, DBI 1.31,
> > DBD::ODBC 0.45_18. I use SDK iODBC driver manager version 3.
>
> I'm not getting that error on Windows, using DBI 1.30.  Which ODBC
> driver are you using?  It may be that the driver isn't returning any
> rows for the query or only returning one row since it's a count() query
> and the "driver" has already read that row into a buffer and "finished"
> the execution.  Can you try it with a query that will return multiple
> rows (> than the number of rows being buffered)?
>
> Jeff
>
> >
> > The trace is following:
> >
> >     -> prepare for DBD::ODBC::db
> > (DBI::db=HASH(0x140087e68)~0x140087dd8
> > 'select count(*) from amount where amount > 1200' HASH(0x1402f6b60))
> >     New DBI::st (for DBD::ODBC::st, parent=DBI::db=HASH(0x140087dd8),
> > id=)
> >
> > dbih_setup_handle(DBI::st=HASH(0x140087e58)=>DBI::st=HASH(0x14
> > 0089508),
> > DBD::ODBC::st, 140087e78, Null!)
> >     dbih_make_com(DBI::db=HASH(0x140087dd8), DBD::ODBC::st, 368) thr#0
> >     dbih_setup_attrib(DBI::st=HASH(0x140089508), Err,
> > DBI::db=HASH(0x140087dd8)) SCALAR(0x14022f240) (already defined)
> >     dbih_setup_attrib(DBI::st=HASH(0x140089508), State,
> > DBI::db=HASH(0x140087dd8)) SCALAR(0x14022f1e0) (already defined)
> >     dbih_setup_attrib(DBI::st=HASH(0x140089508), Errstr,
> > DBI::db=HASH(0x140087dd8)) SCALAR(0x14022f210) (already defined)
> >     dbih_setup_attrib(DBI::st=HASH(0x140089508), Debug,
> > DBI::db=HASH(0x140087dd8)) 0 (already defined)
> >     dbih_setup_attrib(DBI::st=HASH(0x140089508), FetchHashKeyName,
> > DBI::db=HASH(0x140087dd8)) 'NAME' (already defined)
> >     dbih_setup_attrib(DBI::st=HASH(0x140089508), HandleError,
> > DBI::db=HASH(0x140087dd8)) undef (not defined)
> >     <- prepare= DBI::st=HASH(0x140087e58) at psql_m.pl line
> > 1036 via psql_m.pl line 865
> >     -> execute for DBD::ODBC::st
> > (DBI::st=HASH(0x140087e58)~0x140089508)
> >
> > 1   -> cancel for DBD::ODBC::st
> > (DBI::st=HASH(0x140087e58)~0x140089508)
> >     !! ERROR: -1 '(DBD: no statement executing err=-1)'
> > 1   <- cancel= undef at psql_m.pl line 3540 via psql_m.pl line 1060
> >     -> $DBI::errstr (&) FETCH from lasth=HASH
> >     >> DBD::ODBC::st::errstr
> >     <- $DBI::errstr= '(DBD: no statement executing err=-1)'
> >     !! ERROR: -1 '(DBD: st_execute/SQLExecute err=-1)'
> >
> > Thanks in advance,
> > Vassiliy
> >
> >
> >

Reply via email to