1. directly use the value (number or string)
Number: Select * from CC where no = 5; or select * from CC where no = '5'
String: Select * from CC where name = 'dashan'
2. Use Variables
VaR
XX: string;
SQL: widestring;
.........
If the variable XX is a numeric string, both statements can
SQL: = 'select * from CC where no = '+ xx; or
SQL: = 'select * from CC where no = ''' + xx + '''; (string variables must be enclosed by single quotes)
Non-pure numeric string
SQL: = 'select * from CC where no = ''' + xx + '''; (string variables must be enclosed by single quotes)
3. Use Parameters
VaR
QQ: string;
......
Self. adocommand1.commandtext: = 'insert into Ceshi (SS) values (: XX) '; // The parameter XX used here
Self. adocommand1.parameters. paramvalues ['xx']: = QQ; // assign a value to the parameter
Note that the order in which parameters are used: first use parameters (define SQL statements with parameters), and then define the value of parameters.