Escaping the "&" character

Hi,
I am using a shuttle item that retrieves data for the left shuttle list using an Ajax call but where the data has an ampersand ("&") in it, seems to prevent all of that data set appearing.
Can someone please suggest the best approach to prevent this from happening so that any information that has a ampersand ("&") between data, functions correctly - basically need to escape the "&".
Thanks.
Tony.

I only think that worked for me was to use TRANSLATE.
select translate(column, '&','+') from table
Then I was able to get the data displayed (P.S., you should also transalte quotation marks (single and double) as well.
Robert

Similar Messages

  • Escaping the ' character in XPath expression

    I have noticed that the following string expression gets modified by BPEL Designer which does not preserve the escaped ' character, instead it interprets it and the string gets chopped at that position.
    <from expression="'select &ap0s;National&ap0s; as supplier,ItemNo as itemCode, unit, "Cat Level 3" as description1, Description as description2, cost from National'">
    I have deliberately changed the spelling in the example above to stop this message post from interpreting the escape characters.

    &lt;from expression="'select &ap0s;National&ap0s; as
    &gt; supplier,ItemNo as itemCode, unit, "Cat Level 3" as
    &gt; description1, Description as description2, cost from
    &gt; National'"&gt;
    &gt;
    &gt; I have deliberately changed the spelling in the
    &gt; example above to stop this message post from
    &gt; interpreting the escape characters.
    &gt;
    The expression part does not seem to be syntactically valid. The &ap0s; entity is replaced to ' by the XML parser and what we get to hand over to the XPath engine is most likely
    'select 'National' as supplier,ItemNo as itemCode, unit, "Cat Level 3" as description1, Description as description2, cost from National'
    So technically, the first string is 'select ' , right ?
    In order to solve your problem you can do the following (o replaced by 0)
    1. Use &qu0te; instead of &ap0s; in the string to quote the column names from the query. That way you will have
    2. Do the reverse, that is make your string
    if you need single quotes in your SQL string

  • How to escape the character in a string?

    I have the following code that is causing an error. I'm
    attempting to use < (less than) character in a string that is
    part of a dynamic query:
    <cfif url.age eq 1>
    <cfset askAge = " < 15">
    <cfelseif url.age eq 10>
    <cfset askAge = " Between 56 and 60">
    <cfelseif url.age eq 11>
    <cfset askAge = " > 60">
    </cfif>
    The error occurs as a result of the line <cfset askAge = "
    < 15">. The > 60 works fine. What I need is to build the
    SQL statement SELECT * FROM myTable WHERE age < 15
    ColdFusion sets the string properly but when I try to run the
    query I guess it thinks I'm trying to open a tag. The exact error
    is:
    The content beginning "< " is not legal markup. Perhaps
    the " " (&#20;) character should be a letter.
    The content beginning "< " is not legal markup. Perhaps
    the " " () character should be a letter.
    I can't use the ASCII code for this character as the database
    will obviously crap out.
    Any help would be greatly appreciated and many thanks in
    advance.
    Dave

    Dave,
    What if you passed off the output of the lt/gt symbols to the
    query itself?
    Something like,
    <cfif url.age eq 1>
    <cfset compareOperator = "less"/>
    <cfset askAge = "15">
    <cfelseif url.age eq 10>
    <cfset compareOperator = "between"/>
    <cfset askAge = " 56 and 60">
    <cfelseif url.age eq 11>
    <cfset compareOperator = "greater"/>
    <cfset askAge = "60">
    </cfif>
    Then in the query:
    <cfquery name="qTest" datasource="dsn">
    SELECT * FROM myTable
    WHERE age
    <cfswitch expression="#compareOperator#">
    <cfcase value="less">
    <
    </cfcase>
    <cfcase value="greater">
    >
    </cfcase>
    <cfcase value="between">
    BETWEEN
    </cfcase>
    <cfdefaultcase>
    =
    </cfdefaultcase>
    </cfswitch>
    #askAge#
    </cfquery>
    Probably a better way, at least a more efficient way, but
    just a thought...cfswitch processed pretty quickly and this would
    remove any issues with trying to use <> symbols.
    Cheers,
    Craig

  • How to escape the special character ' (ascii 39) in a select query?

    Hi,
    does anybody know how to escape the special character ' (ascii 39) in a select query?
    I've tried a lot of ways but nothing seems to work, for example I try to get all
    names in table foo where coloumn name contains a '-sign (ascii 39)
    select name from foo where name like '%\'%';
    select name from foo where name like '%{'}%';
    select name from atg_horse where name like '%chr(39)%'
    ... but neither works, I end up with a ORA-01756: quoted string not properly terminated
    I would apriciate any help
    /Carl-Michael

    friends
    thanks for ur time and effort that u gave to reply to my problem.
    But my main problem is that when my application (VC++ 7) fires the following query in the oracle database , it does not return any rows.
    SELECT count(*) FROM ORGANISATION WHERE UPPER(ORGANISATION.ORGANISATIONNAME)
    LIKE N'&#946;%' ORDER BY ORGANISATION.ORGANISATIONNAME
    the above question in the previous thread was just to check on sql plus as it's editor does not support unicode characters.

  • How to escape the special character ' (ascii 39) in a query

    Hi,
    does anybody know how to escape the special character ' (ascii 39) in a select query?
    I've tried a lot of ways but nothing seems to work, for example I try to get all
    names in table foo where coloumn name contains a '-sign (ascii 39)
    select name from foo where name like '%\'%';
    select name from foo where name like '%{'}%';
    select name from atg_horse where name like '%chr(39)%'
    ... but neither works, I end up with a ORA-01756: quoted string not properly terminated
    I would apriciate any help
    /Carl-Michael

    Use two single quotes inside your literals to represent one single quote.
    For example, this would find my name:
    SELECT *
      FROM emp
    WHERE name = 'Michael O''Neill';
    Michael O'Neill
    (acutely aware of the apostrophe issues in the world)

  • Escaping the pipe (|) character in java

    Hi,
    I am trying to run the following command in java
    ps -ef -o pid,args | grep init | grep -v grep
    The code is
           try {
                    Runtime rt = Runtime.getRuntime();
                    Process pr = rt.exec("ps -ef -o pid,args \\| grep init \\| grep -v grep ");
                    BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
                    String line=null;
                    while((line=input.readLine()) != null) {
                        System.out.println(line);
                    int exitVal = pr.waitFor();
                    System.out.println("Exited with error code "+exitVal);*/
                } catch(Exception e) {
                    System.out.println(e.toString());
                    e.printStackTrace();
                }I am not able to run this command in Java. And, I guess the problem lies in escaping the pipe symbol. I am not sure how to do that. Can anyone please help me on that?
    Thanks,
    Juggie

    The problem is not escaping; it's that the pipe character is interpreted by the shell. You should be passing that command line to the shell, e.g. "sh ps -ef -o pid,args | grep ..."

  • Using html in cf report builder and escaping the & ampersand character

    Some of the data we collect is entered via a WYSIWYG editor.  Therefore formatting such as bold, italic etc is translated into HTML.
    The text could also contain special characters/accented characters, again these are translated into their html equivalents.
    In CF Report Builder, I have set the XHTML Text formatting to TRUE.  However the report won't render the text in these boxes.  From what I can see it doesn't like the '&' character (ampersand).
    I have read elsewhere that report builder is limited in the characters etc that it can read and that I should translate the values.  I ended up doing this in the database to try and save some time.
    CREATE  OR REPLACE FUNCTION translatexhtmltoasci(var_text IN appendix3%TYPE)
      RETURN clob
    ISvar_translated_text clob;BEGIN
     select  replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(re place(replace(
      replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(re place(replace
      (replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(r eplace(replace
      (replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(r eplace(replace
      (replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(r eplace(replace
      (replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(r eplace(replace
      (replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(r eplace(replace
      (replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(r eplace(replace
      (replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(r eplace(replace
      (replace(replace(replace(replace(replace(replace(replace(replace(replace(
    var_text , chr(38) || 'lt;', chr(60))
      , chr(38) || 'gt;', chr(62))
      , chr(38) || 'euro;', chr(49792))
      , chr(38) || 'iexcl;', chr(49825))
      , chr(38) || 'cent;', chr(49826))
      , chr(38) || 'pound;', chr(49827))
      , chr(38) || 'curren;', chr(49828))
      , chr(38) || 'yen;', chr(49829))
      , chr(38) || 'brvbar;', chr(49830))
      , chr(38) || 'uml;', chr(49832))
      , chr(38) || 'copy;', chr(49833))
      , chr(38) || 'ordf;', chr(49834))
      , chr(38) || 'laquo;', chr(49835))
      , chr(38) || 'not;', chr(49836))
      , chr(38) || 'shy;', chr(49837))
      , chr(38) || 'reg;', chr(49838))
      , chr(38) || 'macr;', chr(49839))
      , chr(38) || 'deg;', chr(49840))
      , chr(38) || 'plusmn;', chr(49841))
      , chr(38) || 'sup2;', chr(49842))
      , chr(38) || 'sup3;', chr(49843))
      , chr(38) || 'acute;', chr(49844))
      , chr(38) || 'micro;', chr(49845))
      , chr(38) || 'para;', chr(49846))
      , chr(38) || 'middot;', chr(49847))
      , chr(38) || 'cedil;', chr(49848))
      , chr(38) || 'sup1;', chr(49849))
      , chr(38) || 'ordm;', chr(49850))
      , chr(38) || 'raquo;', chr(49851))
      , chr(38) || 'frac14;', chr(49852))
      , chr(38) || 'frac12;', chr(49853))
      , chr(38) || 'frac34;', chr(49854))
      , chr(38) || 'iquest;', chr(49855))
      , chr(38) || 'Agrave;', chr(50048))
      , chr(38) || 'Aacute;', chr(50049))
      , chr(38) || 'Acirc;', chr(50050))
      , chr(38) || 'Atilde;', chr(50051))
      , chr(38) || 'Auml;', chr(50052))
      , chr(38) || 'Aring;', chr(50053))
      , chr(38) || 'AElig;', chr(50054))
      , chr(38) || 'Ccedil;', chr(50055))
      , chr(38) || 'Egrave;', chr(50056))
      , chr(38) || 'Eacute;', chr(50057))
      , chr(38) || 'Ecirc;', chr(50058))
      , chr(38) || 'Euml;', chr(50059))
      , chr(38) || 'Igrave;', chr(50060))
      , chr(38) || 'Iacute;', chr(50061))
      , chr(38) || 'Icirc;', chr(50062))
      , chr(38) || 'Iuml;', chr(50063))
      , chr(38) || 'ETH;',

    I also stuck with this . Still no answer, no solution

  • Escaping the comment character

    I need to include the following in a string but can't get it to escape the comments characters.
    " select /*+ORDERED*/ field1 ... ";
    Thanks in advance,
    Grey

    The comment characters ("/*" and "*/") shouldn't need to be escaped within the context of a String value; is it the compiler that is having trouble with the value, or the database? What error messages are you receiving?

  • IR Report "Link" Attibute Custom URL Escape : (colon) Character

    <h2>I am running Apex 4.0.2 and have an interactive report page 242 with a result set.</h2>
    Scenario
    In the "Report Attributes" "Link" settings I want to link the report to a 'Custom URL' target to take the user from this IR Report Page 242 to page 243 to a 'Single Record Data Entry Form'
    I am setting the value of the custom url target as:
    f?p=&APP_ID.:243:&SESSION.::&DEBUG.:243:P243_NAME,P243_DESCRIPTION,P243_LOCATION:#SOURCE_NAME#,#DESCRIPTION#,#LOCATION#:The P243_LOCATION column, however, has a ':' colon and a '.' values in the database column itself with a value of *'jdbc:Host123.abcd'*
    When the user clicks on the link the FULL location column is truncated before the ':' - OBVIOUSLY due to ':' being the paremeter separator column in apex
    So, the #LOCATION# value on Page 242 IR Report containing a value of *'jdbc:Host123.abcd'* is trunced on the called page 243 as 'jdbc' only and truncated prior to the ':' value contained in the field.
    Question:
    HOW Can I build the above URL so that the ':' can be visible on the Page 243 form field? with the full value passed into the called page with a value of: *'jdbc:Host123.abcd'* ?
    I tried the SYS.htf_esc(#LOCATION#) around the calling URL above, but doesn't work as expected.
    Any advice is greatly appreciated.
    VSK

    Hi,
    You can not escape colons but you can pass commas in the url. Enclose the item value in \item_value\ to escape the "," in the item value . For colons, I would suggest creating a hidden field in the source report with SQL REPLACE function and replace all the colons with any other character like ||. Then you can use the same replace function on the target page to match with the new item value.
    Hope it helps. Thanks.
    Regards,
    Manish

  • How to escape the single quote from email value?

    Hi,
    Is there any way to escape the special character single quote from the email value.
           String ownerQry = "Select Id, email from User where email in('0000'";
            for(int i=0; i<accountData.length; i++)
                ownerQry += ",'" + accountData.TEAM_EMAIL+"'";
    ownerQry += ")";
    QueryResult qrTeam = sfdcCtrl.query(ownerQry);
    When i tried to set the email value on a custom object, its throwing the error as below  and failed to update. <xml-fragment xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><faultcode>sf:MALFORMED_QUERY</faultcode><faultstring>MALFORMED_QUERY:
    '[email protected]','brenden.o'[email protected]','[email protected]'
    ^ ERROR at Row:1:Column:963 expecting a right parentheses, found 'connor'</faultstring><detail><sf:fault xsi:type="sf:MalformedQueryFault" xmlns:sf="urn:fault.enterprise.soap.sforce.com"><sf:exceptionCode xmlns:sf="urn:fault.enterprise.soap.sforce.com">MALFORMED_QUERY</sf:exceptionCode><sf:exceptionMessage xmlns:sf="urn:fault.enterprise.soap.sforce.com">
    '[email protected]','brenden.o'[email protected]','[email protected]'
    ^ ERROR at Row:1:Column:963 expecting a right parentheses, found 'connor'</sf:exceptionMessage><sf:row xmlns:sf="urn:fault.enterprise.soap.sforce.com">1</sf:row><sf:column xmlns:sf="urn:fault.enterprise.soap.sforce.com">963</sf:column></sf:fault></detail></xml-fragment>

    Thanks Dr.Clap.
    I think its very tricky to implement this.
    Here is the SOQL query. i am passing all the email values.
    Select Id, email from User where email in('0000','o\'[email protected]','[email protected]')
    These values are coming from oracle DB table in the form of array accountData[].TEAM_EMAIL
            String ownerQry = "Select Id, email from User where email in('0000'";
            for(int i=0; i<accountData.length; i++)
               ownerQry += ",'" + accountData.TEAM_EMAIL+"'";
    ownerQry += ")";the array value may contain the email with single quote before @gmail.com which i need to ignore. :-( i think this is very tricky. who knows the solution for this?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to escape newline character(nl) in file content conversion parameter?

    Hi Experts,
    How to escape newline character(nl) in file content conversion parameter?
    For example:
    field1field2field3
    field4field5field6
    Means Item is splitted in two lines.
    I want to SKIP new line character
    and to collect all SIX fields.
    What will be the file content conversion parameter?
    Thanks in Advance..........

    Hi,
    as far as i know there is nothing in the standard. But the question is why dont you combine at mapping the fields into only structure?
    Regards,
    Udo

  • Replacing the \ character in a string

    I'm having trouble replacing a backslash in a string. I use .indexOf() to find the character, but I have to use an escape character and write .index("\\"), but it doesn't work - it returns -1.
    Also, replace() doesn't work - gives me an java.util.regex.PatternSyntaxException. Any ideas?
    thx

    The escape is for the compiler, I think, and then you need to escape the backslash.
    Try "\\\\".
    � {�                                                                                                                                                                                                           

  • Having the '\' character in a string

    I get errors when I try to construct a string, say like this:
    String blahblah = new String("IBM\ROOT\IMAGE");
    Basically it seems like I can't store that '\' character in a string at all. Is this true?
    Thanks in advance.

    the '\' character is used to indicate an escape sequence, used for things like '\n' (new line). To do what you want you can do this:
    String blahblah = new String("IBM\\ROOT\\IMAGE"); //notice the double slash '\\' you would also have to do this for double and single quotes, e.g. ( new String("Bill said, \" Anne told me to \'go home now\'\"") : for... Bill said, "Anne told me to 'go home now'")

  • Jaxp fails to unmarshall xml document if it contaions the "&" character

    Hi,
         We are using JAXB in our applications and have recently experienced a problem
    with parsing of xml document ( when calling unmarshall method of jaxb ). The problem occurs
    when the xml element contains the character & in it f.eks. "Hennes & Maiurets" then it fails to parse
    the xml document. We would be very greatful if you could suggest us any workaround.
    Thanks in advance
    Sazzadul

    That's because it's not an XML document. A well-formed XML document cannot contain the & character by itself in a text node, it must be escaped as &amp;. XML parsers will do this automatically, but if you are producing your own XML via ordinary string output, you have to handle this escaping yourself. And the same goes for the other four markup characters.

  • SQLPLUS 9.2 on Windows and the "&" character

    Running Windows XP SP@ and SQLPlus 9.2
    using the Insert statement and text with "&" within single quotes within the Insert Statement
    The insert pauses and asks for input from the screen and removes the "&" character and the text after it.
    I tried escape: "\&" with no lock..
    How can I insert the "&" character within a text field delimited by single quotes?
    Thanks

    Type SET DEFINE OFF in your SQL*Plus session before executing the insert statement.
    chris@XE> SHOW DEFINE
    define "&" (hex 26)
    chris@XE> SET DEFINE OFF
    chris@XE> SHOW DEFINE
    define OFF
    chris@XE> Message was edited by:
    Stain

Maybe you are looking for

  • Problem with Socket Programming

    Hi I have used java sockets in my program for installing a tool on different boxes.On running this server program on a linux box my client program is unable to listen to the socket on the linux box.It give a ConnectionRefused exception in the client

  • Best video converter?

    I'm trying to convert multiple HD .mov files but they end up unuseable in Premiere. I've tried many different output formats but none of them seem to work. Super converter is pretty good but I can't seem to get the orignal size of the video. it's loc

  • Parsing CSV to Oracle columns

    Hi Gurus, Need a help from you. I have a table(say, INSERT_CSV) in which a column(say, CSVFILE) with CLOB datatype is present. That column consists of a file in CSV format stored in as a CLOB. Another table(Say, RGDEMO) has three columns (Employee_na

  • Strange problem with Simulator

    Hello Everyone: I was wondering if anyone was having difficulty getting the 2.1 OS to run in the simulator. After updating, I changed my apps to build a 2.1 OS Simulator executable and they run fine, but the IPhone Simulator does not start in the 2.1

  • Limited definition knowledge

    Hi, I just came across the following issue with the IDE: CVI provides a nice feature 'Go To Definition', surprisingly it seems not to always work... The test case: In the call to viFindRsrc ( ) I have tried the following regular expression: "ASRL?*IN