Hi,
Just to understand oracle CONTAINS function, I have created the below table:
create table empmst
( eid number,
ename varchar2(50),
constraint pk_empmst primary key (eid)
)
insert into empmst values (1,'RAVINDRA');
insert into empmst values (2,'JHON')
insert into empmst values (3,'PETER')
insert into empmst values (4,'JHON PETER')
insert into empmst values (5,'JAMES')
insert into empmst values (6,'JHONY')
if I execute
select * from empmst where CONTAINS(ename, 'JAMES', 1) > 0;
getting the error
ORA-20000: Oracle Text error:
DRG-10599: column is not indexed
so i have created index
CREATE INDEX IDX_ENAME ON EMPMST(ENAME) LOGGING NOPARALLEL;
Then also am getting the same error.
and what is the difference among the below statements:
select * from empmst where ename like 'JAMES';
select * from empmst where instr(ename ,'JAMES',1)>0;
select * from empmst where CONTAINS(ename, 'JAMES', 1) > 0;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
Thanks,
Karthik