Problem escaping '&' character in utl_http package..

I'm using utl_http package to download web pages without any problem if the URL is a regular one such as: http://www.oracle.com/etc/data.html
However, as in most cases, the data files are dynamically generated by cgi's, and look like:
http://xyz.data.com/cgi?n1=v1&n2=v2
Whenever I pass the above as a URL, Oracle thinks that I'm trying to pass a value to the variable d on the fly.
Escaping & with \ or {} did not help at all.
Does anybody have any suggestions?
Thanks
Cuneyt
[email protected]

hi,
try using " set scan off "
regards,
shravan

Similar Messages

  • Problem in Using Utl_Http package

    Hi to all,
    I'm trying to send the sms(Short Message Service) using utl_Http package. When I'm trying to run a sql statement like
    SELECT utl_http.request('http://www.oracle.com/index.html') FROM dual
    I'm getting an error message like this.
    The following error has occurred:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1577
    ORA-12545: Connect failed because target host or object does not exist
    ORA-06512: at line 1
    Pls help me to solve this problem.
    Regards,
    Alok Dubey

    Thank you for ur reply. Infact my database was not able to access the internet. currently, it is working fine.
    I'am using this code. It's works well.
    CREATE OR REPLACE PROCEDURE Send_Sms_Http
    AS
    text_str VARCHAR2(5000);
    V_Message VARCHAR2(200) := REPLACE('This is a DEMO SMS sent to u on '||TO_CHAR(SYSDATE,'DD/MM/RRRR HH12:MI:SS AM'),' ','%20');
    text_sms VARCHAR2(5000) := 'http://hapi.smsapi.org/SendSMS.aspx?UserName=xxxx&password=xxxx&MobileNo=xxxx,xxxxx&SenderID=xxxx&CDMAHeader=xxxxx&Message='||V_Message;
    BEGIN
    text_str := utl_http.request(text_sms);
    Dbms_Output.Put_Line('text_str = '||text_str);
    EXCEPTION
    WHEN OTHERS THEN
    Dbms_Output.Put_line('Error in sending the message'||SQLERRM);
    END;
    Regards,
    Alok Dubey

  • Query of Queries (QofQ) Escaped Character Problem

    Hello All,
    I'm trying to run a query or queires (QofQ) and I'm doing a
    LIKE comparison that looks for bracket characters ([ ]) within a
    string, however ColdFusion is ignoring the brackets. How can I
    escape the bracket character? So far I have only been able to
    escape the percent sign based on the ColdFusion Live Docs. The
    error message I get when I run the query below is:
    Invalid Escape Sequence. Valid sequence pairs for this escape
    character are: "\%", or "\_".
    Here is the query:
    <cfquery dbtype="query" name="getLogs">
    SELECT *
    FROM GetLogs
    WHERE Description LIKE '%\[User:#UserID#\]%' ESCAPE '\'
    </cfquery>
    Thanks for your help!

    You are correct. If you leave the brackets in the LIKE
    statement, it will return results as if the brackets weren't there
    at all.
    Perhaps I need to figure out the ASCII character value of the
    bracket and include it that way i.e. #Char(?)# where the question
    mark would be the numerical value of that character.
    My temporary solution has been to leave off the starting
    bracket:
    <cfquery dbtype="query" name="getLogs">
    SELECT *
    FROM GetLogs
    WHERE Description LIKE '%user:#UserID#]%'
    </cfquery>
    This has (so far) returned the results i'm looking for
    although its not as 100% accurate without that beginning [ in the
    LIKE statement.

  • Generating JavaDoc returns with "illegal escape character"

    Hello,
    I'm using JDeveloper 10.1.2.0.0.
    I'm trying to generate JavaDoc for a couple of my packages.
    The generator returns 2 errors due to "illegal escape character".
    This is the error message :
    C:\MyDocs\General Procs\Start_Java_Package\Portlets\src\PortletsUtils\Utils.java:65: illegal escape character
    + ".replace(/\à/g,\"a_accent\")"
    ^
    C:\MyDocs\General Procs\Start_Java_Package\Portlets\src\PortletsUtils\Utils.java:66: illegal escape character
    + ".replace(/\ç/g,\"c_cedile\")"
    ^
    The error is on the "à" and "ç".
    This special character is within a double quote, so it should be text for him.
    Compiling the package is no problem.
    What can I do so the generation of my javadoc continues ?
    Thanks a lot.
    Filip Huysmans.

    Because you don't escape the "\".
    String mypattern = "(<img\\w*)";

  • Error while using utl_http package

    Hi Guys,
    I need some help with the utl_http package
    The problem that Iam facing is as follows :
    Iam trying to use the Oracle provided package utl_http
    package to send an http request to a particular
    website.However Iam getting the request_failed
    exception.
    I type in the foll.command in sqlplus:
    select utl_http.request('http://www.oracle.com') from
    dual
    and I get the foll.error---
    ERROR at line 1:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "SYS.UTL_HTTP", line 174
    ORA-06512: at line 1
    If I try and trap the exception it shows
    request_failed exception.
    If any one has any clue on how to resolve this -- >please reply ASAP .
    Thanks

    Is it possible that your database sits behind a firewall? If so, you need to specify the proxy in utl_http.request.

  • Urgent Help - in using Escape character

    hai,
    i have problem in using escape character..
    can anyone help me out in the same...
    sb.append(<jsp:getProperty name="resume_main" property="name"/>);
    //error i am getting is -- Missing term, ')' expected.
    pl help me out in using the escape character in the above statement.
    thanx in advance
    regards
    koel

    try
    sb.append("<jsp:getProperty name='resume_main' property='name'/>");
    or
    sb.append("<jsp:getProperty name=\"resume_main\" property=\"name\"/>");
    both will work

  • Problem when using utl.http package

    hello,as subject above,i have a problem with that package
    set serveroutput on
    DECLARE
    req   utl_http.req;
    resp  utl_http.resp;
    value VARCHAR2(32000);
    BEGIN
    req := utl_http.begin_request('http://www.psoug.org');
    resp := utl_http.get_response(req);
    value := utl_http.request('http://www.psoug.org/');
    dbms_output.put_line(value);
    utl_http.end_response(resp);
    EXCEPTION
    WHEN utl_http.end_of_body THEN
    utl_http.end_response(resp);
    END;
    i tried to create ACL
    BEGIN
    DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(acl         => 'www.xml',
    description => 'WWW ACL',
    principal   => 'SYSTEM',
    is_grant    => true,
    privilege   => 'connect');
    DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl       => 'www.xml',
    principal => 'SYSTEM',
    is_grant  => true,
    privilege => 'resolve');
    DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(acl  => 'www.xml',
    host => '127.0.0.1');
    END;
    COMMIT;
    but it still show error
    Error report:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1722
    ORA-29270: too many open HTTP requests
    ORA-06512: at line 9
    *29273. 00000 - "HTTP request failed"*
    **Cause: The UTL_HTTP package failed to execute the HTTP request.*
    **Action: Use get_detailed_sqlerrm to check the detailed error message.*
    Fix the error and retry the HTTP request.
    Thank

    check
         Why ORA-29270 'Too Many Open HTTP Requests' occurs with UTL_HTTP? [ID 961468.1]
    The database server has a hardcoded limit of 5 open HTTP connections per session.

  • Bypass Adapter URI Endpoint with Escape Character for Web Service

    Dear All,
    I would like to apply by pass adapter URI Endpoint for XI webservice, the default format is
    http://<host>:<port>/sap/xi/engine?type=entry&version=3.0&Sender.Service=<BusinessService>&Interface=<namespace>^<Outbound Interface name>
    If I am using format using with carat () character then there has no problem to the service, but consumer doesn't support carat () character. I instead the carat (^) with URL Escape Character (%5E)
    http://<host>:<port>/sap/xi/engine?type=entry&version=3.0&Sender.Service=<BusinessService>&Interface=<namespace>%5E<Outbound Interface name>
    Then error occurred
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP:Body>
          <SOAP:Fault>
             <faultcode>SOAP:Server</faultcode>
             <faultstring>System Error</faultstring>
             <detail>
                <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
                   <context/>
                   <code>RCVR_DETERMINATION.MESSAGE_INCOMPLETE</code>
                   <text>Message is incomplete. No Sender found</text>
                </s:SystemError>
             </detail>
          </SOAP:Fault>
       </SOAP:Body>
    </SOAP:Envelope>
    How to resolve this error...
    Thank you.
    Regards,
    Weng

    Hi ,
    as per my knowledge.....................
    When you create a WSDL with the help of a wizard. In the Integration Directory, choose Tools -> Define Web Service to enter the wizard.
    On Propose URL button, as this genertated URL default Point to Entegration Engine.. SO already proformance wise Good.
    If You want to Point your URL to adapter engine , use below given URL this will point ur incoming soap  message to SOAPadapter sender channel
    http://<host>:<j2ee-port>/XISOAPAdapter/MessageServlet?channel=:<service>:<channel>.
    Regards
    Prabhat Sharma.

  • Can Linux recognize the escape character?

    Hi,
    It's possible that this problem doesn't belong here. But please give it a try.
    I am developing an project using JSP. It includes image uploading. after image uploading, I use a javascript function popUp(url, ...) to open a new window and display this image. The very strange thing is that, sometimes the link can work, open a new window and display the image while sometimes the link can't work, or it only works for one time, then it fails. I couldn't find the reason yet. it works on IE, and not on Netscape and also not work on Linux OS while do work on Window2000. Can somebody take a look at the following link and tell me how to change it to make sure it is work on Linux OS and netscape. What's the difference between OS and windows to specify a String(that is, url of a link). The linux OS seems interperte \" to ", so it cannot recognize the full url.
    The link is :
    imageLink[i] = "<a href='showForm' onclick=\"popUp('" + request.getContextPath() + "/displayForm.jsp?filename=" + sdb.getImageFileName(i)+"&fileDesc=" +sdb.getImageDesc(i) + "', 'showForm', '600', '450', 'yes'); return false;\">"+sdb.getImageDesc(i)+"</a>";
    Thanks in advance!
    jmling

    Linux will recognize the escape character. It looks like you might have other difficulties with your imageLink tag. For example, I think you need to use tags when you use Java inside your html or javascript..
    onclick=\"popUp(" + <%= request.getContextPath() %> + "/displayform.jsp?...

  • How to use escape character in update statement.

    Hi All,
    I'm trying to update table using following sql update statement, but everytime it's asking me for the input due to the '&' value in below sql.
    UPDATE xyz_xyz
       SET NAME = 'ABC & PQR'
    WHERE ID = (SELECT ID
                   FROM abc_abc
                  WHERE NAME = 'C & PQR');Please let me know how to use escape character syntax or let me know if there is any alternative solution.
    Thanks,
    Vishwas

    Hi,
    By default, & marks a substitution variable name.
    If you're not using substitution variables in that statement (or, if this is in PL/SQL, in that entire package or procedure) then the easiest thing to do is just diable substitution variables; then & will be a normal character:
    SELECT  DEFINE  OFF
    UPDATE xyz_xyz
       SET NAME = 'ABC & PQR'
    WHERE ID = (SELECT ID
                   FROM abc_abc
                  WHERE NAME = 'C & PQR');
    SET  DEFINE  ONIf you can't do that, then & is always taken literally if it comes right before a single-quote, so you could say:
    UPDATE xyz_xyz
       SET NAME = 'ABC &' || ' PQR'
    WHERE ID = (SELECT ID
                   FROM abc_abc
                  WHERE NAME = 'C &' || ' PQR');There is a SQL*Plus "SET ESCAPE" command, too, but if you use it, you have to worry about whether the escape character is to be taken literally or not.
    SET   ESCAPE  \Yet another alternative is to make some other character, such as ~, mark the substitution variables:
    SET  DEFINE  ~Read all about them in the SQL*Plus manual.
    http://download.oracle.com/docs/cd/B28359_01/server.111/b31189/ch2.htm#sthref103

  • Escape Character in ODBC Connections?? HELP!

    Hi All,
    I have a problem : we have a C++ app here that is supposed to attach to an Oracle 8i or 9i database here via a standard ODBC connection.
    When this app attempts to do something like this:
    INSERT INTO MyTable (MyRow) Values('[testing]')
    it fails - it does not like the square brackets in the command. when I copy this into SQL Plus, of course, it runs just fine.
    the ODBC link also doesn't like this:
    INSERT INTO MyTable (MyRow) Values('/[testing/]') either
    or this:
    INSERT INTO MyTable (MyRow) Values('[[testing]]') either
    or this:
    INSERT INTO MyTable (MyRow) Values('`testing`') either
    in fact, it appears the following are all reserved characters that oracle's ODBC driver can't handle:
    ` ' " \ / [ ]
    My questions are :
    1) Can I find a definitive list of these (Oracle documentation is good on reserved WORDS, but poor on reserved CHARACTERS)
    2) what can I use to set an escape character within my ODBC SQL? Is this something I can tweak on the ODBC DSN cofiguration? I know in SQL*Plus you can just say
    SET ESCAPE ON
    SET ESCAPE "\"
    But you can't do that on every SQL Query getting sent through ODBC can you?
    Please help!
    I

    Thanks, but thats not really answering the two
    questions I posed, is it? Well you are asking the wrong questions.
    The quoted example was just
    that, an example. The actual app is calling stored
    procedures and not doing simple SQL statements. Using
    bound variables is not really an option because the
    number and type of parameters being sent down change
    continually. This is no reason to not use bind variables. If you do not use bind variables and this is an OLTP database then scaling will not be an option for your application. It can also raise potential security holes due to SQL injection.
    The site you quoted is to do with
    obtaining recordsets back from stored procedures. We
    do not need to obtain recordsets back from stored
    procedures. Yes and it also shows how to bind input variables in ODBC calls, does the presence of record sets somehow render this invisible?
    >
    shall I repeat myself:-
    My questions are :
    1) Can I find a definitive list of these (Oracle
    documentation is good on reserved WORDS, but poor on
    reserved CHARACTERS)
    As you can run the command in SQL*Plus it should indicate that it is not a reserved character as far as Oracle is concerned. Therefore looking in the Oracle documentation will not get you anywhere. You will need to refer to the documentation for your ODBC driver and the ODBC specification.
    2) what can I use to set an escape character within
    my ODBC SQL? Is this something I can tweak on the
    ODBC DSN cofiguration? I know in SQL*Plus you can
    just say
    SET ESCAPE ON
    SET ESCAPE "\"
    I must admit I don't know.

  • Using Escape character for Multi character delimiter for flat files in IKM

    Hi
    I have an IKM using Jython, it is working fine for single character delimiter. But as per requirement I have to use multicharacter delimiter ;" (semi colon and double quotes).
    I am taking this into variable using
    filesep = "<%=snpRef.getSrcTablesList("", "[SFILE_SEP_FIELD]", "", "")%>"
    but it is giving lexical error.
    Can anybody help me with the use of escape character in current scenario?
    Any other suggestions are also appreciated.
    Thanks
    Ankit

    Hello,
    A small tweak may solve your problem:
    Instead of :
    CONCATENATE wa_condstr ' bukrs = ' pa_bukrs INTO wa_condstr SEPARATED BY space.
    Use:
    CONCATENATE wa_condstr ' bukrs = ' 'PA_BUKRS' INTO wa_condstr SEPARATED BY space.
    Then use this in SELECT.
    Anyways for your answer the escape character for apostrophe is an apostrophe )
    Try this you will understand:
    DATA:
    V_STR TYPE STRING VALUE ''''.
    WRITE: V_STR.
    BR,
    Suhas

  • HTML Entity Escape Character Conversion

    Requirement is to Convert UTF-8 encoded Speciual language characters to HTML Entity Escape Character's. For example In the source I have a Description field with value "Caractéristiques" which is 'Characteristics' in French, This needs to be converted to "Caractéristiques" when sent to the Reciever.i.e the Special Language Symbols like é = é (in HTML Entity format.)
    Below is the Link for a List of HTML Entity Char's
    http://www.theukwebdesigncompany.com/articles/article.php?article=11
    could anybody please suggest how this can be achieved in mapping...any UDF or Encoding techniques...?
    many Thanks.

    Hi Veera
    this is ajay
    code for ur problem
    String ToHTMLEntity(String s) {
              StringBuffer sb = new StringBuffer(s.length());
              boolean lastWasBlankChar = false;
              int len = s.length();
              char c;
              for (int i = 0; i < len; i++) {
                   c = s.charAt(i);
                   if (c == ' ') {
                        if (lastWasBlankChar) {
                             lastWasBlankChar = false;
                             sb.append(" ");
                        } else {
                             lastWasBlankChar = true;
                             sb.append(' ');
                   } else {
                        lastWasBlankChar = false;
                        // HTML Special Chars
                        if (c == '"')
                             sb.append("&quot;");
                        else if (c == '&')
                             sb.append("&amp;");
                        else if (c == '<')
                             sb.append("&lt;");
                        else if (c == '>')
                             sb.append("&gt;");
                        else if (c == '
                             // Handle Newline
                             sb.append("&lt;br/&gt;");
                        else {
                             int ci = 0xffff & c;
                             if (ci < 160)
                                  sb.append(c);
                             else {
                                  sb.append("&#");
                                  sb.append(new Integer(ci).toString());
                                  sb.append(';');
              return sb.toString();
    rewrd points if it help u

  • How to escape "&" character ?

    I want to execute the following statement in sqldeveloper
    select '&sdfas' from dual
    and expect the outcome to be the string "&sdfas"
    but sqldeveloper keep asking me for the value of "sdfas" argument, and replace it.
    I use sqldeveloper to run sql script to patch many pl/sql packages in my company. The packages, unfortunately, contain some "&" characters in rather critical position. And my last few days is spent chaotically trouble-shooting this.
    Any method to escape "&" character ? I tried to export DDL with sqldeveloper itself but the outcome is still not being escaped properly.

    Sake,
    You can use the following to escape the &:
    set define off
    It's also possible to set another character to use for substitution variables.
    See the online documentation: http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12040.htm#i2698854

  • Why isn't SQL+ liking my escape character?

    I'm trying to right a script that utiilizes the escape character in the PROMPT statement.
    I have tried to reset the escape character to * or ! and the output comes out funky.
    Here's what happens:
    ttThis is the original.
    This output is the result of the lines:
    SET ESCAPE !
    PROMPT !t!tThis is the original.
    What seems to be the problem? Can someone please help?

    SET ESCAPE sets a charater that will escape the special meaning of some characters in sqlplus.
    SQL> SELECT 'Ben & Jerry' FROM dual;
    Enter value for jerry:
    SQL> SET ESCAPE \
    SQL> SELECT 'Ben \& Jerry' FROM dual;
    'BEN&JERRY'
    Ben & JerryI'm not aware of any way to "format" the output of PROMPT, since sqlplus always trims the spaces.
    John

Maybe you are looking for