|
Delphi中,用interbase控件访问InterBase数据库,并设置Dialect 3模式访问时,SQL语句中引用的字符型字段需要放在单引号('''')内,如要在Delphi的IBQuery中实现该操作:
select * from MyTable where name=''''zmxjh''''
可以这样做:
SQL := ''''select * from MyTable where name=''''''''%s'''''''' ''''; SQL := format(SQL,[''''zmxjh'''']);
用两个单引号('''''''')即可在字符串包括单引号.
|