pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: mjoseph@inautix.com
To: pgsql-odbc@postgresql.org
Subject: psqlodbc : SOS
Date: Thu, 6 Feb 2003 09:43:23 +0530
Message-ID: <OF5E441530.1CBB5C24-ON65256CC5.00172A31@LocalDomain> (raw)

Hi,

I am using the psqlodbc ODBC driver. I have a few problems. I was wondering
if you could help.

I am using Visual C++ to develop my app. I need to access a byte array
(bytea) field.
1. I use the Windows ODBC api to insert the byte array ( a photograph). I
do multiple SQLPutData() calls. This application works fine with Access.
But with PostgreSQL, it fails. A number gets inserted instead (5 bytes).

2. I tried using MFC's ODBC support. In the CRecordSet's
DoFieldExchange(CFieldExchange* pFX) method, I setup the binding as below.

RFX_Binary(pFX, _T("[data]"), m_data, 100*1024);

100K I assume is the upper limit of the field. THis works on Access but not
for PostgreSQL. The default limit of 255 is not overridden.

If any of these are known issues, could you let me know. If you have any
ideas as to how I can set this right, please get back to me.

3. The psqlodbc  faq when discussing Large Objects suggests creating a new
type like this.
create type lo (
   internallength=4,
   externallength=10,
   input=int4in,
   output=int4out,
   default='',
   passedbyvalue
);

How should I define the input and output functions. Would you be able to
pass on some sample code?
Regards,
Manoj






view thread (3+ messages)  latest in thread

Message-ID: <OF5E441530.1CBB5C24-ON65256CC5.00172A31@LocalDomain>
Permalink:  ../OF5E441530.1CBB5C24-ON65256CC5.00172A31@LocalDomain/
Also on:    postgresql.org/message-id/OF5E441530.1CBB5C24-ON65256CC5.00172A31@LocalDomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: mjoseph@inautix.com
  Subject: Re: psqlodbc : SOS
  In-Reply-To: <OF5E441530.1CBB5C24-ON65256CC5.00172A31@LocalDomain>
  References: <OF5E441530.1CBB5C24-ON65256CC5.00172A31@LocalDomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox