Re: ODBC Open cursors on views

From: Shachar Shemesh <psql(at)shemesh(dot)biz>
To: pgsql-odbc(at)postgresql(dot)org
Cc: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
Subject: Re: ODBC Open cursors on views
Date: 2003-08-20 11:25:46
Message-ID: 1061378746.3f435aba85fdb@latenight.fiasco.org.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Quoting Shachar Shemesh <psql(at)shemesh(dot)biz>:

> Quoting Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>:
>
> >
> >
> > Shachar Shemesh wrote:
> >
> > [snip]
> >
> > > If more than one table participates in the view, who's CTID do I
> need
> > to get? Is
> > > it enough to take one of the tables at random?
> >
> Hi,
>
> You said that static readonly cursors worked for you. I'm trying the
> following
> code, without success:
> UpdateData(TRUE);
> CString sql="select * from \"ACCOUNTLEDGER\"";
>
> try {
> if( m_crs==NULL ) {
> m_db.OpenEx(NULL);
> m_crs=new CRecordset( &m_db );
> }
>
> m_crs->Open(CRecordset::snapshot, sql, CRecordset::readOnly );
> RefreshData();
> } catch( CDBException *cdbexcept )
> {
> MessageBox( cdbexcept->m_strError, "SQL error", MB_ICONEXCLAMATION );
> }
>
> I get the same error (attribute "ctid" not found).
>
> Am I doing something wrong?
>
> Shachar
I found the source of the problem.

I'm using the CVS version. options.c, line 73, has the following:
else if (ci->updatable_cursors)
setval = SQL_CONCUR_ROWVER;
In other words, if updateable cursors are at all available, they will override
whatever I choose to use for concurrency settings.

Commenting out these two lines solve the problem for me. I can also disable
"Updateable cursors" in the ODBC settings, but that would mean that no cursor on
the database can be updateable at all, and that's not acceptable.

Shachar

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Hiroshi Inoue 2003-08-20 13:05:07 Re: ODBC Open cursors on views
Previous Message Andre Felipe Machado 2003-08-20 11:23:08 Re: large objects and pg 7.3.x