Re: pgsqODBC binding parameters II (fwd)

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: Ludek Finstrle <xfinstrl(at)informatics(dot)muni(dot)cz>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: pgsqODBC binding parameters II (fwd)
Date: 2001-03-22 10:19:28
Message-ID: 3AB9D1B0.F43DFEDE@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Ludek Finstrle wrote:
>
> > > > > > CONN ERROR: func=SQLExecute, desc='', errnum=110, errmsg='ERROR: parser: parse error at or near ""'
> > > > > > SQLExecute: premature statement so return SQL_ERROR
> > > >
> > > > PREMATURE state of the statement seems to be the cause of
> > > > the error. Is your change about data_at_exec to prevent the
> > > > PREMATURE state just after the return from SQLNumResultCols ?
> > > > Or does it have another purpose ?
> > >
> > > Sorry, I don't understand question very well.
> > > I make it in december. So I don't remember details.
> > >
> > > The problem was that '?' didn't be detect as parametr at exec.
> > > So I added detection of parameters at exec to SQLExecute. And if I detect
> > > it I return SQL_NEED_DATA.
> > >
> >
> > '?' doesn't necessarily mean a data_at_execution parameter.
>
> I use SQLNumParams for this detection. So I mean that it's safe.
>
> > Doesn't your patch change all parameters to data_at_exec ones ?
> > If so it doesn't seem good.
>
> Yes, it does. Any idea how recognize data_at_exec parameters?
>

I see the following in your log.

> SQLBindParameter: entering...
> SQLBindParamater: ipar=0, paramType=1, fCType=-16, fSqlType=4,
cbColDef=10, ibScale=0, rgbValue=1, *pcbValue = -2, data_at_exec = 0

'*pcbValue = -2' seems to mean SQL_DATA_AT_EXEC.

BTW I see the following in your patch.
Isn't SQL_NTSL -3L ?
If so what does 'malloc(cbValue + 1)' mean ?

> - }
> - else {
> + /* Luf Begin */
> + } else if (cbValue == SQL_NTSL) {
> + /* Luf End */
> current_param->EXEC_buffer =
malloc(cbValue + 1);

regards,
Hiroshi Inoue

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Larry Rosenman 2001-03-22 13:06:20 Re: odbc/UnixWare 7.1.1: No Go.
Previous Message Ludek Finstrle 2001-03-22 08:46:06 Re: pgsqODBC binding parameters II (fwd)