|
QUESTION:
How do I pass a parameter to a SQL query?
ANSWER:
To pass a parameter to a SQL statement you need to do the following::
| 1. | Set the parameter you want to pass in your Delphi code. |
| RvProject1.SetParam('ParamName','YourValue'); |
| 2. | Set the QueryParam property of the Query Designer with something like: |
| SQLParam1=Param.ParamName |
| please note NO SPACES around equal sign |
| 3. | now build your SQL statement like the following: |
| if it is a numeric compare |
| Select * from table where Field=:SQLParam1 |
| if it is a string compare |
| Select * from table where Field=':SQLParam1' |
| please note NO SPACES around equal sign
|
|