Oracle的SQL语句中如何处理‘&’符号
在Oracle中,如果在sql中出现'&'符号,会被自动转义;
而被要求输入在&符号后跟随的字符串的值,例如:
update tablename set columnName='http://www.g.cn/cv2.jsp?spid=222&cid=333';
执行这个操作时,Oracle会提示
Enter value for cid:
原因是在Oracle中 & 符号是作为转义字符使用的。
解决方法:
用Oracle的字符串处理函数chr处理。chr(38)表示 &符号
改写:
update tablename set columnName='http://www.g.cn/cv2.jsp?spid=222'||chr(38)||'cid=333';
由此联想开去,在数据库中存入html的一些符号式,很可能都会出现这种情况,那么如法炮制即可,如果有些符号的编码不知道的,可以通过下面的方法来查询:
select ascii('&') from dual;
相关文档:
bigint 从 -2^63 (-9223372036854775808) 到 2^63-1 (9223372036854775807) 的整型数据(所有数字)。存储大小为 8 个字节。 Int64
int 从 -2^31 (-2,147,483,648) 到 2^31 - 1 (2,147,483,647) 的整型数据(所有数字)。存储大小为 4 个字节。int 的 SQL-92 同义字为 integer。 Int32
smallint 从 -2^15 (-32,768) 到 ......
NO.1
alter table pdt modify("PDTNAME",varchar2(100))
NO.2
字段不用“”
alter table pdt modify(PDTNAME,varchar2(100)) &n ......
use RetalDB--表示在数据库RetalDB中进行的操作
go
if exists (select * from sysobjects where name='tb_user')
drop table tb_user
go
--创建客户表tb_user
create table tb_user
(
user_id int primary key,--指定为主键时,此列默认为非空,指定过多个限制条件时不用“'”隔开
us ......
原文转自 http://blog.csdn.net/jyh_jack/archive/2008/04/07/2257512.aspx
SQL Native Client ODBC Driver
标准安全连接
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
您是否在使用SQL Server 2005 Express? 请 ......
例如:
普遍的SQL语句:
update book set bookname='sssss' where bookId=1;
在PL/SQL 中执行:
declare
v_book ......