Unix Technical Forum

SQLCODE when using psqlODBC with libODBC++

This is a discussion on SQLCODE when using psqlODBC with libODBC++ within the pgsql Interfaces odbc forums, part of the PostgreSQL category; --> I am using PostgreSQL version 8 with psqlODBC as the ODBC driver. I am writing programs in C++ and ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces odbc

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2008, 02:59 AM
Jonathan Blitz
 
Posts: n/a
Default SQLCODE when using psqlODBC with libODBC++

I am using PostgreSQL version 8 with psqlODBC as the ODBC driver.



I am writing programs in C++ and using libODBC++ for the C++ interface.



Everything works great except:

When I get an SQL error it returns SQLCODE of 7 and SQLSTATE of “HY000”
every time.

The only correct value is the SQLERRM.



I am probably doing something stupid but I couldn’t find anything anywhere
about it.



Jonathan Blitz




--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.6/340 - Release Date: 05/15/2006


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-16-2008, 02:59 AM
Ludek Finstrle
 
Posts: n/a
Default Re: SQLCODE when using psqlODBC with libODBC++

> I am using PostgreSQL version 8 with psqlODBC as the ODBC driver.

You specify no psqlODBC version. Older versions have this bad behaviour.
So if I use my crystal ball I see there only upgrade advice.

> Everything works great except:
>
> When I get an SQL error it returns SQLCODE of 7 and SQLSTATE of “HY000â€
> every time.


Regards,

Luf

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-16-2008, 02:59 AM
Jonathan Blitz
 
Posts: n/a
Default Re: SQLCODE when using psqlODBC with libODBC++

>
> You specify no psqlODBC version. Older versions have this bad behaviour.
> So if I use my crystal ball I see there only upgrade advice.


I am using version 0.2.4pre3. Dated Sept 2005.
I downloaded it from sourceforg.net

Is there a newer version?

Jonathan

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.6.1/343 - Release Date: 05/18/2006



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-16-2008, 02:59 AM
Ludek Finstrle
 
Posts: n/a
Default Re: SQLCODE when using psqlODBC with libODBC++

Fri, May 19, 2006 at 12:23:59PM +0200, Jonathan Blitz napsal(a):
> > You specify no psqlODBC version. Older versions have this bad behaviour.
> > So if I use my crystal ball I see there only upgrade advice.

>
> I am using version 0.2.4pre3. Dated Sept 2005.
> I downloaded it from sourceforg.net
>
> Is there a newer version?


From where? This list is for psqlodbc from pgfoundry.org. The latest
version is 08.02.0002.
Are we talking both about psqlodbc? Could you send the URL for sf.net
project (I try to locate it with no success)?

Please try the newest psqlodbc from pgfoundry.org.

Regards,

Luf

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-16-2008, 02:59 AM
Jonathan Blitz
 
Posts: n/a
Default Re: SQLCODE when using psqlODBC with libODBC++



> -----Original Message-----
> From: Ludek Finstrle [mailto:luf@pzkagis.cz]
> Sent: Friday, May 19, 2006 1:20 PM
> To: Jonathan Blitz
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] SQLCODE when using psqlODBC with libODBC++
>
> Fri, May 19, 2006 at 12:23:59PM +0200, Jonathan Blitz napsal(a):
> > > You specify no psqlODBC version. Older versions have this bad

behaviour.
> > > So if I use my crystal ball I see there only upgrade advice.

> >
> > I am using version 0.2.4pre3. Dated Sept 2005.
> > I downloaded it from sourceforg.net
> >
> > Is there a newer version?

>
> >From where? This list is for psqlodbc from pgfoundry.org. The latest

> version is 08.02.0002.
> Are we talking both about psqlodbc? Could you send the URL for sf.net
> project (I try to locate it with no success)?
>
> Please try the newest psqlodbc from pgfoundry.org.
>
> Regards,
>
> Luf
>


Oops.
I am totally confused. I thought u asked for the version of libODBC++.

I am now totally lost.
I am new to accessing PostgreSQL from C++.

I already had PostgreSQL installed with the ODBC driver since I use it for
another program (Poker Tracker).

I wanted to write a C++ program to access the same database so I used
libODBC++ to issue the commands from within C++.

I am probably doing something wrong.

When I look at the ODBC connection for the database I see that I have a
choice of 3 drivers:

PostgreSQL - version 8.02.00.02
PostgreSQL ANSI - version 8.01.02.00
PostgreSQL Unicode - version 8.01.02.00

The first one is the one selected.

Jonathan

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.6.1/343 - Release Date: 05/18/2006



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:53 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com