SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Regexp help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

hey_frind
Starting Member

1 Posts

Posted - 11/22/2012 :  13:31:42  Show Profile  Reply with Quote
Hello,
for the following input:
0.740234|0.758789|0.748047|0.749023|0.748047|0.754883|0.743164|0.748047|0.780273|0.739258|0.765625|0.761719|0.760742|||||0.75293|0.742188

I am trying to read each value in between |, if the field is empty , then I want to get empty or null reading.

I have tried to following:
REGEXP_SUBSTR({total},'[^|]*', 1, 1) where total is the input string (shown above).

Result is that I get output for where value exists between the pipe (|), but when it is the null (or empty), its not recongized.
Please help.

Thanks

visakh16
Very Important crosS Applying yaK Herder

India
52249 Posts

Posted - 11/25/2012 :  09:34:08  Show Profile  Reply with Quote
how are you trying to parse this? in T-SQL or in .NET?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 11/26/2012 :  07:16:41  Show Profile  Reply with Quote
Looks like REGEXP_SUBSTR is an Oracle function, Visakh.

To hey_frind: in Microsoft SQL Server, there is no equivalent function. This forum is for Microsoft SQL Server, so if you are using Oracle, you would get better and faster responses at another forum such as dbforums.com.

I am somewhat jealous of Oracle users now. We sorely need regex capabilities in SQL Server without having to resort to CLR. Hopefully in Sequel to SQL 2012 they will add it. I wonder what sequel to SQL 2012 would be code-named. Kilimanjaro? Everest?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000