NEED A FUNCTION WHICH CAN DECODE THE URL

Hi all,
I am trying to decode the URL which appears in the address link.
Please read the following for more clarification:
On some search engine, I type the search item.
Say Google is the search engine
The search criteria that i gave is
Case 1
"Human Resources"
Resulting URL
"http://www.google.com/search?biw=1003&hl=en&q=Human+Resources"
Expected result after decoding the URL is
Human Resource
Case 2
Seaechitem http:// oracle
Result
http://www.google.com/search?hl=en&lr=&biw=1003&q=http%3A+%2F%2F+oracle
Expected Result after decoding the URL:
http:// oracle
Can anybody suggest me how to achieve this goal using Oracle?
Is there any function/procedure or any utility available to do it?
Thanks in advance.
Himanshu

Hi,
You lucky guy... I did something really close to what you need. I modified the code a bit (there might be some glitches) to match your requirements:DECLARE
     ref1 VARCHAR2(1000 CHAR) := 'http://www.google.fr/search?hl=fr\&biw=1280\&q=http%3A+%2F%2F+oracle\&btnG=Rechercher\&meta=';
     ref2 VARCHAR2(1000 CHAR) := 'http://www.google.fr/search?hl=fr\&biw=1280\&q=Human+Resources\&btnG=Rechercher\&meta=';
     FUNCTION hextodec( h IN VARCHAR ) RETURN NUMBER
     AS
          h2 VARCHAR2( 10 );
          i NUMBER( 10 );
          j NUMBER( 2 );
          d NUMBER;
     BEGIN
          h2 := LTRIM( h, '0' );
          d := 0;
          FOR i IN 1 .. LENGTH( h2 )
          LOOP
               SELECT DECODE( SUBSTR( h2, i, 1 )
                    , '0', 0, '1', 1, '2', 2, '3', 3, '4', 4, '5', 5
                    , '6', 6, '7', 7, '8', 8, '9', 9, 'A', 10
                    , 'B', 11, 'C', 12, 'D', 13, 'E', 14, 'F', 15 )
                    INTO j
                    FROM DUAL;
               d := 16 * d + j;
          END LOOP;
          RETURN d;
     END hextodec;
     FUNCTION strip(samplevalue IN VARCHAR2) RETURN VARCHAR2
     AS
          finalvalue VARCHAR2(1000 CHAR) := samplevalue;
          decimalvalue NUMBER(2);
          pospct NUMBER;
          extract VARCHAR2(2 CHAR);
     BEGIN
          finalvalue := SUBSTR(finalvalue ,INSTR(finalvalue ,'\&q='));
          finalvalue := SUBSTR(finalvalue ,4);
          finalvalue := SUBSTR(finalvalue ,1,INSTR(finalvalue ,'\&')-1);
          finalvalue := REPLACE(finalvalue ,'+',' ');
          LOOP
               pospct := INSTR(finalvalue ,'%');
               EXIT WHEN pospct = 0;
               extract := SUBSTR(finalvalue ,pospct+1,2);
               finalvalue  := SUBSTR(finalvalue ,1,pospct-1) || chr(hextodec(extract)) || SUBSTR(finalvalue ,pospct+3);
          END LOOP;
          RETURN finalvalue;
     END;
BEGIN
     DBMS_OUTPUT.PUT_LINE(strip(ref1));
     DBMS_OUTPUT.PUT_LINE(strip(ref2));
END;
/Warning: ESCAPE must be ON in order to do that under SQL*Plus (because of the '&').
Regards,
Yoann.

Similar Messages

  • Is there a tool which can check the version of latest version available?

    I need a tool which can check the version of latest firmware available for UCS servers. The point is avoid running old firmwares.
    If the tool can download the firmware that's like cherry on the cake.

    Hi Marsbar,
    =COUNTIF(range,"done") will return the number of cells in the specified range containing only the string "done"
    If the range is a single column, (eg. column E):
    =COUNTIF(E,"done")
    The formula is in cell A1 of the table, but may be placed anywhere (except in column E, unless it is in a Header row or Footer row).
    Regards,
    Barry

  • Hi! I need to load a GET url that si very long. On other browsers, I can load the url. In firefox 3.6, no. There is an addons or a plugin so I can extend this limit? If yes, is possible to load automatically this addons when loading a certain page? thanks

    Hi!
    I need to load a GET url that si very long. On other browsers, I can load the url. In firefox 3.6, no.
    There is an addons or a plugin so I can extend this limit? If yes, is possible to load automatically this addons when loading a certain page? thanks
    The url is sometingh like this (this is correctly loaded, but it could be longer)

    Firefox should have problems with long GET data appended to an URL (long would be over 64k).<br />
    If there are problems then it is possible that an extension is the cause of that.
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • Need RFC which can post the Goods Receipt

    Hi,
    My scenario is to post the Goods receipt, by using file and after posting the Goods Receipt i want the acknowledgement whether it is successful or unsuccessful. There is an idoc MBGMCR02 which can post the Goods Receipt but application acknowledgement is not possible in file to idoc scenario, so now i am searching for a RFC so that i can handle this situation using BPM synchronous process. Kindly suggest any RFC or BAPI which can post the Goods Receipt.
    Thanks & Regards,
    Venkat

    Hi Venkat,
    As per my understanding this is a "File To (Inbound) Proxy" scenario, in which you can use the BAPI "SD_SHIPMENT_POST_GOODS_ISSUE" to do the PGI into R/3 system.
    To perform this, you can go-ahead with the steps as mentioned below:
    Source (XI) System:
    1. Create the source & target data type in XI.
    2. Do required mapping in XI.
    3. In configuration directory, use the adapter type "XI" on the receiver communication channel.
    Target (R/3) System:
    1. Call transaction "SPROXY".
    2. Create the interface class (double click on Inbound message Interface, inside your namespace in R/3).
    3. Inside the class (proxy), create an internal table to keep all the records which will be coming from XI after your mapping.
    4. Pass all the data to above create internal table.
    5. Now, call function module "SD_SHIPMENT_POST_GOODS_ISSUE" and pass all required data from ur internal table to this FM (BAPI).
    Note: Kindly read about this FM (BAPI) first in SE37 under "Function Module Documentation".
    6. Do commit work after calling the FM (BAPI).
    I hope this will help you to resolve all your queries.
    Regards,
    Sarvesh Singh

  • I'm new to Mac and I have a Mac Mini. Could you please tell me how I could paste an URL to a video downloader like "Coolmuster Video Downloader for Mac"? I can copy the url but I could not paste it on the downloader. I appreciate your help to my problem.

    I'm new to Mac and I have a Mac Mini. Could you please tell me how I could paste an URL to a video downloader like "Coolmuster Video Downloader for Mac"? I can copy the url but I could not paste it on the downloader. I appreciate your help to my problem.

    Is this happing because the external is formatted to PC and not mac?
    Yes that is correct.
    Will I need to get a mac external hard drive if I wish to continue to save my documents like this?
    If you no longer use a PC you could format this drive for the Mac. However be aware that formatting a drive will erase all the data on it. So you would need someplace to copy the data off this drive to while you did the re-format and then you could copy the data back.
    You could get another drive, format it for the Mac and copy the data to it. Then re-format the original drive and use it as a backup drive. Always good to have backups.
    Post back with the drive type and size of the current drive, if you are doing backups now and how and if you still need to access this drive from a PC.
    regards

  • Hi there, I am setting up an online furniture company and need a software which can take a cut ou

    Hi there, I am setting up an online furniture company and need a software which can take a cut out of my product (e.g. a sofa which was photographed on its own in real life) and overlay the fabric swatch onto it so the customer can see the sofa/ product they have selected in any of the colours/ fabrics I offer. 
    Is there a product which can do this?
    Any help much appreciated!
    Regards,
    Sarah

    Lightroom isn't really suited to this type of work. Try Photoshop or Photoshop Elements. You can find more information on both at http://www.adobe.com/products/photoshopfamily.html?promoid=KAUCA

  • Need a character which can nullify a tab while printing a variable

    My variable has data as  vinod,,reddy,,g
    When, I am passing to script it should print as it is, but it is printing as vinod                     reddy                           g
    This is causing error to read the text as lot of space is coming inbetween...
    I know ,, will act as tab in Script. But need some character which can be placed inbetween the data of ,, so that it gets nullified in sap script while printing and data prints as vinod,,reddy,,g

    declare variable like data: lv_space type char10 value '          '
    pass vinod &lv_space& reddy &lv_space& g.

  • I need to convert PDF file to Word Document, so it can be edited. But the recognizing text options do not have the language that I need. How I can convert the file in the desired of me language?

    I need to convert PDF file to Word Document, so it can be edited. But the recognizing text options do not have the language that I need. How I can convert the file in the desired of me language?

    The application Acrobat provides no language translation capability.
    If you localize the language for OS, MS Office applications, Acrobat, etc to the desired language try again.
    Alternative: transfer a copy of content into a web based translation service (Bing or Google provides a free service).
    Transfer the output into a word processing program that is localized to the appropriate language.
    Do cleanup.
    Be well...

  • Looking for a Powershell Script which can put the scom servers in maintenance mode

    Looking for a Powershell Script which can put the scom servers in maintenance mode so that SCOM should not send an alert during planned task.
    Rahul

    1. Provide list of servers line-by-line in C:\ServerList.txt, make sure you provide limited no. of servers, do not exceed 20 - 25 per batch
    2. Save the script with suitable name (test.ps1)
    3. Open PowerShell cmd prompt
    4. Script accepts 3 params - TimeInMinutes, Reason and Comment
    **** Please note, this script will work for SCOM 2012 R2
    param([int32]$TimeMin, [string]$Reason, [string]$Comment)
    try
    $api = new-object -comObject 'MOM.ScriptAPI'
    Import-Module operationsmanager
    New-SCOMManagementGroupConnection
    $Servers = Get-Content "C:\ServerList.txt"
    $Time = (Get-Date).Addminutes($TimeMin)
    Foreach ($Server in $Servers)
    #Get Computer instance
    $ComputerClass = Get-SCOMClass -Name Microsoft.Windows.Computer
    $ComputerClassInstance = Get-SCOMClassInstance  -Class $ComputerClass | Where {$_.DisplayName -eq $Server}
    If ($ComputerClassInstance -ne $Null)
    $HealthServiceWatcherClass = Get-SCOMClass -name:Microsoft.SystemCenter.HealthServiceWatcher
    #Get Health Service Watcher Class instance of the server
    $HSWClass = Get-SCOMClass -Name Microsoft.SystemCenter.HealthServiceWatcher
    $HSWClassIns = Get-SCOMClassInstance  -Class $HSWClass | Where {$_.DisplayName -eq $Server}
    #Starting the maintenance mode
    Start-SCOMMaintenanceMode -Instance $HSWClassIns -EndTime $Time -Reason $Reason -Comment $Comment
    Start-SCOMMaintenanceMode -Instance $ComputerClassInstance -EndTime $Time  -Reason $Reason -Comment $Comment
    Write-Host "Health Service Watcher and Agent server "$Server " kept in maintenance mode"  -foregroundcolor "green"
    $api.LogScriptEvent('MaintenanceModeScript.ps1', 200, 0, "$Server kept in maintenance mode for $TimeMin minutes")
    Else
    Write-Host $Server" not found " -foregroundcolor "red"
    $api.LogScriptEvent('MaintenanceModeScript.ps1', 201, 1, "$Server could not be found in domain")
    Catch [system.exception]
    $api.LogScriptEvent('MaintenanceModeScript.ps1', 201, 1, $_.Exception.Message)
    Faizan

  • I need a app which can record incoming and outgoing calls automatically without internet

    i need a app which can record incoming and outgoing calls automatically without internet.
    Can some help me on this ?

    As far as I know there is no app to record phonecalls because US regulations, but I am not using iphone in US so we definately need call recorder. HTC or Samsung has call recorder so why we dont?

  • I have just purchased the new Canon 7D II.  I am using CS6 and Lightroom 5.0, neither of which can open the RAW files although I see from the list of supported cameras that the 7D II is covered.  I have updated both CS6 and LR so that is not the problem.

    I have just purchased the new Canon 7D II.  I am using CS6 and Lightroom 5.0, neither of which can open the RAW files although I see from the list of supported cameras that the 7D II is covered.  I have updated both CS6 and LR so that is not the problem.  Not sure what to do next.

    It has been indicated that both of those cameras will be supported in the final release of Camera Raw 8.7. But there is no announced release date. There never is. I assume it will be before December 31. But that is only my guess based on the fact that the release candidate expires then.

  • Do we have any infotype which can capture the present Cost to Company (CTC)

    Dear guru's,
    Do we have any infotype which can capture the cost to company and if something is there can we utilise that in Recruitment module r/3.
    Appreciate some quick responses.
    Regards,
    Rajasekar.

    Yeah sure.. usually we dodnt have any tracing to get outgoing call.. even though we have 700 mins we use 400 in one month and 1000 in next month.. to balance this it will be very useful but from the couple of comments this app is not recemended ..and ther was not rating and contact option indeed
    anyway thanks for your time ..Please let me know if u find any app which suits my case .. thanks again!!

  • Hello I need a help regarding application passbook.I need know if I can download the application passbook as passbook.ipa?

    Hello I need a help regarding application passbook.I need know if I can download the application passbook as passbook.ipa?

    Passbook is an app that's built into the iPhone. It's not availble for the iPad.

  • Standard report which can show the  details of Invoice value and PO value

    Hi all,
    Is there any  standard report which can show the  details of Invoice value  is more than 5% of PO value. MIRO value and PO value.
    If any report which caters the maximum requirement is also fine
    Regards
    Sanjith
    Edited by: Sanjith Sethu Lekha on Dec 6, 2011 2:42 PM

    Hi
    Please refer the below mentioned link
    /thread/1789934 [original link is broken]
    Regards
    Praveen P C

  • I have a Mac Pro Mid2009,do i need a antivirus installed?.Never had a trouble till now though!,but just to get things clariffied.If got to install,which is one recommended and preferably a freeware which can do the job.

    Hello,
    I have a MacBook Pro mid 2009 version.Have got no Antivirus installed so far all these years and its been fine till this moment.
    Just to satisfy my curiosity,would i require to install one,to be on the safe side or doing so would that slow do my system,like browsing and my operations?.
    Please advice if it's preferred to have a antivirus installed and if so which one would the experts recommend,preferably a freeware if that could do the required job.
    Would appreciate any sincere advice on this topic,
    Cheers!.
    Aishsri

    Firstly thank you so much for your reply.
    As stated in my query earlier,i do not have or feel any specific issue is ongoing right now with my Mac pro,but at times i feel a sort of slowness in my Firefox browser opening up and at various times,have the beach ball popping up after a command is given and takes a while to set in.
    All these sometimes make me think,if i am getting into trouble,and hence thought should i install a Antivirus?.
    Ok,is there anyway i can check if my Mac pro is free of any Viruses or Malware or any sort of these things?.
    Would appreciate your reply.
    Thanks

Maybe you are looking for

  • Can anyone read this crash report?

    Hi. I`ve never had any problems with Logic Pro, but today, in a mix, it suddenly just crashed. And still keeps crashing. Can anyone PLEAAAASE help me out with this, and explain how to fix it in "computer-for-dummies"-language? Much appreciated =) The

  • How to import existing BPM project in jDeveloper

    Hi, I am new to oracle BPM. I have imported oracle BPM+SOA project in jedeveloper using (file->import->soa archive into soa project). I am able to see SOA composite in jdeveloper but not BPM processes. instead of BPM process it showing "unknown proje

  • [Tabular] Only an admin for the database (not server) -- can I push changes?

    I recently created a PowerPivot workbook that got pushed out to my enterprise's tabular server. And while our current IT policies keep me from being able to be an SSAS Administrator, I did get included in the Admin role for the database itself (not t

  • Question re X220 Hard Drive Options

    I had to buy the X220 with a 320GB 5400 RPM hard drive to speed up delivery but really want a 7200 RPM 320GB drive. I see two possible 7mm options. Hitachi Z7K320 (HTS723232A7A364) http://www.tigerdirect.com/applications/searchtools/item-details.asp?

  • Submit Button in InfoPath has stopped working??

    Hi there, I wonder if you can help me. I had a infopath form that involved people submitting a form and then approval was sent to their line manager and they would then approve the entry. This was working fine and now, despite everyone being in the s