Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL and variables

Status
Not open for further replies.

Mojster

Programmer
Sep 26, 2001
18
0
0
SI
I'd like to know how to put variable in SQL statement.
For example:

.....
WHERE t.name= variable
.....


Thanks!
 
Var
variable string
endvar

variable = "\"My string\""

S = SQL

SELECT *
FROM table
WHERE Fld = ~variable

endSQL


 
If you don't use the same string (ie. string value depends on user's request), try this:

var
sqlString SQL
var String
endVar

var.view("Enter your string:")

sqlString =
SQL
SELECT * FROM TableName
where var = ~var
endSQL
endMethod
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top