You are now on my old blog. Please update your bookmarks to my new blog
http://laurentschneider.com




17 January 2006

select * from test where my_long like '%toto%'

A good way to learn is to try to answer user questions. Instead of referencing other posts, I tried today to answer that frequently asked question myself on developpez.com (french forum)


SQL> create table test ( my_long long);

Table created.

SQL> insert into test values ('hello toto !');

1 row created.

SQL> exec for r in ( select my_long from test ) loop if (r.my_long like '%toto%') then dbms_output.put_line(r.my_long); end if; end loop
hello toto !

2 Comments:

Blogger Thomas Kyte said...

works up to 32k only - Oracle Text can index that and then contains() can be used to perform these searches on any length long.

Keep on answering :)

17/1/06 17:43  
Blogger Laurent Schneider said...

yes, only until 32k. I did not know oracle text could index "long"... thanks for the info :-)

18/1/06 09:29  

Post a Comment

<< Home