解决动态生成的SQL中特殊字符的问题 QuotedStr function
2008-12-11 10:42
429 查看
Returns the quoted version of a string.
Unit
SysUtils
Category
String handling routines
Delphi syntax:
function QuotedStr(const S: string): string;
Description
Use QuotedStr to convert the string S to a quoted string. A single quote character (') is inserted at the beginning and end of S, and each single quote character in the string is repeated.
Note: When working with multi-byte character systems (MBCS), use AnsiQuotedStr instead.
Example
SQL.Add(format( 'select * from tabname where field1 = %s', [QuotedStr(Edit1.Text)]));
Unit
SysUtils
Category
String handling routines
Delphi syntax:
function QuotedStr(const S: string): string;
Description
Use QuotedStr to convert the string S to a quoted string. A single quote character (') is inserted at the beginning and end of S, and each single quote character in the string is repeated.
Note: When working with multi-byte character systems (MBCS), use AnsiQuotedStr instead.
Example
SQL.Add(format( 'select * from tabname where field1 = %s', [QuotedStr(Edit1.Text)]));
相关文章推荐
- 对于“不返回任何键列信息的 SelectCommand 不支持 UpdateCommand 的动态 SQL 生成”问题的解决
- “对于不返回任何键列信息的 SelectCommand 不支持 UpdateCommand 的动态 SQL 生成”问题的解决
- 对于“不返回任何键列信息的 SelectCommand 不支持 UpdateCommand 的动态 SQL 生成”问题的解决
- 对于不返回任何键列信息的 SelectCommand 不支持 UpdateCommand 的动态 SQL 生成问题的解决办法
- 对于不返回任何键列信息的 SelectCommand 不支持 UpdateCommand 的动态 SQL 生成”问题的解决
- 关于执行Oracle下Sql语句中遇到的特殊字符问题解决办法。
- java格式化字符串,在指定位置插入指定字符串,兼容中英文以及特殊字符,例如:换行,用于解决生成pdf换行问题等问题
- 如何解决在.Net中用Sql语句向SqlServer数据库中插入特殊字符失败的问题?
- java格式化字符串,在指定位置插入指定字符串,兼容中英文以及特殊字符,例如:换行,用于解决生成pdf换行问题等问题
- 如何解决java.sql.Statement无法处理特殊字符以及容易被黑问题
- 解决pdf打印预览中遇到特殊字符,导出失败问题
- 特殊字符变乱码问题如何解决呢?
- 【原】解决PS1的显示问题,busybox的/u /h特殊字符解析问题
- 解决sybase存储过程中不能取得动态sql输出参数的问题
- JAVA中无法处理带有特殊字符文件名的zip包的问题解决
- 解决dede生成静态页和动态页转换的一些问题,及火车采集入库生成动态的办法
- GridView动态生成字段常见问题及解决方法 .
- ”对于不返回任何键列信息的 SelectCommand,不支持 DeleteCommand 的动态 SQL 生成“解决办法
- 使用php动态生成gif时遇到的问题和解决办法
- 彻底解决Ms sql server 2000中的最大流水号的生成问题