airmanlee 发表于 2007-10-12 10:42

ivhb 发表于 2007-10-12 16:41


/tmp>cat | dbaccess databasename
create table xx (
a char(20)
);

Table created.

insert into xx values ('a
b');

282: Found a quote for which there is no matching quote.
Error in line 1
Near character position 24

execute procedure ifx_allow_newline('t');

Routine executed.

insert into xx values ('a
b');

1 row(s) inserted.

select * from xx;


a                  

a
b               

1 row(s) retrieved.

update xx set a = 'xx'
where a = 'a
b';

1 row(s) updated.

select * from xx;


a                  

xx                  

1 row(s) retrieved.

ok2ok 发表于 2007-11-06 10:56

回复 #2 ivhb 的帖子

select * from xx where a .....

什么条件才能查到带换行的 a。
也就是 换行符在 sql 中怎么写?

ivhb 发表于 2007-11-06 13:20

仔细看我的回复,不很清楚么?

ok2ok 发表于 2007-11-16 12:29

回复 #4 ivhb 的帖子

update xx set a = 'xx'
where a = 'a
b';

1 row(s) updated.

其中where a like 换行符。

现实中a的完整内容不可能知道。

czw1413_cn 发表于 2007-11-16 17:21

ivhb 发表于 2007-11-16 18:31

原帖由 ok2ok 于 2007-11-16 12:29 发表 http://bbs.chinaunix.net/images/common/back.gif
update xx set a = 'xx'
where a = 'a
b';

1 row(s) updated.

其中where a like 换行符。

现实中a的完整内容不可能知道。

恩.你说得很对.用like,写法同上。

ok2ok 发表于 2007-11-19 12:06

回复 #7 ivhb 的帖子

好像你搞错了。
select 出a 字段中含义换行符的记录,没办法写!

ivhb 发表于 2007-11-19 13:46

请仔细看贴,动手实验一下。
对了,我不保证7.x的版本也能用。我是在IDS9.30.FC3 试验的。

ok2ok 发表于 2007-11-20 09:55

插入三条记录:
insert into xx values ('ok');
insert into xx values ('a
b');
insert into xx values ('cd');

请问怎么写才能显示带换行符的记录。不要告诉我用 where a = 'a
b';
请指点
select * from xx where 。。。。。
页: [1] 2
查看完整版本: informix 数据库表里面的回车换行符如何表示?