?
Solved

URL decode in Oracle

Posted on 2008-10-31
8
Medium Priority
?
4,199 Views
Last Modified: 2013-12-19
What's the best way to decode URL characters when pulling data from Oracle?
0
Comment
Question by:stang1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 14

Expert Comment

by:ajexpert
ID: 22854055
Can u give example like what is the input (URL) and which way you want to represent?
0
 

Author Comment

by:stang1
ID: 22854170
the fields is varchar2(4000) and contains: (for example)
'Feb.+20%2C+2008%2C+Director+%28'
and my desired result:
'Feb. 20, 2008, Director ('
I'm just spooling to a .txt file and want to convert the encoded chars....
Thanks for your help....
0
 

Author Comment

by:stang1
ID: 22854196
the field is varchar2(4000) and contains: (for example)
'Feb.+20%2C+2008%2C+Director+%28'
and my desired result:
'Feb. 20, 2008, Director ('
I'm just doing a select and 3 tbls and spooling to a .txt file and want to convert the encoded chars....
Thanks for your help....
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 14

Expert Comment

by:ajexpert
ID: 22854291
Hi,
To my knowledge, oracle does not provide any functions for decoding URL.

However, you can use perl or java script for the same and call from oracle.

Hope it helps
0
 
LVL 9

Expert Comment

by:MarkusId
ID: 22857803
I'm afraid, not in version 9, but in version 11 (just in case anybody else is looking for somethink like this):

http://www.psoug.org/reference/utl_url.html
0
 
LVL 7

Expert Comment

by:DiscoNova
ID: 22858093
To my knowledge, the UTL_URL -package exists in Oracle 9 Release 2, however I'm not entirely certain of Release 1.
0
 
LVL 7

Accepted Solution

by:
DiscoNova earned 2000 total points
ID: 22858105
And, according to the page linked by MarkusId, it has indeed been first available in version 9.0.1.

So, to answer the original question, the solution to the example you gave (of course, you need to have execute privilege to the package SYS.UTL_URL, but I believe that has been granted to PUBLIC, so you propably don't need to worry about that) is:
SELECT UTL_URL.UNESCAPE('Feb.+20%2C+2008%2C+Director+%28') FROM DUAL;

Open in new window

0
 

Author Closing Comment

by:stang1
ID: 31512160
I just added a replace for the '+' and it worked really well.  Thanks!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

764 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