How to store string with "?" without binding parameters

I would like to store string which contains following characters 'bla bla bla "?" bla bla'. When I set this string into some object and commit UOW, than TopLink generates UPDATE command and I receive SQLException "Number of input values does not match number of question marks". It seems that TopLink tries to store this object via PreparedStatement.
How can I say to TopLink: "Don't use PrepareStatement"?
Thank you for any help.
Jan Kostrhun
TopLink version: 9.3.0.6
JDBC: Informix JDBC 2.21.JC5
// modifications made to DatabaseLogin in preLogin event
DatabaseLogin dl = srv.getLogin();
dl.useBatchWriting();
dl.useJDBCBatchWriting();
dl.useNativeSQL();

Hi King,
the problem is, that I am storing string which contains a part of Java code. And the Java code contains question mark surrounded by quotation marks.
Thank you for your answer
Jan
08:45:15,997 INFO [1571] toplink UnitOfWork(22544730)--begin unit of work commit
08:45:16,004 INFO [1571] toplink ClientSession(5676128)--Connection(3972145)--begin transaction
... some lines
08:45:16,047 INFO [1571] toplink UnitOfWork(22544730)--Connection(3972145)--UPDATE char_moc_body SET cast_retezce = ' ERROR_EX (ex, "Error while running algoritmus!");
result = "aaaaaaaaa";
} else {
result = "?";
* Implementace metody udalosti CommandEvent.
* @param event data udalosti.
public void process ', obj_verze = 11 WHERE ((obj_id = 901699) AND (obj_verze = 10))
08:45:16,117 ERROR [1571] toplink UnitOfWork(22544730)--EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3.4 (Build 432)): oracle.toplink.exceptions.DatabaseException
EXCEPTION DESCRIPTION: java.sql.SQLException: Number of input values does not match number of question marks
INTERNAL EXCEPTION: java.sql.SQLException: Number of input values does not match number of question marks
ERROR CODE: -79749LOCAL EXCEPTION STACK:
EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3.4 (Build 432)): oracle.toplink.exceptions.DatabaseException
EXCEPTION DESCRIPTION: java.sql.SQLException: Number of input values does not match number of question marks
INTERNAL EXCEPTION: java.sql.SQLException: Number of input values does not match number of question marks
ERROR CODE: -79749
     at oracle.toplink.exceptions.DatabaseException.sqlException(Unknown Source)
     at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(Unknown Source)
     at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeNoSelect(Unknown Source)
     at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(Unknown Source)
     at oracle.toplink.publicinterface.UnitOfWork.executeCall(Unknown Source)
     at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown Source)
     at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown Source)
     at oracle.toplink.internal.queryframework.CallQueryMechanism.executeNoSelectCall(Unknown Source)
     at oracle.toplink.internal.queryframework.CallQueryMechanism.updateObject(Unknown Source)
     at oracle.toplink.internal.queryframework.StatementQueryMechanism.updateObject(Unknown Source)
     at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.updateObjectForWrite(Unknown Source)
     at oracle.toplink.queryframework.WriteObjectQuery.executeCommit(Unknown Source)
     at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWrite(Unknown Source)
     at oracle.toplink.queryframework.WriteObjectQuery.execute(Unknown Source)
     at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
     at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
     at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
     at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
     at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
     at oracle.toplink.internal.sessions.CommitManager.commitAllObjects(Unknown Source)
     at oracle.toplink.publicinterface.Session.writeAllObjects(Unknown Source)
     at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
     at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(Unknown Source)
     at oracle.toplink.publicinterface.UnitOfWork.commit(Unknown Source)
... more rows
INTERNAL EXCEPTION STACK:
java.sql.SQLException: Number of input values does not match number of question marks
     at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:348)
     at com.informix.jdbc.IfxSqli.sendExecute(IfxSqli.java:1256)
     at com.informix.jdbc.IfxSqli.sendCommand(IfxSqli.java:814)
     at com.informix.jdbc.IfxSqli.executeCommand(IfxSqli.java:699)
     at com.informix.jdbc.IfxResultSet.executeUpdate(IfxResultSet.java:316)
     at com.informix.jdbc.IfxStatement.executeUpdateImpl(IfxStatement.java:846)
     at com.informix.jdbc.IfxPreparedStatement.executeUpdate(IfxPreparedStatement.java:269)
     at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(Unknown Source)
     at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeNoSelect(Unknown Source)
     at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(Unknown Source)
     at oracle.toplink.publicinterface.UnitOfWork.executeCall(Unknown Source)
     at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown Source)
     at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown Source)
     at oracle.toplink.internal.queryframework.CallQueryMechanism.executeNoSelectCall(Unknown Source)
     at oracle.toplink.internal.queryframework.CallQueryMechanism.updateObject(Unknown Source)
     at oracle.toplink.internal.queryframework.StatementQueryMechanism.updateObject(Unknown Source)
     at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.updateObjectForWrite(Unknown Source)
     at oracle.toplink.queryframework.WriteObjectQuery.executeCommit(Unknown Source)
     at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWrite(Unknown Source)
     at oracle.toplink.queryframework.WriteObjectQuery.execute(Unknown Source)
     at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
     at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
     at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
     at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
     at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
     at oracle.toplink.internal.sessions.CommitManager.commitAllObjects(Unknown Source)
     at oracle.toplink.publicinterface.Session.writeAllObjects(Unknown Source)
     at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
     at oracle.toplink.publicinterface.UnitOfWork.commitRootUnitOfWork(Unknown Source)
     at oracle.toplink.publicinterface.UnitOfWork.commit(Unknown Source)
... more rows
08:45:16,121 INFO [1571] toplink ClientSession(5676128)--Connection(3972145)--rollback transaction
08:45:16,146 INFO [1571] toplink UnitOfWork(22544730)--release unit of work

Similar Messages

  • How to display string with XML content in 4.6?

    Hi,
    I`d like to know how to display string with XML content in it for 4.6.
    4.6 has not method parse_string.
    And example like this is not helpful:
      DATA: lo_mxml    TYPE REF TO cl_xml_document.
      CREATE OBJECT lo_mxml.
      CALL METHOD lo_mxml->parse_string
        EXPORTING
          stream = gv_xml_string.
      CALL METHOD lo_mxml->display.
    Thank you.

    Hi,
    May be you can use fm SAP_CONVERT_TO_XML_FORMAT. But it have some issues with memory usage, the program consumed tons of memory during convert.

  • How to concatenate string with a numeric control ?

    Hi,
    How to concatenate string with a numeric control ?
    Thankyou.
    Solved!
    Go to Solution.

    Its simpler to just use the Format Into String.
    Attachments:
    Format Into String.png ‏11 KB

  • Can any body tell me How to store string array in a array

    Can any body tell me How to store string array in a array

    YesNot quite sure what question you're answering but here's how to copy an array.// given a String[] strArr
    // pre Java 6
    String[] newStrArr = new String[strArr.length];
    System.arrayCopy(strArr, 0, newStrArr, 0, strArr.length);
    // post Java 6
    String[] newStrArr = Arrays.copyOf(strArr, strArr.length);Edit:
    Or in fact use clone() as mark pointed out.
    Message was edited by:
    dwg

  • How to write strings with an underline on the TOP-OF-PAGE of ALV

    How to write strings with an underline on the TOP-OF-PAGE of ALV

    if u r using classes and methods it can be done
    but if u r using normal fms and then u have to use HTML_TOP_OF_PAGE but the drawback for this it cannot be printed when the report is printed .

  • How to Search strings with and without quotes

    Hello,
    I need to search a string with quote and without quote the same way
    Ex: Wendy's
    If user enters wendys without ' also need to return all the Wendy's..!
    I appreciate any help...!
    Thanks
    RG

    Hi,
    RG wrote:
    Hello,
    I need to search a string with quote and without quote the same way
    Ex: Wendy's
    If user enters wendys without ' also need to return all the Wendy's..!
    I appreciate any help...!So you want to ignore single-quotes, is that it?
    Here's one way:
    INSTR ( REPLACE (big_string,       '''')
          , REPLACE (substring_sought, '''')
          )  > 0 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • How to put String with html tags as it is into xml

    I am using apache dom API to create xml from java.
    I have a string with html tags in it .when I add the string to xml, its replacing all the "<"; with &lt and ">" with > I would like the html tags to look as it is instead of the > and & lt;. How can I acheive that
    this is the code snippet of what I am doing
    In java class
    String titleString = "<font color=red>This Is an Example of a Red Subject</font>"
    Document doc = new DocumentImpl();
    Element root = doc.createElement("bulletin");
    Element item = doc.createElement("title");
    item.appendChild(doc.createTextNode(titleString));
    In Xml it looks like below
    <title><font color=red>This Is an Example of a Red Subject</font></title>
    but I would like to have the xml like below
    <title><font color="red">This Is an Example of a Red Subject</font></title>
    Can you please suggest me whats the best way to acheive this.
    I appreciate all your help
    Thank you
    Suma

    One problem is that you don't understand escaping. If you re-read what you posted you'll see that what you say you get, and what you say you want, are identical. That's because you didn't escape one of the two properly. So your first step should be to find the section about escaping in Chapter 1 of your XML book and read it carefully. Figure out what you should have done here (yes, the same rules apply).
    However, to attempt to answer what I think your question is: if you have a String which contains markup, and you want to convert that String to XML elements, then you have to feed the String into an XML parser.

  • LOV with Query Bind Parameters

    Hi,
    I have a number of LOVs which have Query Bind Parameters. These LOVs display correctly but when I select a row they do not return values back to the fields in the calling page.
    I get the following message in the OC4J servers:
    DEBUG (LovItemBean) -No row selected in LOV. If you did select a row, then the LOV is probably based on a read-Only ViewObject that is not based on an EntityObject. If this is the case, make sure at least one attribute is marked as key attribute, and you have called setManageRowsByKey(true) in the create method of your ViewObjectImpl java class
    The VO that the LOV is based on is based on an entity object and one of the attributes is marked as key attribute.
    When I remove the Query Bind Parameters the LOV returns successfully into the field.
    Thanks,
    Gavin

    Gavin,
    We just hit this issue ourselves and fixed it. The fix will be included in first patch release, planned for first half of september.
    As a work around, you can remove the "Refresh" property (or set it to "ifNeeded") in the page definition for the applyBindParams InvokeAction, as well as the corresponding Iterator binding immediately below the InvokeAction.
    Steven Davelaar,
    JHeadstart Team.

  • How to export strings with "\"

    When I export a string with backslashes in it (eg. path name to a file) then when this file is imported at run time then backslashes '\' cause the import to fail. So for now I have to replace all "xxx\yyy" strings in exported file with "xxx\\yyy" and then import
    of such MODIFIED file goes OK.
    But this is tedious - is there another way to deal with it ?

    This is caused by the fact that the ASCII backslash character is the escape code specifier, and when the file is read by the import/export properties tool it is treated as such. If you have any character sequences in a string such as "\t" or "\n" these get interpreted as tabs and newlines within the string.
    To avoid this behavior when importing you will need to modify the strings in TestStand before exporting them to include the "\\" escape code set to the file. The caveat to this is once these values are read back from the file they will be interpreted as single backslashes. For instance, if you export "c:\\temp", and then import it back you will get "c:\temp". This is simply the nature of the Import/Export Properties tool.
    If you do not like the b
    ehavior of this tool in its shipping form, you can rebuild the "limitloader.dll" module to include the functionality that you want. Whenever you click the Tools>>Import/Export Properties menu selection, the MainSequence of \Components\NI\Tools\ImportExport.seq is being executed. This has a single step in it that calls the "DisplayImportExportDialog" function of the limitloader.dll. The source for the limitloader.dll can be found in the \Components\NI\StepTypes\Database directory.
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

  • How to extract string with delimiter

    Hello all,
    I'm using Oracle 10g and want to extract string with a delimiter.
    For example, i have aaaa;;bbbb;cccc;dddd;eeee;ffff and i want to extract this string into separates strings 'aaaa', ' ', 'bbbb', 'cccc', 'dddd', 'eeee', 'ffff'.
    Thanks a lots for yours help.
    MK.

    I prefer the regular expression method myself...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select 'aaaa;;bbbb;cccc;dddd;eeee;ffff' as txt from dual)
      2  -- end of sample data
      3  select REGEXP_SUBSTR (txt, '[^;]+', 1, level)
      4  from t
      5* connect by level <= (select length(regexp_replace(txt,'[^;]*'))+1 from t)
    SQL> /
    REGEXP_SUBSTR(TXT,'[^;]+',1,LE
    aaaa
    bbbb
    cccc
    dddd
    eeee
    ffff
    7 rows selected.
    SQL>

  • How to replace string with image( Say Smiley).........????

    Hello To All Experts !!
    I wanna looking for some help in displaying image in my text area when should i type ":)" in text field.....
    I got some program through forums....
    import java.util.*;
    import javax.swing.ImageIcon;
    public class TokenizeSmiley {
        private static final HashMap SMILEYS;
        static {
            SMILEYS = new HashMap();
            SMILEYS.put(":)", new ImageIcon("images/1.gif"));
            SMILEYS.put(";)", "<wink>");
        public static void main(String[] args) {
            String text = "Hello!! :) How are you ;)";
            StringTokenizer st = new StringTokenizer(text);
            String token;
            while (st.hasMoreTokens()) {
                token = st.nextToken();
                if (SMILEYS.containsKey(token))
                    token = (String)SMILEYS.get(token);
                System.out.print(token + " ");
    }but it is showing <smile> and <wink> as it is given...i tried to give path of image ...but it is nt fetching then also.....
    Plz help in this....
    Message was edited by:
    Damz@del

    So your data is stored in XML. So what? You haven't asked a question about the XML or how to format it or how to access it. You asked a question that had nothing to do with XML at all. It's as if you said "My data is stored on a Windows computer so I will call Microsoft's support line to ask them this question."
    And I can't even suggest a suitable forum because a "text area" could be an AWT component or an HTML component. But I do suggest you ask in the right place.

  • How to call Dispatcher.Invoke without detailed parameters signs to define a delegate?

    Hi,
    I got a function like:
    internal static object AttemptMethod(object instance, Type type, MethodInfo methodinfo, object[] args)
                return methodinfo.Invoke(instance, args);
    calling a method of instance without the exact parameters sign only given the paramter list args, looking good. Now I'm trying to multiply-threading it, doing like:
    internal static object AttemptMethodMT(object instance, Type type, MethodInfo methodinfo, object[] args)
                return Dispatcher.CurrentDispatcher.Invoke(?????, instance, args);
    But, without the exact paramters sign, how can I create a sound delegate for Dispatcher.CurrentDispatcher.Invoke? How can I create the delegate without exact parameter sign?
    Thanks a lot.

    The error message says/means that you can only update UI bound elements on the UI thread. What are you trying to do and how exactly do you create your MethodInfo object?
    >>Is there some ViewSource I can use to directly replace CollectionViewSource for multi-threading?
    You can only access a UI element, such as for example a CollectionView, on the very same thread on which it was initially created. There are no exceptions do this rule so you
    cannot access it on any other thread.
    Please provide and upload a full reproducable sample of your issue to OneDrive if you need any further help.
    Please also remember to mark all helpful posts as answer to close your threads and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

  • How to save string inArraylist without precious space

    While adding the string in a arraylist , a blank space is inserted between the elements . But for my scenario i dont want to add a space. How do i rectify this. Please help me.

    prometheuzz wrote:
    Saish wrote:
    I was confused why toString() had even entered the discussion. ...I don't see what other extra space it could be other than the toString() representation of the collection.
    But it could be something entirely different of course...Yeah, I also thought the OP might have inserted a blank space as an element or a null or empty string or something similar. It's hard to say without knowing more about the problem.
    - Saish

  • How to replace string with image( Say Emoticons )??

    Hello Friends !!
    I am working on chat messenger and want some help in "How to access Emoticons when somebody typed :), ;), :)) and many more strings.....?"
    Is there any sample code to do that job or any function to perform such task??
    Thanks in Advance....

    use event listener... found match, load image instead of text on the fly.

  • How to find string with trailing space

    Hi,
    I need to search a word instead of string from another string.
    I tried below code and expected that FIND will not search 'weeds' but it seems FIND ignores trailing spaces of string zstr and thus finds word 'weeds'.
    DATA: zstr type string value 'we ',
              lv_string type string value 'These are weeds',
              result_tab TYPE match_result_tab.
    FIND FIRST OCCURRENCE OF regex zstr IN lv_string
                          IGNORING CASE
                          RESULTS result_tab.
    Please consider that zstr is runtime variable with no fixed length.
    If anybody has the solution, reply back fast !
    Regards,
    Sourabh

    Hi,
    Hi,
      DATA STRING(30) VALUE 'This is a little sentence.'.
    WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.
    ULINE /1(26).
    SEARCH STRING FOR 'X'.
    WRITE: / 'X', SY-SUBRC UNDER 'SY-SUBRC',
                   SY-FDPOS UNDER 'SY-FDPOS'
    SEARCH STRING FOR 'itt '.
    WRITE: / 'itt   ', SY-SUBRC UNDER 'SY-SUBRC',
                       SY-FDPOS UNDER 'SY-FDPOS'
    SEARCH STRING FOR '.e .'.
    WRITE: / '.e .', SY-SUBRC UNDER 'SY-SUBRC',
    SY-FDPOS UNDER 'SY-FDPOS'.
    SEARCH STRING FOR '*e'.
    WRITE: / '*e ', SY-SUBRC UNDER 'SY-SUBRC',
    SY-FDPOS UNDER 'SY-FDPOS'.
    SEARCH STRING FOR 's*'.
    WRITE: / 's* ', SY-SUBRC UNDER 'SY-SUBRC',
    SY-FDPOS UNDER 'SY-FDPOS'.
    Hope it will solve your problem..
    Pls. reward if useful...

Maybe you are looking for

  • Trying to check for updates but I keep getting an error from the plugin checker.

    I try to find updates for the plugins I have installed and when I get to the site I get this message:Plugin Finding Service Error We've encountered an error. Please try your request again later.

  • Error with pacman upgrade

    Hello, I was trying the upgrade from today and here is my error log: :: Synchronizing package databases... core is up to date extra is up to date community is up to date archlinuxfr is up to date :: Starting full system upgrade... resolving dependenc

  • My iPhoto library just disappeared!

    All of a sudden my iPhoto library is missing. iPhoto can't find it, and it is not located in my pictures folder anymore. How can this happen? I googled this problem, and it seems it has happened to people occasionally over the years. Luckily, I have

  • Click wheel iPods trigger error message

    let me just start this off by saying I'm on my 2nd click wheel iPod right now. my first one, as well as it's replacement, kept triggering this error in iTunes whenever transferring songs to them. my replacement one did this right out of the box, at l

  • HT1918 I would like to give back the last purchase wich was a mistake

    I would like to give back my las purchase wich was actually a mistake