Cannot encode double & single quote " and ' using htmldb_util.url_encode()

Hello,
I'm using HTMLDB 1.5.0.00.33 on Oracle 9.2.0.6 database. The data(a sql query that populates the report page) that I want to pass as part of URL string contains special characters like #, $, % and quotes " or '. I'm using htmldb_util.url_encode() to encode the data and it works fine for special characters except for " & '. Can someone please help in this? Below sql query shows that.
SQL>select htmldb_util.url_encode('A%"#') from dual;
HTMLDB_UTIL.URL_ENCODE('A%"#')
A%25"%23
1 row selected.
Thanks
Shashin

Shashin,
You could try using the UTL_URL.Escape function with the escape_reserved_chars parameter set to TRUE. That should encode the reserved characters.
See the documentation here: http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_url.htm#sthref15935
If you want to call it from a SQL statement, you'll need to wrap it in a function like this:
function MyURLEscape(URL varchar2) return varchar2 is
   Result varchar2(4000);
begin
   Result := UTL_URL.Escape(URL, TRUE);
   return(Result);
end MyURLEscape;

Similar Messages

  • Getting rid of single quotes and other bad characters

    Hello All-
    I am writing a servlet that takes a value from a form, and saves it to a database. However, when single quotes, and other illegal characters are entered, i get all sorts of errors. I am certain their is some function that would take care of all of this.
    Help!

    Hi there,
    When you try to insert single quotes into the database it gives an error or problem because a single quote is a reserved character in the database.
    If you want to store a single quote or any other character that is reserved in the database then you need to find out how to escape that reserved character.
    One option is to use the single quote twice, so instead of ' , use '' (not double quote but , type single quote twice).
    Another option is to use HTML entity code for single quote
    "Message was edited by:
    appy77

  • Can a single quote be used at the beginning of a query string parameter

    Hi all,
    I am a relative newbie and have a newbie question.
    Can a single quote be used at the beginning of a query string parameter passed to a jsp page? Are there any inherant problems with this? Is there a comprehensive list of characters that must be escaped in a query string parameter?
    Example: http://mysite.com/myjsp.jsp?param1='nghdh
    Thanks

    You'll have to escape most non-letter characters before you can pass them as a URL. I don't know if it's necessary for a single quote, but better safe than sorry.
    Either use java.net.URLEncoder(...) or use javax.servlet.http.HttpServletResponse.encodeURL(String). I wouldn't recommend using unescaped characters in your URLs, that might cause pretty funny behavior that's sometimes hard to trace back. Don't worry about decoding it, your JSP/Servlet container will do it when you call javax.servlet.http.HttpServletRequest.getParameter(String).

  • PLS-00497: cannot mix between single row and multi-row (BULK) in INTO list

    Hi,
    I have a requirement to send a table data through mail,
    so am using execute statement after opening the connection and am using the following PLSQL code, which am failing to execute successfully.
    My code goes like this.
        0            10            20           30           40            50
    1  CREATE OR REPLACE PROCEDURE SEND_TABLE_DATA( FROMAD IN VARCHAR2,
    2   TOAD IN VARCHAR2,
    3   SUBJECT IN VARCHAR2,
    4   MESSAGE IN VARCHAR2,
    5   DOCID IN VARCHAR2,
    6   DOCDT IN DATE,
    7   PRODOAID IN NUMBER )
    8   AS
    9   BATCHNO  VARCHAR2(32767);
    10  PCSBOX  NUMBER;
    11  AMOUNT  NUMBER;
    12  SMTPHOST VARCHAR2(255) := 'XXX.XXX.X.XXX' ;
    13  A UTL_SMTP.CONNECTION ;
    14  BEGIN
    15  A :=UTL_SMTP.OPEN_CONNECTION(SMTPHOST,25);
    16  UTL_SMTP.HELO(A,SMTPHOST);
    17  UTL_SMTP.MAIL(A,FROMAD);
    18  UTL_SMTP.RCPT(A,TOAD);
    19  UTL_SMTP.OPEN_DATA(A);
    20  UTL_SMTP.WRITE_DATA(A, CHR(13) ||CHR(13) || CHR(13) );
    21  UTL_SMTP.WRITE_DATA (A,'Date: '|| TO_CHAR(SYSDATE,'DD/MM/YYYY HH24:MI:SS') || CHR(13) );
    22  UTL_SMTP.WRITE_DATA(A,'From: '||FROMAD|| CHR(13) );
    23  UTL_SMTP.WRITE_DATA(A, 'To: '||TOAD|| CHR(13) );
    24  UTL_SMTP.WRITE_DATA(A, 'Subject: '|| SUBJECT || CHR(13) );
    25  UTL_SMTP.WRITE_DATA(A,MESSAGE||DOCID||' Documented on '||DOCDT||CHR(13) );
    26  UTL_SMTP.WRITE_DATA(A,CHR(13) || CHR(13) || CHR(13) );
    27  UTL_SMTP.WRITE_DATA(A,'This is for your information'||CHR(13) );
    28  UTL_SMTP.WRITE_DATA (A,' BATCHNO '|| ' -- '||' PCSBOX '||' -- '||' AMOUNT '||CHR(13) );
    29  EXECUTE IMMEDIATE
    30         'SELECT
    31       A.BATCHNO,B.PCSBOX,B.AMOUNT
    32        FROM
    33      SCHEMA1.TABLEX A,SCHEMA2.TABLEY B
    34        WHERE
    35       A.BATCHID=B.BATCHNO AND B.PRODOAID='|| PRODOAID
    36     BULK COLLECT INTO BATCHNO,PCSBOX,AMOUNT;
    37  FOR indx IN 1..BATCHNO.COUNT
    38   LOOP
    39    UTL_SMTP.WRITE_DATA (A,BATCHNO(indx)|| ' -- '||PCSBOX(indx)||' -- '||AMOUNT(indx)||CHR(13) );
    40   END LOOP;
    41  UTL_SMTP.WRITE_DATA( A,CHR(13) || CHR(13) || CHR(13) );
    42  UTL_SMTP.CLOSE_DATA(A);
    43  UTL_SMTP.QUIT(A);
    44  EXCEPTION
    45  WHEN OTHERS THEN
    46  UTL_SMTP.QUIT(A);
    47  RAISE;
    48  END;
    49  /
    SELECT * FROM USER_ERRORS
    NAME                       TYPE             SEQUENCE    LINE         POSITION        TEXT                                                                                                             ATTRIBUTE                 MESSAGE_NUMBER
    SEND_TABLE_DATA
    PROCEDURE
    3
    37
    1
    PL/SQL: Statement ignored
    ERROR
    0
    SEND_TABLE_DATA
    PROCEDURE
    2
    37
    24
    PLS-00487: Invalid reference to variable 'BATCHNO'
    ERROR
    487
    SEND_TABLE_DATA
    PROCEDURE
    1
    36
    25
    PLS-00497: cannot mix between single row and multi-row (BULK) in INTO list
    ERROR
    497
    Thanks In Advance
    Regards
    Pradeep.

    > 29  EXECUTE IMMEDIATE
    > 30         'SELECT
    > 31       A.BATCHNO,B.PCSBOX,B.AMOUNT
    > 32        FROM
    > 33      SCHEMA1.TABLEX A,SCHEMA2.TABLEY B
    > 34        WHERE
    > 35       A.BATCHID=B.BATCHNO AND B.PRODOAID='|| PRODOAID
    > 36     BULK COLLECT INTO BATCHNO,PCSBOX,AMOUNT;
    The variables BATCHNO, PCSBOX and AMOUNT are defined as scalar variables. Check there definition
    > 9   BATCHNO  VARCHAR2(32767);
    > 10  PCSBOX  NUMBER;
    > 11  AMOUNT  NUMBER;
    You cannot use BULK COLLECT on scalar variables. The variables must be defined as a COLLECTION TYPE in order to perform bulk collect.

  • How to restart base station from airport utility? I used to be able to do it remotely  I currently use a Mac Pro 10.8.4 and have a time machine for wireless 6.3 (630.34). Sometimes I cannot connect to the internet and use network preferences to diagnose t

    How to restart base station from airport utility? I used to be able to do it remotely
    I currently use a Mac Pro 10.8.4 and have a time machine for wireless 6.3 (630.34). Sometimes I cannot connect to the internet and use network preferences to diagnose the issue. This results in being told to restart the wireless. The airport utility includes the drop down option of restarting but is not clickable so I can't choose it.
    With my prior macbook and same time capsule, etc  if i had problems connecting to the internet I would run network diagnostics to help out. This included clicking on the airport utility ---> base station --> restart. This worked most of the time.
    Bottom line, is there something I am missing in not being able to restart the wi-fi remotely? ]
    Thanks in advance

    You are likely forgetting a step.
    Open AirPort Utility
    Click on the Time Capsule icon
    Click Edit in the small window that appears
    Now click the Base Station menu.....top of the screen....not the Base Station "tab" in the center of the screen
    Click Restart

  • Help, I installed parallel and windows, and opened videos (on an external hard disk) with windows, and now cannot open them with Mac, and use i movies.  How do I reverse this?

    Help, I installed parallel and windows, and opened videos (on an external hard disk) with windows, and now cannot open them with Mac, and use i movies.  How do I reverse this?

    Paragraphs help the reader, just saying.
    What are you actually trying to do? Why do you need "DVD size" folders if you're creatng an Archive on an external hard drive?
    Also, I understand burning folders instead of individual photos or albums gives you more space on a DVD.
    It makes no difference at all.
    How can I keep the captions on my photos (not events) when I print or transfer to a new folder?
    You can export while writing the metadata to the file in most cases.
    Tne only way I know is to copy photos from the Windows to folders on my HD, then copy and paste photos or albums or events to HD, then create a new folder and fill it to the appropriate DVD size. 
    HD? Another HD? You use HD there in a way that makes no sense. What's the point of 'DVD size'?
    I also thought I should download future photos to my Canon programming that comes with EOS cameras and edit and then decide which photos to save to iPhoto library and which to save only to my archival HD?
    Does this have any relation to the previous questions? You know you can delete from iPhoto, right?
    You're somewhat confused and you need to
    1. Decide what exactly you want to do
    2. Then go about it.
    If I understand you correctly - and there's no guarantee that I do -  the easiest thing is to bring all your Photos into iPhoto and do everything from there.
    You can have an archive on an external disk, you can sort and select and edit with or via iPhoto
    Regards
    TD

  • I cannot encode .flv files from CS4 using AME

    I’m having a problem encoding .flv files from Adobe Media Encoder CS4. All the jobs in the encoder encode for a period of time then stop about a ¼ of the way through the file.
    I am encoding from a Matrox preset project at 1280x720p 59.94fps. Some clips have a luma corrector effect on them. After rendering, some clips will come up completely black on the timeline so I have decided to leave them unrendered. I don’t know if that is related to why I cannot encode a .flv file or not.
    The settings I’m using for the .flv are:
    .flv file, 720p, CBR, 3000kbps.
    What’s strange is that I have encoded other .flv files from these same timelines but all have been smaller in screen resolution. That is the only difference. I can also encode .flv files from other projects without issue.
    I don’t know why this is not working?  Who can Help?!!!

    OK, so if you do a quick SAVE AS to a new project, and remove the luma corrector, can you encode all the way through?
    I have no experience with Matrox so I won't "go there".
    MP

  • Re: Satellite U200-10K cannot send a single net package using Vista

    Hello.
    I'm sorry for the crossposting, but I really need your help.
    My Satellite U200-10K cannot send a single net package. I've connected the notebook (Windows Vista Home Basic) with other PC (Windows XP Professional SP2) and gave them both fixed IPs. Next I ping my U200 from that PC. Everything is Ok, the PC sends packages and gets answers. After that I try to do the same from the notebook. And in this case, the U200 cannot send anything to the PC, but can ping itself with its own IP. All fire walls and anti-virus programms are shut down.
    So at least, I need to know, is it a problem of Windows Vista or one of the network adapter, should I get the notebook to the service center?
    Thanks for help.
    Alexander.

    That's exactly what the trouble is. I cannot get the Internet to install any updates. I would try to download them from microsoft.com manually but there are millions of them, I have no chance to recognize what exactly I should install.
    The connection with the desktop-PC has been only a test. Actually, the problem appeared when I tried to connect to the Internet, using an ADSL-modem. The notebook gets an IP but can't connect even to the modem setup page (http://192.168.1.1) as well as it cannot ping anything except itself.
    I've configured the IPv4 protocol. IPv6 is new to me and I've left automatic settings. Another time, in the connection settings I dismarked all the points such as TCP/IPv6 and the others new in Vista, the result was the same.
    Now I incline to remove Vista and install Windows XP. If there's no changes after that, it means this is some kinda hardware troubles. Can I expect any particular problems, installing WinXP from a common OEM CD?

  • Intermittent error on login page when username is entered as a single quote( ' ) and tab is pressed.

    Hi All,
    We have an ADF based portal application which has a login page with Username and Password inputText field.
    When we type a single quote( ' ) in the Username field and press tab to go to the Password field an error is thrown saying "A connection to the server has failed" and this window does not close if we click on ok or the close option of the popup.
    This is causing serious problems for us. It would be great if anyone could help us out as to why this is happening or if anyone has experinced the same issue.
    Thanks,
    Tanya

    Hey Frank,
    Sorry for the delayed reply. Since the issue was a high priority one and had to fix it ASAP we didn't have time to analyse it further.
    We just inserted a javascript that prevented the form from getting submitted if a single quote is entered in the inputText field.
    So far it has worked for us.
    Thanks for your help though.
    Tanya

  • To display combination of single quotes and double quotes in textfield

    please send the code

    Do this:
    //put this into the head section
    <head>
    <script language="JavaScript">
    <!--
    function input(value){
    document.getElementById('textfield').value = value;
    //-->
    </script>
    </head>
    //put this into the body section
    <body>
    <input type="text" name="textfield" id=textfield value="">
    <br>
    input quotes for whatever reason
    </body>
    //read the following tread:
    http://forum.java.sun.com/thread.jsp?forum=45&thread=136985

  • I have a personal itunes account with an iPhone5s and an iPad 4 mini. I have unlokced my old iPhone 4 to use for work on a diffeent SIM and new number, can i have all devices associated to me single appleID and use both numbers ?

    I have a personal itunes account with an iPhone5s (perosnal mobile numer) and an iPad 4 mini (no SIMM). I have unlocked my old iPhone 4 to use for work on a different SIM and new number,
    Do you know if I can have all devices associated to my single apple ID and still use both numbers without messing up my profile. It has just changed my number over.

    I would not be able to give you idiot proof guide, since different games are different. Some of them have icloud integrated already, but those already taken care of. Some of them use specific logins and once you log - you get your info. General recommendation is to contact support sites of those games for enabling icloud instructions or enabling of transfer. There are other purely apple ways - like sync your phone in itunes and then sync apps with ipad, but those are only one time transfer. There is another way that is not typically recommended - restoring ipad from iphone backup. It may transfer your game content, but once again sync in the future has to be done by game.
    So if I were you, I would address that individually with every game provider.

  • Encoding is crazy slow and using hardly any CPU power

    I"m not sure what I'm doing wrong.  I have an animation I'm creating from Google SketchUp.  I've generated a lot of .jpg's to compile into an animation (about 9 minutes of animation at 30 fps).  I'm exporting them to h.264 format at something like 1080x720 resolution or so and it's been encoding for 10 hours now with another estimated 6 hours to go.  That seems ridiculously slow for 9 minutes of animations.
    I'd chalk it up to just being a long process (I don't use Premiere much) but it seems excesive and I have a very high end computer (intel 980x processor and a good workstation nvidia graphics card along with 18 gigs of RAM.  It's using something like 10 gigs of RAM but it's not even touching the CPU.  Does that make any sense?  Is there some setting I'm missing somewhere?
    -Brodie

    >generated a lot of .jpg's
    Did you read Photo Scaling for Video http://forums.adobe.com/thread/450798?tstart=0

  • Cannot load ipod mini software and use i pod

    HELP I have a sony vai0 older computer. I am giving it to my sister. It has a wireless card that uses the same port as the Hi speed 2.0 card. I do not have the original cd to load the ipod software. I have to take out the wireless card to use the 2.0 network card that is required for transfer. What am I to do. I cannot find the link to download the software necessary to load the Ipod. I have however loaded the latest version of I tunes

    It's not the software... millions of users have installed the same software on their iPod mini before you.
    I'm not sure what the "5 steps" are, so if you did not try a Reset
    http://support.apple.com/kb/ht1320 - How to reset an iPod with a Click Wheel
    you should try that first.  If you get back to being stuck at the Apple logo...
    One possibility is data corruption on the iPod's tiny hard drive.  Everything was still working OK as long as the old iPod software files on the iPod's hard drive stayed "as is."  When the update tried to replace the old iPod software files, the existing data corruption made it unsuccessful.  Now, the iPod cannot run its software.
    You should try a Restore on the iPod. This will erase the iPod, re-install the latest software, and set it to default settings.  Erasing will remove any data corruption, if that is the cause of the problem.
    Restore is done in iTunes from the iPod's Summary screen.  If the current problem does not allow the iPod to appear in iTunes, put it into Disk Mode first
    http://support.apple.com/kb/ht1363 - iPod devices with a Click Wheel
    If it goes into Disk Mode, connect it the computer and run iTunes.  Hopefully, iTunes will see it and allow you to try a Restore.

  • I cannot get ipad to synch and using vista

    just bought ann IPAD2 and am having trouble getting Vista to recognise device.  I have tried all the suggested tips on Apple and also tried using msconfig to trouble shoot conflicts but still no luck.  Would welcome any sugestions before I take IPAD2 back to the store ! Cheers

    Try a reset, hold the power button and home button until you see the apple then let go.

  • Help! Cannot be on the phone and use the keyboard.

    So let's say I call number and the demon operator asks me if I want English of Spanish. When I press a number nothing is happening... No sound of the number being pressed, and it does not show up on my screen. Hoping there's a fix for this and not a broken phone...

    Soon.
    <http://www.tuaw.com/2014/09/11/will-you-be-able-to-use-the-new-volte-service-on- your-new-iphone/>

Maybe you are looking for

  • Can no longer read "Comments" on New York Times website

    I updated Flash Player on Monday to the latest version, but today (Tuesday) find I can no longer read the "comments" attached to various articles on the NYT website.  Neither of our other home machines (an early iPad and a win7 laptop) have this prob

  • How to install iTunes on Windows 7 64-bit ?

    Hello everyone, I am having a problem installing iTunes on my Windows 7 64-bit system. I never installed it before on my computer. I read many threads before me but I can not solve the problem, so I hope someone kind enough can help me to install iTu

  • How do I add my friends birthdays to the pre installed "birthdays" calendar on my iPad 2

    I have added birthdays to the default calendar but there is a birthdays one and I want to put my friends birthdays on that calendar but it won't let me. When I look under calendars there is a calendar called birthdays under other but I can't use it.

  • LMS 4.1 Threshold Information problem

                       Dear all.                               Can i modify the information when violate threshold?                             Like : CiscoWorks HUM: Critical: Processor Threshold Violation: reset57.10 (Test) Host Name: vwapbjsrvlms001.a

  • SQL O/P 3 Vs 6

    create table t_look as select 1 a, 2 b, 3 c from dual union all select 1 a, 20 b, 3 c from dual union all select 1 a, 21 b, 3 c from dual union all select 1 a, 22 b, 3 c from dual union all select 1 a, 23 b, 3 c from dual union all select 1 a, 24 b,