Subject | Re: [ib-support] parms in sql statements, NOT stored procedures |
---|---|
Author | Svein Erling Tysvær |
Post date | 2001-03-09T08:54:11Z |
Lee,
I regularly write queries almost identical to the one you have problems
with - only differences is a few extra spaces and naming the fields rather
than using *. I think your query should work just fine, at least is
SELECT * FROM ORDERS
WHERE ORDERID = :ORDERID
AND USERID = :USERID
100% valid in InterBase if the table ORDERS is in your database and has the
fields ORDERID and USERID specified. I use IBO, and there we have an option
to set ParamChar (or whatever it is called). Check that you haven't
specified something else than : as your ParamChar and that there's no
property claiming there to be no parameters.
If nothing works, tell us about your environment (IB version, Delphi/BCB
version, which components and versions you use) and anything that can give
us a clue as to what your problem really is (it isn't the SQL).
Set
At 11:42 07.03.2001 -0500, you wrote:
I regularly write queries almost identical to the one you have problems
with - only differences is a few extra spaces and naming the fields rather
than using *. I think your query should work just fine, at least is
SELECT * FROM ORDERS
WHERE ORDERID = :ORDERID
AND USERID = :USERID
100% valid in InterBase if the table ORDERS is in your database and has the
fields ORDERID and USERID specified. I use IBO, and there we have an option
to set ParamChar (or whatever it is called). Check that you haven't
specified something else than : as your ParamChar and that there's no
property claiming there to be no parameters.
If nothing works, tell us about your environment (IB version, Delphi/BCB
version, which components and versions you use) and anything that can give
us a clue as to what your problem really is (it isn't the SQL).
Set
At 11:42 07.03.2001 -0500, you wrote:
>Thanks for the reply Doug, but I have literally dozens of these kinds ofusuall
>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
>code like:confusion
>
>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
>earlier, hope this clear up my question??
>
>Lee