Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 28th, 2009, 05:20 AM
Authorized User
 
Join Date: Sep 2008
Location: , , Singapore.
Posts: 87
Thanks: 1
Thanked 0 Times in 0 Posts
Default regex for sql

Hi,

I have column values like ---- com.integrosys.sml.app.facility.vo.OBFacility[5647].Pricing Result

in my table .

i need to write a sql query fetching only the number inside the square braces(5647).

how to use regex for this .i am using oracle 10g

regards
Raj
Reply With Quote
  #2 (permalink)  
Old April 29th, 2009, 11:08 PM
Authorized User
 
Join Date: Sep 2008
Location: , , Singapore.
Posts: 87
Thanks: 1
Thanked 0 Times in 0 Posts
Default

SELECT REGEXP_SUBSTR(columnname ,'[[:digit:]]+') from table
Reply With Quote
  #3 (permalink)  
Old April 30th, 2009, 03:30 AM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

I was looking for something like that in Microsoft SQL but I could not get MS-SQL to find the CHARINDEX of "[".

Your answer looks good from here since I don't work with Oracle.

Thanks for posting the solution.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex pendemv JSP Basics 4 December 8th, 2008 08:29 AM
regex mrame XSLT 12 July 25th, 2008 09:37 AM
Regex htran XSLT 2 May 18th, 2005 09:21 AM
More regex help Snib Pro PHP 4 December 16th, 2004 09:56 PM
Need RegEx help Snib Pro PHP 6 November 16th, 2004 06:59 AM



All times are GMT -4. The time now is 11:05 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.