Solved

URL decode in Oracle

Posted on 2008-10-31
8
3,958 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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle dataguard 5 56
pivot rows to columns 1 44
Query - Duplicate dates with different activities counts 10 43
Oracle Query to Find number of process consumed by a session 15 52
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…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

713 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