?
Solved

Need help on sys_connect_by_path

Posted on 2008-11-15
6
Medium Priority
?
1,624 Views
Last Modified: 2013-12-19
Hi,
I am using sys_connect_by_path function.
the field from which information is fetched contains special character which sys_connect_by_path doesnt support.
and because of which sql is erroring out,
Could you please help as to how to remove the special character for sys_connect_by_path funct,,
Below is the sql m using.. Please help
select distinct rtrim(reverse
         (sys_connect_by_path(reverse
         (FIELD NAME), ' > ')), ' > ') path
  from TABLE NAME
where CONDITION
start with
CONDITION
connect by prior
     CONDITION

0
Comment
Question by:Techygal
  • 3
  • 3
6 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22968257
what version of oracle are you using? you posted in Oracle 8 zone, for which version that function is NOT available...
0
 

Author Comment

by:Techygal
ID: 22968888
Oracle 8i..thats Release 8.1.7.0.0 ..
does this helps..
Function is working fine.. bt it is used only for varchar.. char.. n all of those.. bt if the field contains special character .. its erroring out...

so wat can I use to remove the special character when its been selected..
 
I have pasted the SQL on my question..
Kindly hav a look at it
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22968924
>the field from which information is fetched contains special character which sys_connect_by_path doesnt support.

which are those characters?

you could "translate" those characters, for example if "%&/()=" are characters not working, translate them "away":
select distinct rtrim(reverse
         (sys_connect_by_path(reverse
         ( TRANSLATE(FIELD NAME, '%&/()=' ,' ' )), ' > ')), ' > ') path
  from TABLE NAME
where CONDITION
start with
CONDITION
connect by prior
     CONDITION

Open in new window

0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 

Author Comment

by:Techygal
ID: 22969100
Thank U so MUCH..... i did try translate. bt wat went wrong was the replacing value,,  i used '' rather ' '( space was missin)... :)..

you are really great.. appreciate your help..


0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 22970258
glad I could help. and yes, the ' ' instead of '' in oracle is important, as '' is implicitly considered NULL, and then TRANSLATE does not do anything.
0
 

Author Closing Comment

by:Techygal
ID: 31517130
Good Job... :)
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
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…
Via a live example, show how to take different types of Oracle backups using RMAN.
Suggested Courses

864 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