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.
Author |
Topic |
raghvendra deshpande
Starting Member
1 Post |
Posted - 2012-09-03 : 05:18:00
|
Hi all,I have written following query in Oracle.Here is the code:Code: (SELECT replace(REGEXP_SUBSTR (domainList001, '[^,]+', 1, LEVEL),'''','' ) FROM DUAL CONNECT BY REGEXP_SUBSTR (domainList001, '[^,]+', 1, LEVEL) IS NOT NULL) Here domainList001 is a string like 'domain1,domain2,domain3,domain4'and the above code breaks individual elements and I get following output:domain1domain2domain3domain4i.e one row for each element.Now I have to port it to SQL Server and DB2 syntax.Any help is appreciated.Thanks,Raghvendra |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-09-03 : 05:26:44
|
use one of the followinghttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=25830&SearchTerms=CSVTablehttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=76033select *from dbo.CSVTable('domain1,domain2,domain3,domain4') orselect *from dbo.fnParseList(',', 'domain1,domain2,domain3,domain4') that is for SQL Server. I have no idea on DB2 KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|
|