Thread: Bug in ODBC driver 08.00.0004 and stored procedure

Bug in ODBC driver 08.00.0004 and stored procedure

From
"Joost Kraaijeveld"
Date:
Hi all,

Attached is a little ODBC program that shows the bug. Running the program against a database with a stored procedure it
reportsan error calling SQLExecute:  

"SQLSTATE = HY010
Message: The cursor is open."

I think the cursor is open because the query is allready executed to get the data for SQLNumResultCols. Rerunning the
queryto get the data leads to this error. 

To reproduce the error you can use the following database and function (and/or adjust the code to represent your
database,user and password): 

CREATE DATABASE "TestDB"  WITH OWNER = postgres  ENCODING = 'SQL_ASCII';

CREATE OR REPLACE FUNCTION getobjectid()
  RETURNS text AS
'
    select((select(to_char(current_timestamp, \'yyyy-mm-dd-hh-mm-ss\'))) ||
(select(to_char((nextval(\'tsfraction\')),\'-FM000000MI\'))))as return; 
'
  LANGUAGE 'sql' VOLATILE;


Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl

Attachment

Re: Bug in ODBC driver 08.00.0004 and stored procedure

From
"Joost Kraaijeveld"
Date:
Hi Dave,

Attached are the patches I created for solving the problem.

Also attached a MinGW makefile that works and gives a working dll. I have given the autoconf stuff a look but that is
highermath to me. Something for the bright people amongs us. 

Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl

Attachment

Re: Bug in ODBC driver 08.00.0004 and stored procedure

From
"Dave Page"
Date:

> -----Original Message-----
> From: Joost Kraaijeveld [mailto:J.Kraaijeveld@Askesis.nl]
> Sent: 15 February 2005 18:20
> To: Dave Page
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] Bug in ODBC driver 08.00.0004 and stored procedure
>
> Hi Dave,
>
> Attached are the patches I created for solving the problem.

Thanks Joost - patches applied (I also modified SQLGetFunctions in
info.c to stop it reporting that SQLSetScrollOptions was implemented).

> Also attached a MinGW makefile that works and gives a working
> dll. I have given the autoconf stuff a look but that is
> higher math to me. Something for the bright people amongs us.

Err, it wasn't attached :-(. Perhaps Peter can look at detecting the
Windows DM as a valid alternative to iODBC/unixODBC though - he's the
resident autoconf guru :-)

Regards, Dave.

Re: Bug in ODBC driver 08.00.0004 and stored procedure

From
"Joost Kraaijeveld"
Date:
Hi Dave,

Dave Page schreef:
> Err, it wasn't attached :-(. Perhaps Peter can look at detecting the
> Windows DM as a valid alternative to iODBC/unixODBC though - he's the
> resident autoconf guru :-)
Sorry about that. New trial. Maybe the file can be used as a starting point for Peter.

Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl

Attachment

Re: Bug in ODBC driver 08.00.0004 and stored procedure

From
Peter Eisentraut
Date:
Joost Kraaijeveld wrote:
> > Err, it wasn't attached :-(. Perhaps Peter can look at detecting
> > the Windows DM as a valid alternative to iODBC/unixODBC though -
> > he's the resident autoconf guru :-)
>
> Sorry about that. New trial. Maybe the file can be used as a starting
> point for Peter.

Perhaps we can start by determining what is wrong with the current
setup.  What happens when you do configure; make; make install?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: Bug in ODBC driver 08.00.0004 and stored procedure

From
"Joost Kraaijeveld"
Date:
Hi Peter,

Attached the output of ./configure  (err.txt) and the config.log. configure tries to find SQLGetPrivateProfileString in
thewrong libraries: 

checking for SQLGetPrivateProfileString in -lodbcinst... no
checking for SQLGetPrivateProfileString in -liodbcinst... no
configure: error: no suitable ODBC driver manager found

Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl

Attachment

Re: Bug in ODBC driver 08.00.0004 and stored procedure

From
"Dave Page"
Date:

> -----Original Message-----
> From: Peter Eisentraut [mailto:peter_e@gmx.net]
> Sent: 24 February 2005 20:18
> To: Joost Kraaijeveld
> Cc: Dave Page; pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Bug in ODBC driver 08.00.0004 and stored procedure
>
> Joost Kraaijeveld wrote:
> > > Err, it wasn't attached :-(. Perhaps Peter can look at detecting
> > > the Windows DM as a valid alternative to iODBC/unixODBC though -
> > > he's the resident autoconf guru :-)
> >
> > Sorry about that. New trial. Maybe the file can be used as
> a starting
> > point for Peter.
>
> Perhaps we can start by determining what is wrong with the current
> setup.  What happens when you do configure; make; make install?

It complains because neither unixODBC or iODBC can be found. Windows has
it's own DM of course.

Regards, Dave.