A problem with inserting into DB hebrew strings

Hi,
I am working with a 8.1.7 DB version, and use thin driver.
I have my DB Charest configured to iso 8859P8 (which is visual Hebrew)
I have no problem in making a connection and retrieving strings, using SELECT * FROM ..
and then use the ResultSet.getString(String columnName) method .
I also have no problem in inserting the Hebrew characters , and retrieving them back ( I represent them in a servlet ),
The only problem I do have, is when I try to insert into DB a row in the following manner
INSERT into table_name values( Hebrew_String_value1, Hebrew_String_value2, Hebrew_String_value3, Hebrew_String_value4)
the insertion works fine , but somehow the insertion misplaces the strings order and actually the insertion is in opposite order :
Hebrew_String_value4, Hebrew_String_value3, Hebrew_String_value2, Hebrew_String_value1.
If I use the same insert with English Strings , there is no problem.
does any one have the solution how I insert the strings in the right order ?
one solution I have is to insert only one column and then update the table for each column , but then , instead of one execute() action , I have to make ,
1 execute() + 9 executeUpdate() for a 10 column table

Can you try specify the column order in your INSERT statement, i.e.
INSERT INTO mytable( column1_name,
                     column2_name,
                     column3_name,
                     column4_name )
             VALUES( column1_string,
                     column2_string,
                     column3_string,
                     column4_string)My wild guess, though I can't understand why at the moment, is that there may be a problem because Hebrew is read from right to left, that may be causing a problem.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC

Similar Messages

  • Problem with inserting into table that has autogenerated primary key

    hi
    i am working on EJB3.
    i am trying to insert object into table.Primary key of table will be generated automatically.I tried following statement for insertion,
    em.persistent(customerObj);
    but it throw following exception,
    javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): customer.CustomerInfo
         at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
         at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
         at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
         at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:211)
         at org.jboss.ejb3.stateless.Stateles
    can anyone tell me is there any other way to acheive the same.
    i thought of doing using insert query,but i am not sure about the syntax to be used.
    could anyone help me ?
    thanks in advance...

    That's why you should use PreparedStatement instead of Statement. Its setString() method will escape that value for you properly when you bind it.
    %

  • Problem while inserting into a table which has ManyToOne relation

    Problem while inserting into a table *(Files)* which has ManyToOne relation with another table *(Folder)* involving a attribute both in primary key as well as in foreign key in JPA 1.0.
    Relevent Code
    Entities:
    public class Files implements Serializable {
    @EmbeddedId
    protected FilesPK filesPK;
    private String filename;
    @JoinColumns({
    @JoinColumn(name = "folder_id", referencedColumnName = "folder_id"),
    @JoinColumn(name = "uid", referencedColumnName = "uid", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Folders folders;
    public class FilesPK implements Serializable {
    private int fileId;
    private int uid;
    public class Folders implements Serializable {
    @EmbeddedId
    protected FoldersPK foldersPK;
    private String folderName;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "folders")
    private Collection<Files> filesCollection;
    @JoinColumn(name = "uid", referencedColumnName = "uid", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Users users;
    public class FoldersPK implements Serializable {
    private int folderId;
    private int uid;
    public class Users implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer uid;
    private String username;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "users")
    private Collection<Folders> foldersCollection;
    I left out @Basic & @Column annotations for sake of less code.
    EJB method
    public void insertFile(String fileName, int folderID, int uid){
    FilesPK pk = new FilesPK();
    pk.setUid(uid);
    Files file = new Files();
    file.setFilename(fileName);
    file.setFilesPK(pk);
    FoldersPK folderPk = new FoldersPK(folderID, uid);
         // My understanding that it should automatically handle folderId in files table,
    // but it is not…
    file.setFolders(em.find(Folders.class, folderPk));
    em.persist(file);
    It is giving error:
    Internal Exception: java.sql.SQLException: Field 'folderid' doesn't have a default value_
    Error Code: 1364
    Call: INSERT INTO files (filename, uid, fileid) VALUES (?, ?, ?)_
    _       bind => [hello.txt, 1, 0]_
    It is not even considering folderId while inserting into db.
    However it works fine when I add folderId variable in Files entity and changed insertFile like this:
    public void insertFile(String fileName, int folderID, int uid){
    FilesPK pk = new FilesPK();
    pk.setUid(uid);
    Files file = new Files();
    file.setFilename(fileName);
    file.setFilesPK(pk);
    file.setFolderId(folderId) // added line
    FoldersPK folderPk = new FoldersPK(folderID, uid);
    file.setFolders(em.find(Folders.class, folderPk));
    em.persist(file);
    My question is that is this behavior expected or it is a bug.
    Is it required to add "column_name" variable separately even when an entity has reference to ManyToOne mapping foreign Entity ?
    I used Mysql 5.1 for database, then generate entities using toplink, JPA 1.0, glassfish v2.1.
    I've also tested this using eclipselink and got same error.
    Please provide some pointers.
    Thanks

    Hello,
    What version of EclipseLink did you try? This looks like bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=280436 that was fixed in EclipseLink 2.0, so please try a later version.
    You can also try working around the problem by making both fields writable through the reference mapping.
    Best Regards,
    Chris

  • Problems with INSERT  syntax ?

    Dear programmers,
    I am have a problem with INSERT Syntax,
    I have a table with 11 fields out of which one is auto_increment field(id), Now my problem is, Do i need to specifiy autoincrement field in INSERT statement. I dont thinks ?
    My Insert statement is as follows ,
    int result = st.executeUpdate("insert into tablename"
              +"(name, user_group, lage, preis, anmerkung, exp_uri, timestamp, nummer)"
              +"values +Objekt+"','"+Kategoriekey+"','"+Lage+"','"+Preis+"','"+Anmerkung+"','"+Dateiname+"','"+date.getTime()+"','"+ObjektID+"')");
    thanks in advance
    bye

    The answer to your question is maybe. Each database handles autoincrements differently. What database are you using?
    I also noticed that you are doing an insert using the standard Statement. You should look into using PreparedStatements for performance reasons and issues such as single quotes from within a string.
    Matt

  • Problem with inserting data into mySQL database with jsp

    I have a jsp page that collects infromation about a users vehicle and puts the data into a mySQL database. Iv'e been messing around with it for ages & i can't seem to get it to work even though i cannot see anything wrong with the code, which can be seen below.
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ include file="Connections/connection.jsp" %>
    <%
    // *** Restrict Access To Page: Grant or deny access to this page
    String MM_authorizedUsers="";
    String MM_authFailedURL="login_form.jsp";
    boolean MM_grantAccess=false;
    if (session.getValue("MM_Username") != null && !session.getValue("MM_Username").equals("")) {
      if (true || (session.getValue("MM_UserAuthorization")=="") ||
              (MM_authorizedUsers.indexOf((String)session.getValue("MM_UserAuthorization")) >=0)) {
        MM_grantAccess = true;
    if (!MM_grantAccess) {
      String MM_qsChar = "?";
      if (MM_authFailedURL.indexOf("?") >= 0) MM_qsChar = "&";
      String MM_referrer = request.getRequestURI();
      if (request.getQueryString() != null) MM_referrer = MM_referrer + "?" + request.getQueryString();
      MM_authFailedURL = MM_authFailedURL + MM_qsChar + "accessdenied=" + java.net.URLEncoder.encode(MM_referrer);
      response.sendRedirect(response.encodeRedirectURL(MM_authFailedURL));
      return;
    String vehicle_details__registration = null;
    if(request.getParameter("txt_registration") != null){ vehicle_details__registration = (String)request.getParameter("txt_registration");}
    String vehicle_details__make = null;
    if(request.getParameter("txt_make") != null){ vehicle_details__make = (String)request.getParameter("txt_make");}
    String vehicle_details__model = null;
    if(request.getParameter("txt_model") != null){ vehicle_details__model = (String)request.getParameter("txt_model");}
    String vehicle_details__colour = null;
    if(request.getParameter("txt_colour") != null){ vehicle_details__colour = (String)request.getParameter("txt_colour");}
    String vehicle_details__tax_class = null;
    if(request.getParameter("select_tax_class") != null){ vehicle_details__tax_class = (String)request.getParameter("select_tax_class");}
    String vehicle_details__chasis_num = null;
    if(request.getParameter("chasis_num") != null){ vehicle_details__chasis_num = (String)request.getParameter("chasis_num");}
    String vehicle_details__status = null;
    if(request.getParameter("radio_status") != null){ vehicle_details__status = (String)request.getParameter("radio_status");}
    String owner_details__MMColParam = "1";
    if (session.getValue("MM_Username") !=null) {owner_details__MMColParam = (String)session.getValue("MM_Username");}
    Driver Drivervehicle_details = (Driver)Class.forName(MM_connection_DRIVER).newInstance();
    Connection Connvehicle_details = DriverManager.getConnection(MM_connection_STRING,MM_connection_USERNAME,MM_connection_PASSWORD);
    PreparedStatement vehicle_details = Connvehicle_details.prepareStatement("INSERT INTO vehicle_man_db.vehicle_details (registartion, make, model, colour, tax_class, chasis_num) VALUES ('"+ String vehicle_details__registration + "', '"+ String vehicle_details__make + "', '"+ String vehicle_details__model + "', '"+ String vehicle_details__colour + "', '"+ String vehicle_details__tax_class + "', '"+ String vehicle_details__chasis_num + "', '"+ String vehicle_details__status + "')");
    vehicle_details.executeUpdate();
    %>
    <form name="add_vehicle_form" id="add_vehicle_form">
      <p>Registration mark:
        <input name="txt_registration" type="text" id="txt_registration">
    </p>
      <p>Make:
        <input name="txt_make" type="text" id="txt_make">
    </p>
      <p>Model:
        <input name="txt_model" type="text" id="txt_model">
    </p>
      <p>Colour:
        <input name="txt_colour" type="text" id="txt_colour">
      </p>
      <p>Tax Class:
        <select name="select_tax_class" id="select_tax_class">
          <option value="AAA">Band AAA (up to 100g/km)</option>
          <option value="AA">Band AA (101 - 120g/km)</option>
          <option value="A">Band A (121 - 150g/km)</option>
          <option value="B">Band B (151 - 165g/km)</option>
          <option value="C">Band C (166 - 185g/km)</option>
          <option value="D">Band D (Over 185g/km)</option>
        </select>
      </p>
      <p>Chasis Number:
        <input name="txt_chassis_num" type="text" id="txt_chassis_num">
    </p>
      <p>Status: active:
        <input name="radio_status" type="radio" value="1" checked>
        off-road
        <input name="radio_status" type="radio" value="0">
      </p>
      <p>
        <input type="submit" name="Submit" value="Submit">
    </p>
    </form>
    <%
    Connvehicle_details.close();
    %>This is the error I am getting from the server
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 3 in the jsp file: /add_vehicle_form.jsp
    Generated servlet error:
    C:\Servers\Tomcat 5.0\work\Catalina\localhost\Assignment\org\apache\jsp\add_005fvehicle_005fform_jsp.java:113: ')' expected
    PreparedStatement vehicle_details = Connvehicle_details.prepareStatement("INSERT INTO vehicle_man_db.vehicle_details (registartion, make, model, colour, tax_class, chasis_num) VALUES ('"+ String vehicle_details__registration + "', '"+ String vehicle_details__make + "', '"+ String vehicle_details__model + "', '"+ String vehicle_details__colour + "', '"+ String vehicle_details__tax_class + "', '"+ String vehicle_details__chasis_num + "', '"+ String vehicle_details__status + "')");
    ^
    1 error
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Any help would be much appreciated.
    Thanks

    use this ...
    PreparedStatement vehicle_details =
    Connvehicle_details.prepareStatement("INSERT INTO
    vehicle_man_db.vehicle_details (registartion, make,
    model, colour, tax_class, chasis_num) VALUES
    vehicle_details .setString(1,String
    vehicle_details__registration );
    vehicle_details setString(2,String
    vehicle_details__make );
    vehicle_details .setString(3,String
    vehicle_details__model );
    vehicle_details .setString(4,vehicle_details__colour
    vehicle_details .setString(5,String
    vehicle_details__tax_class);
    vehicle_details .setString(6,String
    vehicle_details__chasis_num );
    vehicle_details .executeQuery();Even you need a screwing up... what's the point putting that String inside. That's the bloody error.

  • Problem with inserting two BLOBs into a table using setBinaryStream

    DBMS 9.2.0.1.0, Oracle JDBC driver 10.1.0.2.0
    The following code insert in one INSERT two BLOBs
    into two columns using PreparedStatement.setBinaryStream(). When the size of the of at least one blob exceeds
    some limit (? 2k, 4k ?), the values are swapped and
    inserted into wrong columns.
    Please, is this a problem in JDBC driver?
    ====================================================
    import java.io.ByteArrayInputStream;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    import java.sql.Statement;
    * Test - two BLOBs swapped problem.
    * If size of the blob is larger that some treshold, they are swapped in the database.
    public class BlobSwapTest {
    private static Connection getConnection() throws SQLException {
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    } catch (ClassNotFoundException cnfe) {
    throw new SQLException("ClassNotFoundException: " + cnfe.getMessage());
    return DriverManager.getConnection("jdbc:oracle:thin:@//HOST:1521/DB", "USER", "PSWD");
    private static void createTable() throws SQLException {
    Connection conn = getConnection();
    Statement stmt = null;
    try {
    stmt = conn.createStatement();
    try {
    stmt.execute("DROP TABLE BlobTest2");
    } catch (SQLException e) {
    System.err.println("Table BlobTest2 was not deleted: " + e.getMessage());
    stmt.execute(
    "CREATE TABLE BlobTest2 ("
    + " pk VARCHAR(512), "
    + " blob BLOB, "
    + " blobB BLOB, "
    + " PRIMARY KEY (pk)"
    + ")"
    } finally {
    try {
    if (stmt != null) stmt.close();
    } finally {
    conn.close();
    public static void main(String[] args) throws SQLException {
    createTable();
    Connection conn = getConnection();
    PreparedStatement pstmt = null;
    try {
    conn.setAutoCommit(false);
    pstmt = conn.prepareStatement("INSERT INTO BlobTest2 VALUES (?,?,?)");
    final int size = 5000; // change the value to 500 and the test is OK
    byte[] buf = new byte[size];
    byte[] buf2 = new byte[size];
    for (int i = 0; i < size; i++) {
    buf = 66;
    buf2 = 88;
    pstmt.setString(1, "PK value");
    pstmt.setBinaryStream(2, new ByteArrayInputStream(buf), size);
    pstmt.setBinaryStream(3, new ByteArrayInputStream(buf2), size);
    pstmt.executeUpdate();
    conn.commit();
    } finally {
    if (pstmt != null) pstmt.close();
    conn.close();
    ====================================================

    See my response in the JVM forum.

  • Problems with inserting elements into vectors

    Hi,
    I have a problem with the setElementAt() method for vectors.
    I want to initialise a vector that is same size as a previous vector declared in my program and insert float 0.0 in all the positions.
    The code below is a for loop to do just this where count is the size of the previous vector.
    for(int i=0;i<count; i++)
                   vLargest.setElementAt(zero,i);
              }i have declared zero as a float
    float zero = 0.0f;
    the error that i'm getting is that it that the vector cannot be applied to a float.
    Can anybody tell me what i'm doing wrong?
    Thanks

    Yes you need to store Objects in your Vector not primitives.
    float is not an Object it is a primitive. But Float is an object.

  • Problem with inserting date

    Hi,
    I have a JSP form that takes the date and inserts it into the db. I'm having a problem with what format the date should be in. My insert string looks like
    INSERT INTO users (USERNAME, WHO_CREATED, WHEN_CREATED) VALUES ('bob', 'jeff', (Result.getString("sysdate"))
    unfortunatly whatever format I put the date in I can't seem to make both JAVA and ORACLE happy.
    I'm new at this so I'm hoping that is something simple.
    Thanks,
    Chris
    null

    Hi Chris,
    Are u using Business components for java i.e. entity/view objects? If yes, then the default date format for entity/ view objects is
    "yyyy-mm-dd".
    Aparna.

  • Problem with "Insert" and "Overwrite Sequence Content"

    I'm working with XDCAM footage. I like to take all the individual clips recorded on the XDCAM disc, and after getting them into FCP, taking them and putting them all in a sequence in FCP, then using that sequence as the source in the Viewer. This allows for quick scanning of all the clips, much as is it were a digitized tape.
    I recently found the "Insert Sequence Content" and "Overwrite Sequence Content" commands in FCP, and like them in that they actually put the individual clips into my project timeline, and not just the combined sequence (which looks more or less like a nest when dropped into my project sequence).
    Here's the problem: When I put IN and OUT points in the timeline, and "Insert or Overwrite Sequence Content" using the sequence containing all the clips, the video tends to be contained to between the IN and OUT points I set in the TIMELINE, but the audio tracks tend to expand past the OUT point I set in the TIMELINE, and I can't figure out why, or how to get around this.
    Any assistance would be appreciated.

    If you're inserting or overwriting, you're basically pasting the content that you've chosen. I wouldn't think the out point would be recognized, or even wanted. If you copied 5 minutes of clips and inserted it into a sequence with a 4 minute in/out point duration, do you want to only have the first 4 minutes inserted into the sequence? If you only place an in point, it will insert all the clips, starting at that point, and it will take up as much time as the clip content's duration.
    Am I missing something here?

  • Pl/sql block with "insert into" and schema qualified table throws "error"

    Simplified test case:
    Oracle9i EE Release 9.2.0.3.0
    Oracle JDeveloper 9.0.3.2 Build 1145
    create user u1 identified by u1
    default tablespace users
    quota unlimited on users;
    grant connect, resource to u1;
    revoke unlimited tablespace from u1;
    create user u2 identified by u2
    default tablespace users
    quota unlimited on users;
    grant connect, resource to u2;
    revoke unlimited tablespace from u2;
    As user u2:
    create table u2.t
    c1 number
    grant select, update, insert, delete on u2.t to u1;
    As user u1:
    create or replace package test_pkg as
    procedure do_insert (p_in number);
    end;
    create or replace package body test_pkg as
    procedure do_insert (p_in number) is
    begin
    insert into u2.t values (p_in);
    commit;
    end;
    end;
    All of the above works fine using command-line sql*plus, and is clearly a simplified version of the actual code to demonstrate the issue at hand. Using JDeveloper, it complains about 'expected ;' at the 'values' keyword in the insert statement. Removing the schema qualification from the table name allows JDeveloper to not flag the statement as an error, but I do not want to create synonyms (private or public) to point to all the tables in the real packages. Since JDeveloper flags the insert statement as an error, I can not browse the package structure etc, even though it compiles with no problems. What gives?
    Thanks in advance for any suggestions, etc...

    Hi Bryan,
    Thanks for following up on this. I will look for the bug fix to be published.
    - Mark

  • I'm having a problem with inserting a photo gallery created with Bridge

    I sure could use some help.
    Adobe Bridge - Why do I have a white bar on my page?
    I am using windows vista, Dreamweaver cs4 and Adobe bridge to insert a photo gallery.
    I am using an I-frame to embed a photo gallery that was created with Adobe Bridge CS4. Adobe Bridge instructed me to make the i-frame height = 75% of the width. The code is <iframe src="PhotoAlbum/index.html" width="900" height="675" frameborder="0"></iframe>
    my css places the album in #photoalbum.
    #photoAlbum contains the i-frame with the following properties:
    #photoAlbum {
    margin-top: 20px;
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
    width: 900px;
    text-align: center;
    padding-top: 20px;
    padding-bottom: 20px;
    border-top-width: 2px;
    border-top-style: groove;
    border-top-color: #333;
    I tried changing the width to 960, 900, 850 etc with no success.
    I have tried making the background of #photoAlbum black with no success.
    The link to the photo album is http://www.gigharborrealestate.com/smith/PhotoAlbum/index.html and shows no white bar.
    The site that I am having problems with is http://www.gigharborrealestate.com/smith On the right side of the Point Richmond Photo Gallery is a white vertical bar.  If you go to /PhotoAlbum/index.html there is no white bar.
    Why does this bar show up when /PhotoAlbum/index.html is put into an I-frame? How can I get rid of the vertical bar?

    insert the following into your code,
    scrolling="no"
    it should look like this
    <div id="gallery"><iframe src="IMAGES/Adobe Web Gallery/index.html"  scrolling="no" width="730" height="555" frameborder="0" name="web_gallery" style="background-color: #D8D9B4"></iframe></div>
    hope it helps, good luck

  • Problems with my INTO statements.

    Connection connect;
    JTextArea output;
    JTextField textF;
    public void actionPerformed ( ActionEvent e )
    try {
    Statement stmt = connect.createStatement();
    String query = "INSERT INTO myTable" +
    "VALUES ( '" +
    textF.getText() + "')";
    stmt.executeUpdate ( query );
    stmt.close();
    }catch ( SQLException ex ) {
    ex.printStackTrace();
    output.append ( ex.toString() );
    }//actionPerformed
    Problems:
    Connection successful
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]
    Syntax error in INSERT INTO statement.
    whats the problem in INTO statements.

    Hi sellare,
    String query = "INSERT INTO myTable" +
    "VALUES ( '" +
    textF.getText() + "')";
    try putting a
    System.out.print( query );
    Here I modified your code and also please observe lack of space between the myTable and values.
    INSERT INTO myTable VALUES ( ' .........' )
    I hope this will help you out.
    Regards,
    Tirumalarao
    Developer Technical Support,
    Sun Microsystems,
    http://www.sun.com/developers/support.
    .

  • Error With Insert Into From Select

    Hello,
    I have a problem with this query in pl sql developer with oracle 10G:
    insert into ca_nrj_rem(imsi,id_gamme_vente,domaine,date_topage,id_produit)
    (select a1.* from (select d.imsi, 1, 4, trunc(sysdate - 1), 'NRJ003'
    from ca_evenement_vsim a, ca_forfait b, ca_forfait c, ca_vsim_associe d
    where a.id_action = 'CP1'
    and bao.Lecture_Parametre_XML_V2(a.valeur_parametres, 'ancienCode') = b.code_forfait
    and b.code_gamme = 2
    and bao.Lecture_Parametre_XML_V2(a.valeur_parametres, 'nouveauCode') = c.code_forfait
    and c.code_gamme = 6
    and date_trace > sysdate - 6
    and a.vsimid = d.vsimid
    and d.date_fin is null
    group by d.imsi, trunc(sysdate - 1)) a1, ca_nrj_rem n
    where a1.imsi=n.imsi(+) and n.imsi is null);
    The select statement return X (163) values but the insert statement inserts Y (540) values
    Can you help me please ?
    Thanks You

    user511447 wrote:
    The select statement return X (163) values but the insert statement inserts Y (540) valuesNot possible if the select statements are identical.
    You'll have to provide more evidence and example output (format it on the forum by putting {noformat}{noformat} before and after it), so we can see exactly what you are doing.
    Are you sure that the table you are inserting into has no rows initially or that you are counting the rows correctly?
    Show us exactly what you are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Error with INSERT INTO statement

    My INSERT statement looks like the following:
    String insert = "INSERT INTO UserDetails (lockedOut) VALUES (1)
    where registrationNo = ('"+registrationNo+"')";
    stmt.executeUpdate(insert);
    The error message:
    Missing semicolon (;) at end of SQL statement.
    I've been trying to figure this out for 2 days now - has anyone got a suggestion

    Hi.
    You need to add a semicolon inside the string.
    String insert = "INSERT INTO UserDetails (lockedOut) VALUES (1)
    where registrationNo = ('"+registrationNo+"') ; ";
    Nimo.

  • Problem in Insertion into table through After Report Parameter form trigger

    Hi All,
    I am getting problem in inserting some data into temp table through Report.
    My requirement is like that, I have to do a calculation based on user parameters, and then insert the data into the temp table. I wanted to do this into After Report Parameter form trigger function. I have done all the calculation and wrote all the insert statement in that function. There is no problem in compilation. then I am taking value from this temp table in my formula columns.
    When I run this report, it hangs, don't understand what is the problem.Can anybody help me out in this.
    Thanks,
    Nidhi

    The code is as follows:
    function AfterPForm return boolean is
    CURSOR CUR_RECEIPT(RECEIPT_NUM_FROM NUMBER, RECEIPT_NUM_TO NUMBER) IS
    SELECT DISTINCT receipt, item_no FROM xxeeg.xxeeg_1229_sp_putaway WHERE RECEIPT BETWEEN
    RECEIPT_NUM_FROM AND RECEIPT_NUM_TO ;
    V_CUR_RECEIPT CUR_RECEIPT%ROWTYPE;
    begin
    OPEN CUR_RECEIPT(:RECEIPT_NUM_FROM, :RECEIPT_NUM_TO);
    FETCH CUR_RECEIPT
    INTO V_CUR_RECEIPT;
    LOOP
    EXIT WHEN CUR_RECEIPT%NOTFOUND;
    IF V_CUR_RECEIPT.ITEM_NO = 'TEST1' AND V_CUR_RECEIPT.RECEIPT = '12' THEN
    INSERT INTO SP_TEMP
    (RECEIPT, ITEM_NO, LOCATION1)
    VALUES
    (V_CUR_RECEIPT.RECEIPT, V_CUR_RECEIPT.ITEM_NO, 10);
    UPDATE SP_TEMP
    SET LOCATION2 = 12
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    UPDATE SP_TEMP
    SET LOCATION3 = 13
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    UPDATE SP_TEMP
    SET LOCATION4 = 14
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    ELSE
    IF V_CUR_RECEIPT.ITEM_NO = 'TEST2' AND V_CUR_RECEIPT.RECEIPT = '12' THEN
    INSERT INTO SP_TEMP
    (RECEIPT, ITEM_NO, LOCATION1)
    VALUES
    (V_CUR_RECEIPT.RECEIPT, V_CUR_RECEIPT.ITEM_NO, 10);
    UPDATE SP_TEMP
    SET LOCATION2 = 16
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    UPDATE SP_TEMP
    SET LOCATION3 = 17
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO =V_CUR_RECEIPT.ITEM_NO;
    UPDATE SP_TEMP
    SET LOCATION4 = 18
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    ELSE
    INSERT INTO SP_TEMP
    (RECEIPT, ITEM_NO, LOCATION1)
    VALUES
    (V_CUR_RECEIPT.RECEIPT, V_CUR_RECEIPT.ITEM_NO, 10);
    UPDATE SP_TEMP
    SET LOCATION2 = 19
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    UPDATE SP_TEMP
    SET LOCATION3 = 20
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO =V_CUR_RECEIPT.ITEM_NO;
    UPDATE SP_TEMP
    SET LOCATION4 = 21
    WHERE RECEIPT = V_CUR_RECEIPT.RECEIPT AND ITEM_NO = V_CUR_RECEIPT.ITEM_NO;
    END IF;
    END IF;
    END LOOP;
    COMMIT;
    CLOSE CUR_RECEIPT;
    return(TRUE);
    end;
    .....................................................................................................................

Maybe you are looking for

  • ITunes Library File Locked

    Hi, Have been using iTunes 10.5 on my WinXP machine - no problems.  During a movie download tonight, iTunes crashed.  Tried to reopen and got the infamous error "iTunes Library file locked or on a locked disk..."  Tried several remedies listed.  Veri

  • Swap cs6 from old computer to new computer

    I have recently purchased a new computer and I have installed cs6 to my old one. My question is how do I switch the programs over, or can it just be redownloaded.

  • Dump error in GB06

    Hi guys,               We are facing a dump error in GB06 tcode.Whenever a reverse posting is done its going for dump.It says - The following sytax error occured in the program SAPFGSTO and in include FGSTOI02 and in line 16.When i checked in line 16

  • Why does my Photos folder have this inside?

    So, to cut this short, I plugged my iPod in today and BAM! 6 Local Disks. What are these in my photos file? I ran a virus scan in there and no negative results were returned. Any help would be highly appreciated Thanks!

  • How to view changes made to Program code in PRD?

    Hi all, I'm currently auditing SAP landscape management and noted the following in the PRD environment: 1. table logging is disabled (transaction SM31) 2. profile logging is disabled 3. transaction SM20 doesn't give anything 4. don't have access to c