來源:互聯網網民 2006-12-17 07:39:40
評論在delphi字符中包括單引號(")
在delphi字符中包括單引號(") 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']);
用兩個單引號('')即可在字符串包括單引號.
在delphi字符中包括單引號(")
在delphi字符中包括單引號(") 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']);
用兩個單引號('')即可在字符串包括單引號.