Subject Re: Working with IB_Cursors and params = error
Author patrick_marten
Hi Marcin,

--- In IBObjects@yahoogroups.com, Marcin Bury <mbury@...> wrote:
>
> Patrick
>
> W dniu 16.12.2011 11:54, patrick_marten pisze:
> > Hi Daniel,
> >
> > --- In IBObjects@yahoogroups.com, Daniel Rail<daniel@> wrote:
> >>
> >> Hi,
> >>
> >> At December-15-11, 11:01 AM, patrick_marten wrote:
> >>
> >>> Is the bugtracker being used?
> >>
> >>> Just found out that someone has posted about an issue, which sounds
> >>> very similar. According to the poster, though, it was already the
> >>> case with previous releases i.e. before 28c, can't say for sure now.
> >>
> >>> However: there is even a samlpe attached. Haven't try it out yet though.
> >>
> >>> Maybe this will help already, otherwise I will try to describe the
> >>> cases I have, which is probably not easy since it works in other cases...
> >>
> >> Can you show the query that you are using in that particular
> >> IB_Cursor? Also, do you have a Prepare before the ParamByName? As I
> >> remember that Jason added code to Prepare the query, if it is not,
> >> when calling ParamByName.
> >>
> >> The error that you posted is generated by the server, not IBO(unless
> >> it is something added to the query by IBO).
> >
> > There is nothing special in the query in that cursor:
> >
> > CursorValues.SQL.Add('select ID, VALUE from MY_TABLE where (ID = :ID);');
> > CursorValues.ParamByName('ID').AsInteger := myIDParam;<- here the error occurs
> >
> > The cursor is not prepared.
> >
> > Just tried to call Cursor.Prepare prior to Cursor.ParamByName and the error occurs in Cursor.Prepare then.
>
> Try to remove the semicolon ';' from the end of the statement and then
> try to prepare...
>
> Marcin
>

Removing the semicolon ';' from the end of the statement did the trick! It's working now - with a Prepare prior to ParamByName and without it.

But it's different after jason's change, since the very same statement was working before.

Is it in general a bad idea to put a semicolon at the end of a statement?

However, that way I have one possible solution at least, thank you!

Best regards,
Patrick.