Single Quote causing problem in XPATH

The workflow was working fine until one of the fields had a single quote in the string and caused the update action to stall.
Using the Execute SQL query module I am updating data in an Oracle table. The query looks like this
UPDATE GSI_FEEDBACK_FORM_HEADERS
SET SITE_STREET = '{$ /process_data/xfaform/object/data/xdp/datasets/data/form1/Details/site_street $}',
SITE_STREET2 = '{$ /process_data/xfaform/object/data/xdp/datasets/data/form1/Details/site_street2 $}'
One of the forms had the street value
"Connah's Quay Deeside". I figured out that the single quote is causing the module to read it as the end of the XPATH, hence causing a "SQL command not ended properly" error.
Any suggestions to oversome this issue.
Aditya

No problem
It also:
Makes your SQL look much neater.
You can type in "test" values for the parameters, so that you can test your SQL statement and see the results.
Howard
http://www.avoka.com

Similar Messages

  • Sqlj and jdbc in a single program causing problems

    I am using both sqlj and jdbc in a single program(servlets) but after insatiaitng this program my other sqlj programs are not working while the JDBC pgms are working . Why is it so? How can I remedy it?

    Unfortunately, this description is still rather unspecific.
    It sounds, as if there might be an issue with the way database connections are established for the SQLJ and JDBC parts of your program. Could you provide more information on that, specifically on how you obtain JDBC connections and SQLJ connection contexts.

  • Quotes causing problem-- I think

    I have below a pl block, all it is supposed to do is replace 111 in (\\APP-MDMDAV-111\%)with 1, Don't know what I am doing wrong. something is wrong for sure may be the whole thing is wrng. Any Suggestions
    DECLARE
    V_STRING_ORIGIONAL VARCHAR2(100);
    V_STRING_NEW VARCHAR2(100);
    V_STR1 VARCHAR2(2500);
    V_STR2 VARCHAR2(2500);
    V_STR3 VARCHAR2(2500);
    BEGIN
    V_STR1 :='SELECT CONFIG_VALUE FROM EV_CONFIG WHERE CONFIG_VALUE LIKE'|| '''\\APP-MDMDAV-111\%'''||';';
    DBMS_OUTPUT.PUT_LINE('ORIGNAL VALUE IS = ' || V_STR1);
    EXECUTE IMMEDIATE V_STR1 INTO V_STRING_ORIGIONAL;
    V_STR2:='SELECT REPLACE ('||'''||V_STRING_ORIGIONAL||'''||','|| '''111''' || ',' || '''1'''||') FROM DUAL;';
    DBMS_OUTPUT.PUT_LINE('NEW VALUE IS = ' || V_STR2);
    EXECUTE IMMEDIATE V_STR1 INTO V_STRING_NEW;
    V_STR3 := 'UPDATE EV_CONFIG SET CONFIG_VALUE ='||'''||V_STRING_NEW||'''||'WHERE CONFIG_VALUE = '||'''|| V_STRING_ORIGIONAL '''||';';
    DBMS_OUTPUT.PUT_LINE('UPDATE STATEMENT IS = ' || V_STR3);
    EXECUTE IMMEDIATE V_STR3;
    END;

    You don't need Dynamic SQL
    DECLARE
    V_STRING_ORIGIONAL VARCHAR2(100);
    V_STRING_NEW VARCHAR2(100);
    BEGIN
    SELECT CONFIG_VALUE into V_STRING_ORIGIONAL
    FROM EV_CONFIG WHERE CONFIG_VALUE LIKE 'APP-MDMDAV-111\%';
    select replace(V_STRING_ORIGIONAL  ,111,1) into V_STRING_NEW from dual;
    UPDATE EV_CONFIG SET CONFIG_VALUE =V_STRING_NEW
    WHERE CONFIG_VALUE = V_STRING_ORIGIONAL;
    END;However, you don't need PL/SQL the same can be achieve as follows
    UPDATE EV_CONFIG A
    SET CONFIG_VALUE =(select replace(CONFIG_VALUE  ,111,1) 
                       from EV_CONFIG B
                       WHERE A.UNIQUE_ID=B.UNIQUE_ID)  -- Assuming table has Primary key or some kind of  Unique id
    WHERE CONFIG_VALUE LIKE '\\APP-MDMDAV-111\%'

  • Xpath with another xpath between single quotes

    Hello,
    Im using an xpath expression to find a node in a xml variable. In this xpath I need to equal the text part of the resolved node to the value returned from the xpath from another xml variable. The value returned from the second xpath needs to be between single quotes in the first xpath, but it is not working. I already tried this:
    /path_to_xml1/root_node/node[text = '/path_to_xml2/root_node/node']
    string(/path_to_xml1/root_node/node[text = '/path_to_xml2/root_node/node'])
    string(/path_to_xml1/root_node/node[text = 'string(/path_to_xml2/root_node/node')])
    thank you

    When you say : "...I need to equal the text part of the resolved node", are you talking about a text attribute of the node or just the value of that node?
    If it's just the value of the node then you should just use /path_to_xml1/root_node/node /path_to_xml2/root_node/node
    Jasmin

  • Single quot problem

    Hi friends
    Under given code is written in JSP page and passing userid in servlet
    document.form1.action="../servlets/myServelt?userid=abc'"Please check abouve line last character is double quout(") and second last character is single quot ( ' ).
    my problem is when i pass user id in servlet i got questation mark instead of single quot.
    I have to allow single quot in userid due to some reason. so i can't remove single quot.
    please help me how can i got single quot instead of questation mark ?
    Thanks
    virendra

    I don't think you are allowed to pass a single quote (apostrophe) over URLs. Web standards limit the characters that are allowed to be used to make room for protocol features.
    My guess is that you will need to URLEncode the string:
      <% String encodedGoTo = URLEncode("../servlets/myServelt?userid=abc'", "UTF-8"); %>
      document.form1.action="<%=encodedGoTo%>";

  • How to pass a string variable in a single quote

    Hi,
    I am trying to pass a single quoted string, 'some string', into a concat expression.
    My situation is some thing like
    I have an array of states
    <copy>
    <from>
    <ListOfValues xmlns="http://tbone.coi.test/amis">
    <!-- State -->
    <Value>A</Value>
    <Value>B</Value>
    <Value>C</Value>
    </ListOfValues></from>
    <to variable="StateList"/>
    </copy>
    then I loop through the StateList array to get each state as
    <copy>
    <from variable="StateList" query="/tns:ListOfValues/tns:Value[bpws:getVariableData('iterator')]"></from>
    <to variable="currentState"/>
    </copy>
    I then build an xpath expression like:
    <copy>
    <from expression="concat('/nsxml0:GetSummariesResponse/nsxml1:Summaries[nsxml1:State = ',bpws:getVariableData('currentState'), ']')"></from>
    <to variable="xpath"/>
    </copy>
    As the result, my xpath look like:
    /nsxml0:GetSummariesResponse/nsxml1:Summaries[nsxml1:State = A]
    but I need a state surrounded by single quote as 'A' or xpath query like
    /nsxml0:GetSummariesResponse/nsxml1:Summaries[nsxml1:State = 'A']
    Any ideas how can I single quote a value of bpws:getVariableData('currentState') in my concat expression
    Thanks,
    -V

    Have you tried 'the string contain''s an &apos;'?

  • Escaping Single Quotes in UIX LOVs

    Hello all,
    I am creating an application using ADF and UIX. In the system, I am using the standard UIX LOV, and I am curious if there is an existing way of handling single quotes entered by users in the search area. By default (at least in my case), single quotes cause an error in the SQL query, so I would like to escape them before the query is run. I attempted to override the onLovFilter method to handle this, but it seems like the LOV window does not actually fire any events or call overridden methods. I also overrode prepareMode to simply output "hello" when it is called, to test if any events were really being fired, but my method looks like it is simply being ignored. Is there a simpler way to avoid troubles caused by single quotes? Or can anyone help me override methods in LOVs? Thanks in advance.
    Regards,
    John

    No. Please use PreparedStatements. That is theonly
    correct answer to this question.Ok please tell us. how would you use prepare
    statement.. no just say USE PREPARE STATE.. givethe
    guy the code... or help..What size spoon would you like to be fed with? There
    was nothing about gob size in the original post.
    http://www.javaalmanac.com
    well duffymo.. i think you gave a link, is quite of help, but my friend preparestatement just gave "use preparestatement"..
    i think even you when you start coding you needed help... and some one just tell you use preparestatement how do you feel..
    There is a level of help. i think it will be (((as much as you can)))

  • XML invalid character -  a single quote problem

    Hi, I am reading in an xml file, then write the file to output. The problem is that the input file has a strange single quote character [ *�*  ] - lets call it single quoate A, which is different from [  *'*  ] , that is the key next to the [ ; ] key on an English keyboard - lets call it single quate B. And in fact there isnt a key to input single quote A, I guess the appearance of single quote A is due to encoding.
    If I open the input xml file in browser, it works ok and displays the single quote A.
    Once I read in the xml file into memory, by debugging I can still see that single quote A is corrected encoded;
    However once I rewrite the same content to output, the single quote A character is changed, and if i open the file in browser, it says 'invalid character' because single quote A were changed when written to output and cannot be rendered.
    Both input and output xml are using UTF-8 encoding. How can I solve this problem please?
    The xml file looks:
    <?xml version="1.0" encoding="UTF-8" ?>
    <content>....1980�s (Peacock and Williams, 1986; Keay, 1984)</content> My code for reading
    String _xquery ="//content/text()";
    Document _xmlDoc= DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("myxml.xml");
    XPath _xpath = XPathFactory.newInstance().newXPath();
    NodeList nodes = (NodeList) _xpath.compile(query).evaluate(_xmlDoc, XPathConstants.NODESET);
    List<String> res = new ArrayList<String>(nodes.getLength());
    for (int i = 0; i < nodes.getLength(); i++) {
        res.add(nodes.item(i).getNodeValue());
    String valueToOuput=res.toString() //this is the value to be output to xml, it shoud look like "[....1980�s (Peacock and Williams, 1986; Keay, 1984)]"my code for writing xml
    Element root=new Element("root");;
    Element content= new Element("output-content")
    content.setText(valueToOutput);
    root.addContent(content);
    PrintWriter writer = new PrintWriter(new FileWriter(f));
    new XMLOutputter().output(domDocument, writer);
    writer.close();

    Hi, sorry I have fixed the problem... instead of using PrintWriter, I used Fileoutputstream, and it solved the problem. Thanks!

  • Single Quote problem with javascript

    Hello;
    I have a custom popup search page that work very well most times. if the data that I am passing back to me calling page has a single quote in it the popup page fails. Take a look at this URL that is called and you van see why the single quote is causing the problem.
    javascript:passBackSearch('413','TOM'S GRILL')

    To make it more clear, it should be
    javascript:passBackSearch('413',"TOM'S GRILL") Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

  • RWRUN60: Problem with parameter value containing space between single quote

    Hi All
    I'm using RWRUN60 to generate my report by following way:
    C:\orant\BIN\RWRUN60.EXE userid=DBUser/dbpasswor@db BACKGROUND="NO" BATCH="YES" DESFORMAT="pdf" DESNAME="C:\report.pdf" DESTYPE="FILE" ORIENTATION="LANDSCAPE" PARAMFORM="NO" P_REPORTID="2431" P_REPORTNAME="Report Name" report="C:\report.rdf" P_WHERE="StartDate>=to_date('2011-07-14 10-37-00','YYYY-MM-DD HH24-MI-SS')"
    When I tried to run given command above nothing was executed executed and any log didnt created.
    I found out that problem occurs when text between two single quotes contains spaces. In my case it is a parameter P_WHERE. I need to keep such format because it is part of report query.
    When I removed last parameter from command RWRUN60 successfully genereate pdf document.
    Further I added new test parameter P_TEST(it is ignored by rdf) in the end of command line following:
    P_TEST="test '11'" - rwrun60 generates report
    P_TEST="test '1 1'" - rwrun60 doesn't; generate report
    Can somebody help how to resolve given problem. Is it parsing bug or what else?

    Spaces on command lines a very often a bad idea. Get rid of them by changing the command, e.g.:
    to_date('2011-07-14:10-37-00','YYYY-MM-DD:HH24-MI-SS')

  • Mssql single quote problem!

    Hi,
    I user servlet to update MS SQL2000. My problem is there is a single quote inside a text string!
    I can't use double quote for string, as it is not a valid statement for MSSQL. I need to use single quote, but there is single quote inside the string, how can I handle the string?
    String mstrnig="I'm a boy";
    String mSQL = "UPDATE news SET " + "title='" + mstring + "' WHERE code =" + mcode;
    Thanks

    the cleanest and easiest soln is to use preparedStatement.
    PreparedStatement ps = con.prepareStatement("update table comment=? where id = ?");
    ps.setString(1,"That's way to do it");
    ps.setInt(1,8);//some itn value
    ps.execute();

  • Problem in insertion with string containing   ' (single quote)

    i have a text field in jsp.
    when i submit the content need to be inserted/updated.
    when the text field contains character's with single quote( ' )..
    i am unable to insert/update values in database..
    where as if the text field contains characters without single quote..there is no problem in Database insertion/updation.
    i am using create statement .. and oracle database..
    can any one help ...

    The usual answer for this in the JDBC forum (where this should have been posted because it's completely about JDBC) is to use a PreparedStatement.

  • Single Quote in XPATH

    Hi,
    I am firing following Xpath Query.
    String xpath = "/////FEEDPUBNAME[contains(translate(.,'abcdefghijklmnopqrstuvwxyz',"
                   + " 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),'"+strPubName.toUpperCase().trim()+"')]";
    String xpath1="NLAPUBLISHINGLIST/NLAPUBLICATIONS/*[@NAME='"+ strPubName.trim() +"']/PUBLOOKUP/FEEDPUBNAME";suppose if value of strPubName is Single's
    Exception is thrown
    how can fire Xpath query when a string having Single Quote in it.
    Any suggestion or solutions will be appriciated.
    eagrly waiting for a reply
    Thanks.

    My bet is that you need to escape the quote somehow. Since this is not an Xpath forum, you might want to ask "how" somewhere else.

  • Problem with lookup-table and single quotes

    SOA Suite 10.1.3.3. I have an ESB project with an XSLT map that uses orcl:lookup-table to translate values. I use this instead of lookup-dvm because I want non-IT users to manage the mappings without having access to the ESB Console.
    According to the doco:-
    G.1.79 lookup-table
    orcl:lookup-table(table, inputColumn, key, outputColumn, datasource)
    This function returns a string based on the SQL query generated from the parameters.
    The string is obtained by executing:
    SELECT outputColumn FROM table WHERE inputColumn = key
    The problem I'm having is that it seems if "key" contains a single quote (i.e an apostrophe), then lookup-table fails to find the corresponding value - even though the value in table.inputColumn also contains the single quote.
    I've put the incoming into an XSL variable, but to no avail.
    <xsl:variable name="incoming">
    <xsl:value-of select="/obj1:DEV_MESSAGE_TYP/DATA1"/>
    </xsl:variable>
    <xsl:variable name="dvm-text">
    <xsl:value-of select="orcl:lookup-table('MYTABLE','INVAL',$incoming,'OUTVAL','ds/dev')"/>
    </xsl:variable>
    Are there any XSLT Gurus out there that have come across this or can think of ways around it?
    Thanks in advance...
    Regards,
    Greg

    Ok - the above was on the right track but wasn't 100% because it can't handle more than 1 single quote (apostrophe) in the input to lookup-table.
    I've since found a better solution - an XSLT re-usable template that operates recursively and so can replace multiple occurances of single quotes. I've modified it to handle a null input value, otherwise lookup-table will just return the value of the first row in the lookup table - doh! The way I've done it below, if null is passed in, then null will be returned.
    This goes at the top of your XSLT map file...
    <!-- reusable replace-string function -->
    <xsl:template name="replace-string">
    <xsl:param name="text"/>
    <xsl:param name="from"/>
    <xsl:param name="to"/>
    <xsl:choose>
    <xsl:when test="contains($text, $from)">
         <xsl:variable name="before" select="substring-before($text, $from)"/>
         <xsl:variable name="after" select="substring-after($text, $from)"/>
         <xsl:value-of select="$before"/>
         <xsl:value-of select="$to"/>
    <xsl:call-template name="replace-string">
    <xsl:with-param name="text" select="$after"/>
    <xsl:with-param name="from" select="$from"/>
    <xsl:with-param name="to" select="$to"/>
         </xsl:call-template>
    </xsl:when>
    <xsl:when test="$text=''">NULL</xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$text"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    Then you call it from within the XSLT map as follows:-
    <!-- if contains a single quote, replace with 2x single quotes. This makes lookup-table work! -->
    <xsl:variable name="incoming">
    <xsl:call-template name="replace-string">
    <xsl:with-param name="text" select="inp1:myinputfield"/>
    <xsl:with-param name="from">'</xsl:with-param>
    <xsl:with-param name="to" select="'&amp;apos;&amp;apos;'"/>
    </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="dvm-text">
    <xsl:value-of select="orcl:lookup-table('MYLOOKUPTABLE','INVAL',$incoming,'OUTVAL','ds/dev')"/>
    </xsl:variable>
    <!-- lookup-table returns null if input value not found. Output original value instead -->
    <xsl:choose>
    <xsl:when test="$dvm-text=''">
    <xsl:value-of select="inp1:myinputfield"/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$dvm-text"/>
    </xsl:otherwise>
    </xsl:choose>
    Much Thanks to everyone who shares information and methods on the Internet!
    Cheers,
    Greg

  • Importing excel files - problem with single quote

    When importing excel files using 1.5, I can't get data with single quotes (') imported.
    When I run the insert statement given in SQLPlus I get "ORA-01756: quoted string not properly terminated", which is different than the error that SQL Developer gives me (see below).
    Also, I have a numeric value shown without a thousands comma-separator in the XLS file that I'm trying to load into a varchar2 field. But, the insert statements have added a thousands comma-separator which I don't want.
    REM Error starting at line 1 in command:
    REM INSERT INTO table (ID, NAME, CODE)
    REM VALUES (2427407, 'Ed-u-care Children's Center', '73,000');
    REM Error at Command Line:2 Column:37
    REM Error report:
    REM SQL Error: ORA-00917: missing comma
    REM 00917. 00000 - "missing comma"
    REM *Cause:   
    REM *Action:
    One last thing, TOAD gives a way to automap columns chosen from XLS to the columns in the database. It sure would be nice to have this functionality in SQL Developer.
    Thanks,
    Steve

    Did you consider both to be bugs (i.e., single quote issue and thousands comma separator issue)?
    Thanks

Maybe you are looking for

  • IPad mirror shows up in 4:3 aspect

    why doesn't apple tv show ipad mirror in widescreen and only in 4:3 aspect ratio - the advertisements clearly show photos in full screen - am I missing something or is this misleading advertising

  • BIG Numbers formula Questions-looking for clarity and direction

    Besides a general lack of computer knowledge, here is my problem. I'll try to make it clear and easy to read. I'm working on a spreadsheet that would organize and keep track of student's choices and payments for a ski retreat. There are 4 checkbox co

  • Have parental controls gone mad in Mountain Lion?

    I have two children each with separate accounts, for 2 years the settings have been to automatically restrict web sites according to the content rules set by Apple. Its worked brilliantly with nominal customization! Fab - Until Moutain Lion. The sett

  • Regarding Hyperion products

    Hi All, I have one doubt according to my requirement that is, I need to pull the data from oracle apps[GL module] to Essbase. If I made any changes in source database[Oracle apps] it have to be reflect in target database[Essbase]. What are all the Hy

  • J1IH ---- Excise JV

    Hi Gurus, In Tcode J1IH, while saving, system is showing following error (Message no .KI281) "Do Not assign any objects in cost accounting to account 272043" Account 272043 is my Balance sheet account. System response is as follows "Auxiliary Account