How to pass a variable into a SQL Statement Command is Data Environment

How to pass a variable into a SQL Statement Command is Data Environment

Post by Patrick Hil » Sat, 10 Jun 2000 04:00:00

Hello I have a command in a data environment that excutes a SQL statement it
now looks like this:
SELECT ToyOrders.* FROM ToyOrders WHERE (`Order ID` = 1)

Now here is what I want to do I want to be able to pass a variable into this
instead of the number.
Public FindorderNumber as Integer
I would like to pass FindOrderNumber (Which is declared in the general
declarations section of the form)
into this SQL statement instead of having to hard code a particular number I
guess like so but this does not work

SELECT ToyOrders.* FROM ToyOrders WHERE (`Order ID` = FindOrderNumber)
Does anyone know how to do this? Thanks!
Patrick Hill


1. 2nd Request - Passing parameters to ADO Data Environment command

I have set up an insert query with parameters via the Data Environment
designer and despite my best efforts can't seem to find any (concise)
documentation on how to pass data into the parameters on the VB side and
update the DB record.

Command name is MyNewRecord

 INSERT INTO MyTable(Field1, Field2, Field3) VALUES (?, ?, ?)

Parameter names : Param1, Param2, Param3

VB stuff: DataEnvironment1.MyNewRecord()

Where do you go from here?

2. Permission settings

3. Data Environment and passing parameters to child commands

4. Have you Gotten? 2/2

5. Passing Arguments in Commands of Data Environments

6. simple question

7. Passing NULL values through Data Environment Command

8. paradox 7 vers paradox 9 : lenteur

9. Pass a variable to the data environment

10. passing environment variable into SQL Loader on Unix for Oracle 8.0.5

11. can't use environment variables in command for cmdexec job steps (sql server 7.0)

12. Can you pass a where with multiple statements without a variable for each where statement

13. USing System Environment Variable in SQL statements