Solved

URL decode in Oracle

Posted on 2008-10-31
8
4,078 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to take different types of Oracle backups using RMAN.

717 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