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

where a matches "*
*";
试试看?

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

原帖由 ok2ok 于 2007-11-20 09:55 发表 http://bbs.chinaunix.net/images/common/back.gif
插入三条记录:
insert into xx values ('ok');
insert into xx values ('a
b');
insert into xx values ('cd');

请问怎么写才能显示带换行符的记录。不要告诉我用 where a = 'a
b';
请指点
select...


你就不能稍微的再进一步的实验一下? 该不会不知道有match,like吧。
其实我在7楼的帖子已经认同你的说法,并且给出了like这个提示。

[ 本帖最后由 ivhb 于 2007-11-20 13:30 编辑 ]

ok2ok 发表于 2007-11-21 13:07

回复 #12 ivhb 的帖子

where a matches "*
*";
不知道ivhb 试了没有?如果你试验成功告诉我你的环境。
希望你能解决这个问题,否则这个帖子就变的又臭又长了。

match,like我确实不太会用,百试不得其解

ivhb 发表于 2007-11-21 13:57

我的测试记录


Script command is started on Wed Nov 21 13:53:56 BEIST 2007.
/tmp>cat | dbaccess xdbtest

Database selected.

select * from xyz;


x                  

aa
bb               
xyz               

x                  

y                  

4 row(s) retrieved.

select * from xyz where x matches '*
*';

282: Found a quote for which there is no matching quote.
Error in line 1
Near character position 35
------pay attention to this setting !!!!


execute procedure ifx_allow_newline('t');
Routine executed.

select * from xyz where x matches '*
*';


x                  

aa
bb               

x                  

y                  

3 row(s) retrieved.


select * from xyz where x not matches '*
*';


x                  

xyz               

1 row(s) retrieved.

select * from xyz where x like '%
%';


x                  

aa
bb               

x                  

y                  

3 row(s) retrieved.

select * from xyz where x not like '%
%';


x                  

xyz               

1 row(s) retrieved.

select count(*) from xyz where x matches '*
*';


      (count(*))

               3

1 row(s) retrieved.

select count(*) from xyz where x not like '%
%';


      (count(*))

               1

1 row(s) retrieved.

select count(*) from xyz;


      (count(*))

               4

1 row(s) retrieved.

select first 1 dbinfo ('version', 'full') from systables;


(constant)                                 

Informix Dynamic Server Version 9.30.F      

1 row(s) retrieved.

!uname -a
AIX p6701l1 2 5 0032EC4C4C00

!onstat -

Informix Dynamic Server Version 9.30.FC3   -- On-Line -- Up 17 days 09:38:33 -- 246544 Kbytes

^D

Database closed.

/tmp>

Script command is complete on Wed Nov 21 14:03:57 BEIST 2007.


[ 本帖最后由 ivhb 于 2007-11-21 14:20 编辑 ]

ivhb 发表于 2007-11-21 14:11

ok2ok朋友,你总是说不行。却不说怎么个不行法。

我在2楼已经贴过我的测试,不知道和你的测试有什么区别。
如果你发现了问题,也希望你不是简短的一句,是不是也可以花点儿时间,不管是贴出东西,还是认真描述也好。也要给别人和你沟通保留足够的信息。不至于误解了才是。这也是论坛的一个的规则和对别人的一个尊重。

在此,我希望你贴出来你的测试。也许我看不出问题,但是总有人能看出你的问题所在。

之所以上次回复没有这么贴。是因为我在2楼的帖子已经贴过了。当然,windows环境的informix我都没有用过。不知道是不是可以。所以这次给出os和database的环境。

希望我的回复没有冒犯到你。

祝你在cu上玩的愉快。

ok2ok 发表于 2007-12-06 12:48

回复 #15 ivhb 的帖子

多谢ivhb的指点。现在数据库中换行问题基本解决。
先前的不解是因为我一直用winsql 链接数据写sql。开始也没有理解
你的 “ /tmp>cat | dbaccess xdbtest” 是什么意思。
现在不但知道怎么处理换行,学会了dbaccess的另一种使用方法。真是多谢,多谢。

linuxboy99 发表于 2007-12-11 15:41

这个要是能解决我可太感谢了
同样遇到相同问题
页: 1 [2]
查看完整版本: informix 数据库表里面的回车换行符如何表示?