Subject Re: Working with IB_Cursors and params = error
Author patrick_marten
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).
>
> --
> Best regards,
> Daniel Rail
> Senior Software Developer
> ACCRA Solutions Inc. (www.accra.ca)
> ACCRA Med Software Inc. (www.filopto.com)
>

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.