- 1、本文档共12页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
SQL中存储过程中SQL语句的单引号和双引号题目(国外英文资料)
SQL中存储过程中SQL语句的单引号和双引号问题(国外英文资料)
Single and double quotes of SQL statements in stored procedures in SQL (2)
About double quotes, single quotes, and SQL statements
(1) look at a simple SQL statement first
??? Insert, Into, users (username), values (Xiao Wang)
Well, lets see, this is a standard SQL statement, because username is a text field, so both sides of the field value should be double quotes, which means Wang is a string.
?? (2) but in ASP, we usually do
???? StrSql=, Insert, Into, users (username), values (Xiao Wang)
At this point, the front and back double quotes indicate the middle is a string. The single quotes on both sides of Wang are nested because of quotation marks, so the inner quotation marks should be in single quotation marks.
??? (3) the actual insertion, because he is usually obtained from the form variables, but because the variable cannot be written directly through the connection string, character and string must be connected together, so be written in the following form:
????? myusername=Request.Form? (username)
What?????????......
??? strSql=, Insert, Into, users (username), values ( MYUSERNAME )
A lot of people are confused at the moment. Why are there single quotes and double quotation marks?. A simple look at the above formula, is composed of the following three parts:
String constants: Insert, Into, users (username), values
??? string variables: MYUSERNAME
??? string constant:
???? Directly understand the above formula may be difficult, now we MYUSERNAME variable values can see clearly. If myusername=, Xiao Wang, substitute:
Into, Insert, users (username), values ( Wang and strSql=)
And then, in turn, the concatenation operator is executed, and the result is:
??? strSql=, Insert, Into, users (username), values (Xiao Wang)
What? This is the correct SQL statement mentioned in (2). Here you can see it clearly: the formula first, second double quotes matching, said this is a string. The third, fourth double quotation marks are also represe
您可能关注的文档
- 11-12学年新目标九年级上学期期末总温习(国外英文资料).doc
- 11.5高二以前分词用法小结一对一用(国外英文资料).doc
- 1111中学英语优质教案(国外英文资料).doc
- 100个轻易写错的成语(国外英文资料).doc
- 11、Some和any的用法及演习(国外英文资料).doc
- 11《争辩的故事》(国外英文资料).doc
- 11天7次记忆法(国外英文资料).doc
- 11秋北语——多媒体应用基础(含答案)(国外英文资料).doc
- 11精品初中英语虚拟语气讲解及演习(国外英文资料).doc
- 12.4机械能与内能的相互转化(一)教案(国外英文资料).doc
- 中国国家标准 GB/T 4214.17-2024家用和类似用途电器噪声测试方法 干式清洁机器人的特殊要求.pdf
- GB/T 4214.17-2024家用和类似用途电器噪声测试方法 干式清洁机器人的特殊要求.pdf
- 《GB/Z 43202.1-2024机器人 GB/T 36530的应用 第1部分:安全相关试验方法》.pdf
- GB/Z 43202.1-2024机器人 GB/T 36530的应用 第1部分:安全相关试验方法.pdf
- 中国国家标准 GB/Z 43202.1-2024机器人 GB/T 36530的应用 第1部分:安全相关试验方法.pdf
- 中国国家标准 GB/T 32455-2024航天术语 运输系统.pdf
- GB/T 32455-2024航天术语 运输系统.pdf
- 《GB/T 32455-2024航天术语 运输系统》.pdf
- GB/T 44369-2024用于技术设计的人体运动生物力学测量基础项目.pdf
- 中国国家标准 GB/T 44369-2024用于技术设计的人体运动生物力学测量基础项目.pdf
文档评论(0)