Subject Re: [ib-support] parms in sql statements, NOT stored procedures
Author Lee Catlett
Thanks for the reply Doug, but I have literally dozens of these kinds of
select statements in the MSSQL application that work just fine, and there are
actually NO typo, which is unsual in itself. In the apps, there is the usuall
code like:

with qryOrder do begin
Close;
// Change parms for AdoQueries here to retrieve users orders
Parameters.ParamByName('ORDERID').Value:= lit('OrderID');
Parameters.ParamByName('USERID').Value:= sLoginID;
Open;
etc,etc,,,,

and here, ORDERID and USERID relate to the firstID and secondID in my initial
email.. Actually here is the query from my app that is changed in the above
code to whatever...

SELECT * FROM ORDERS WHERE ORDERID=:ORDERID
AND USERID=:USERID

and this works great in MSSQL, but not in an IB query. If there was confusion
earlier, hope this clear up my question??

Lee


Doug Chamberlin wrote:

> At 3/7/2001 10:02 AM (Wednesday), Lee Catlett wrote:
> >Can someone enlighten this unenlightened rather new person to IB query
> >constructs. I'm trying to migrate an app fro SQL to IB and have dozens
> >of queries of the following nature:
> >
> >select *
> >from atable
> >where firstID =: firstID
> >and secondID =: secondID
> >
> >from a table like:
> >
> >firstID char(30)
> >secondID char(30)
> >etc.....
> >
> >with firstID being the only key. The error returned states that it
> >doesn't know what secondID is. Since they are both used as parms and
> >their values set in code, how do you do this in the IB world, if you can
> >at all. Thanks
>
> The error report you are seeing is not a general, fundamental error but is
> specific to the exact text you are setting in the SQL property. It also
> sounds like the error is related to your client code, not specific to
> Interbase.
>
> For example, from the above I can see that the "=: firstID" should be
> changed to "= :firstID" (remove the space after the colon). Could it be
> that you have been inconsistent with your typing?
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/