Solved

Equivalent of PATINDEX in oracle for pattern searching

Posted on 2003-11-06
9
2,975 Views
Last Modified: 2007-12-19
I am working on ORACLE9i. I want equivalent of PATINDEX in ORACLE. ORACLE provides a function INSTR but it does not support wild characters. I want to search the strings using wild characters, which INSTR does not support...

Is there any equivalent of PATINDEX in oracle so that i can search patterns using wild characters??? If not function then is there any package which provides a similar functionality.

Thanks
Alok




0
Comment
Question by:pinki3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 13

Expert Comment

by:anand_2000v
ID: 9693770
You can create a function based index from Oracle 8i onwards.....You can use any methodology in the PL/SQL part to implement the same.
0
 
LVL 48

Expert Comment

by:schwertner
ID: 9693797
You have to wait for Oracle 10g which supports regular expressions.
0
 
LVL 13

Expert Comment

by:anand_2000v
ID: 9693814
Schwertner: A doubt....
Is my answer correct....I believe so ...but always am ready to get it confirmed from an expert..:)
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 7

Expert Comment

by:grim_toaster
ID: 9694077
Strictly theoretical I'm afraid, but you could (???) load a java object into the database, and using the regexp package available in JDK1.4 (if it's available to your Oracle instance?) use Java's regular expressions in a call from a PL/SQL function.
0
 

Author Comment

by:pinki3
ID: 9699429
Is it mean that currently we don't have any built in function or package in ORACLE which might work for pattern matching using wild characters????

Thanks

0
 
LVL 7

Expert Comment

by:grim_toaster
ID: 9699620
It would all depend on how advanced you want it to be.  You could use the standard _ or % characters to a certain degree to get any character/characters, but to my knowledge there is no package (unless there's one on the internet somewhere...) that does regular expressions.
0
 
LVL 1

Accepted Solution

by:
monu85 earned 100 total points
ID: 9699635
AFAIK oracle doesn't provide any built-in function or package equivalent to PATINDEX. So i  think you will have to code a function equivalent to PATINDEX which might be 100-200 lines...

try to survive with INSTR if u can else code the function..

monu
0
 

Expert Comment

by:alokgupt
ID: 9712833
i think oracle supports some package, can any body let me know the exact name of the package...

0
 
LVL 13

Expert Comment

by:anand_2000v
ID: 9714131
>>You can create a function based index from Oracle 8i onwards.....You can use any methodology in the PL/SQL part to implement the same.

>>AFAIK oracle doesn't provide any built-in function or package equivalent to PATINDEX. So i  think you will have to code a function equivalent to PATINDEX which might be 100-200 lines...

>>try to survive with INSTR if u can else code the function..


WHAT WAS THE DIFFERENCE? except longer sentences?
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question