Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Regexp help

Author  Topic 

hey_frind
Starting Member

1 Post

Posted - 2012-11-22 : 13:31:42
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

52326 Posts

Posted - 2012-11-25 : 09:34:08
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
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-11-26 : 07:16:41
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
   

- Advertisement -