Error Message when entering data into a table from an array

When i use the following:
stmt.executeUpdate("INSERT INTO Car " + "VALUES (" + temp + ", " + carData[0] + ", " + carData[1] + ", " + carData[2] + ", " + carData[3] + ", " + carData[4] + ", " + carData[5] + ", " + carData[6] + ", " + carData[7] + ", " + carData[8] + ", " + carData[10] + ", " + carData[11] + ", " + carData[12] + ", " + carData[9] + ", " + carData[13] + ", " + carData[14] + ", " + carData[15] + ", " + carData[16] + ", " + carData[17] + ", " + carData[18] + ", " + carData[19] + ", " + carData[20]+")");
i get the following error message:
SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Audi A2 (Standard & SE)'.
where: 'Audi A2 (Standard & SE)' is the value stored in carData[4].
Can anyone help?

You need to enclose carData[0],carData[1] etc in single quotes, if they are String(s). Otherwise you can use PreparedStatement.
PreparedStatement ps = con.prepareStatement("Insert into car values(22 questions marks)");
ps.setInt(1,temp);
for(int i=0;i<21;i++) ps.setString(i+2,carData[ i ]);
int count=ps.executeUpdate();
Sudha

Similar Messages

  • Getting error message when passing data into table: Primary Key

    Getting an error in a process that is feeding the invoice creation in SAP, violation of PRIMARY KEY constraint 'INV1_Primary', cannot insert duplicate key in object 'INV1'. I assume this is due to duplicate key values being passed into the table INV1, however I get this error even when I am passing unique record combinations of the key fields docentry and linenum. This is on 2005A SP01.
    Thanks

    Hi Peter,
    Could you provide a code sample of the routine that is causing the error please?
    It sounds like a data corruption issue (though it could possibly be a bug in the DI API). I recommend you speak to SAP support. There is a utility that can validate the document numbering but you'll need to speak to SAP support before you run this as it can have other negative effects, depending on the state of your data. They may ask for a copy of your database to test.
    Kind Regards,
    Owen

  • Error Message When Inserting Data Into Table

    Hi,
    I am trying to insert the following value into my customer table, however i get the following error on doing so.
    ERROR: date format picture ends before converting entire input string
    STATEMENT:
    insert into phonecall (start_date_time)
    values(10-JAN-2006 11:53:09)
    any ideas as to what might be wrong with my insert statement to bring up this error ??
    start_date_time is a DATE field by the way.

    Or
    SQL> alter session set nls_date_format='DD-MM-YYYY HH24:MI:SS';
    Session altered.
    SQL> create table aa (test date)
      2  /
    Table created.
    SQL> insert into aa values ('11-12-2006 12:11:22')
      2  /
    1 row created.
    SQL> select * from aa ;
    TEST
    11-12-2006 12:11:22
    SQL>

  • Error message when importing data using Import and export wizard

    Getting below error message when importing data using IMPORT and EXPORT WIZARD
    Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    <dir>
    <dir>
    Messages
    Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description: "Could not allocate a new page for database REPORTING' because of insufficient disk space in filegroup 'PRIMARY'.
    Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.".
    (SQL Server Import and Export Wizard)
    Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "Destination - Buyer_.Inputs[Destination Input]" failed because error code 0xC020907B occurred, and the error row disposition on "Destination
    - Buyer_First_Qtr.Inputs[Destination Input]" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
    (SQL Server Import and Export Wizard)
    Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "Destination - Buyer" (28) failed with error code 0xC0209029 while processing input "Destination Input" (41). The
    identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information
    about the failure.
    (SQL Server Import and Export Wizard)
    Error 0xc02020c4: Data Flow Task 1: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.
    (SQL Server Import and Export Wizard)
    </dir>
    </dir>
    Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on Source - Buyer_First_Qtr returned error code 0xC02020C4.  The component returned a failure code when the pipeline engine called PrimeOutput().
    The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
    (SQL Server Import and Export Wizard)
    Smash126

    Hi Smash126,
    Based on the error message” Could not allocate a new page for database REPORTING' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting
    autogrowth on for existing files in the filegroup”, we can know that the issue is caused by the there is no sufficient disk space in filegroup 'PRIMARY' for the ‘REPORTING’ database.
    To fix this issue, we can add additional files to the filegroup by add a new file to the PRIMARY filegroup on Files page, or setting Autogrowth on for existing files in the filegroup to increase the necessary space.
    The following document about Add Data or Log Files to a Database is for your reference:
    http://msdn.microsoft.com/en-us/library/ms189253.aspx
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • What is the transaction code to enter data into mkpf table

    Hi,
    I want to enter data into mkpf table but through a transaction code.
    What is the transaction code?
    Thanks.
    deniz.

    Hi,
    Go to SE16N transaction code.
    Now you enter the table name ex: u201CMKPF u201C, if u wants to insert the values.
    in Command bar
    you enter the transaction code u201C &SAP_EDIT u201D. 
    Press enter.
    Then click on execute button. 
    Now here I would like to change some data.
    Here we can do any operation in application tool bar.
    Enter values
    And click on save button.  
    Regards,
    Sujit

  • HT202159 When downloading os x lion, i got an error message, when going back into purchased items in app store to resume, i found i had no resume button. what can i do?

    .

    When downloading os x lion, i got an error message, when going back into purchased items in app store to resume, i found i had no resume button. what can i do?

  • HT2731 why do i get an error message when entering my credit card information?

    why do i get an error message when entering accurate credit card information?

    If you would like help from these forums then saying what the error message is would be useful.
    The card is registered to exactly the same name and address as you have on your iTunes account ? And it was issued by a bank in the country where you and your iTunes account are ?

  • I am getting error messages when keying entries into SAP in transaction cod

    I am getting error messages when keying entries into SAP in transaction code F-02.  It will tell me that an asset doesn't exist in the company code I am posting to when the asset does exist.  For example in the parked document 101079622 it tells me that asset WV0707711 doesnt' exist in CoCode .  But what is keyed in the document is WV07077 1 1. 
    And when i look in Transaction AS03 for this asset number it does indeed exist in Co Code.  Also if you take these assets out and park it and then go into Transaction FBV2 and add the asset back into the document it will add it and then post to it.  This happens often and is very time consuming.  I need to know how to fix this without all this additional effort

    Hi,
    it is urgent can any one help on this.
    Thanks,
    Sridhar Reddy.G

  • Insert data into fact table from source database tables

    here i try to insert data into fact table from source database tables here is the query 
    ALTER procedure [dbo].[facttable]
    as
    insert into [pp dw].dbo.Dimfact(Prod_ID,Production_ID,Material_ID,Equip_ID,WC_ID,Recipe_ID,Quantity,costprice)
    select Products.[Product ID],[Production ID],Materials.[Material ID],[Equipment ID],[Work Centre ID],[Recipy ID],Quantity,[cost price]
    from
    [PRODUCTION PLANNING 2].dbo.[Products],
    [PRODUCTION PLANNING 2].dbo.[Production Detail],
    [PRODUCTION PLANNING 2].dbo.[Material category],
    [PRODUCTION PLANNING 2].dbo.[Materials],
    [PRODUCTION PLANNING 2].dbo.[Equipment],
    [PRODUCTION PLANNING 2].dbo.[Working Centre] ,
    [PRODUCTION PLANNING 2].dbo.[Recipies]
    where
    Products.[Product ID] in (13, 14, 15, 16, 17) and
    [Production Detail].[Production ID] in (1, 2, 3) and
    [Materials].[Material ID] in (1, 2, 3, 4, 5) and
    [Equipment].[Equipment ID] in (1, 2, 3, 4) and
    [Working Centre].[Work Centre ID] in (1, 2, 3) and
    [Recipies].[Recipy ID] in (1, 2, 3) and
    [Material category].[Category ID] in (8, 9, 10, 11, 12, 13)
    and when i execute query it shows me error 
    The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Dimfact_Dimproduct". The conflict occurred in database "pp dw", table "dbo.Dimproduct", column 'Prod_ID'.
    ERD IS
    HOW TO SOLVE THIS PROBLEM?

    I cant see any join conditions in your query posted. Whats the purpose of the query above. It will just bring you a cartesian product (cross join) of tables involved subjected to filters. Are you sure this is the correct query?
    The error you're getting may be because you've not yet populated DimProduct or may be because of logic you used in popultaing DimProduct causing it to miss some records which is what query is referring to in above case.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How do I run a database procedure that inserts data into a table from withi

    How do I run a database procedure that inserts data into a table from within a Crystal report?
    I'm using CR 2008 with an Oracle 10i database containing a number of database tables, procedures and packages that provide the data for the reports I'm developing for my department.  However, I'd like to know when a particular report is run and by whom.  To do this I have created a database table called Report_Log and an associated procedure called prc_Insert_Entry that inserts a new line in the table each time it's called.  The procedure has 2 imput parameters (Report_Name & Username), the report name is just text and I'd like the username to be the account name of the person logged onto the PC.  How can I call this procedure from within a report when it's run and provide it with the 2 parameters?  I know the procedure works, I just can't figure out how to call it from with a report.
    I'd be grateful for any help.
    Colin

    Hi Colin, 
    Just so I'm clear about what you want: 
    You have a Stored procedure in your report.  When the report runs, you want that same procedure to write to a table called Report_Log. 
    If this is what you want the simple answer is cannot be done.  Crystal's fundamental prupose is to read only, not write.  That being said, there are ways around this. 
    One way is to have a trigger in your database that updates the Report_Log table when the Stored Procedure is executed.  This would be the most efficient.
    The other way would be to have an application run the report and manage the entry. 
    Good luck,
    Brian

  • Write permission error message when I try to 'save image' from elements 12 raw camera to main editing section?

    I get a 'write permission error' message when I try to 'save image' from Raw Camera sector to the main editing section of Elements 12. How can I overcome this problem?

    Well, first of all Save Image doesn't have anything to do with moving a raw file into the regular editor. That's the DNG converter. Evidently you are trying to create a dng file in a place where you don't have permission to write. Take a look at the location and change it to someplace where you can write. An example would be opening a file that's on a disc and trying to save back to that disc.
    But you should still be clicking the Open button instead of the Save Image button if you want to do anything other than make a DNG file.

  • Deleted items from Ipod Nano to make room for new. Emptied trash. Still getting error message when I try to copy items from ITunes to Ipod. What should I do now?

    Deleted items from Ipod Nano to make room for new. Emptied trash. Still getting error message when I try to copy items from ITunes to Ipod. What should I do now?

    If you delete songs (and other items) from the main iTunes library, yes, you need to empty the Trash because iTunes puts the song files into the Trash.  When deleting items from an iPod, the items are not being deleted from the main iTunes library, so nothing should end up in the Trash.
    Hopefully, you are not deleting items from your main iTunes library, just to sync those deletions from the iPod.  If you are, there is a better way.  You can post back if you want more info...

  • How to insert data into a table from an xml document

    using the XmlSql Utility, how do I insert data into a table from an xml document, using the sqlplus prompt.
    if i use the xmlgen.insertXML(....)
    requires a CLOB file, which i dont have, only the xml doc.
    Cant i insert directly from the doc to the table?
    the xmlgen examples I have seen first convert a table to a CLOB xmlString and then insert it into another table.
    Isnt there any other way?

    Your question is little perplexing.
    If you're using XML SQL Utility from
    the commandline, just use putXML.
    java OracleXML putXML
    null

  • Insert data into oracle table from XML file

    I need to insert data into oracle table from XML file
    If anybody handled this type of scenario, Please let me know how to insert data into oracle table from XML file
    Thanks in advance

    The XML DB forum provides the best support for XML topics related to Oracle.
    Here's the FAQ on that forum:
    XML DB FAQ
    where there are plenty of examples of shredding XML into Oracle tables and such like. ;)

  • Why do i get an error message when i try to transfer photos from my pc to my ipad

    why do i get an error message when i try to transfer photos from my pc to my ipad

    Don't know why, what exactly is the error message?

Maybe you are looking for

  • Application Switcher Not Working correctly

    Selecting a program opens desired program properly(as displayed in Menu Bar) but will not open the corresponding program's open windows until selecting program in a Mission Control desktop. After selecting the desktop to which the program is attached

  • How do I 'save as' on imovie 10 projects?

    Hi I've created a movie in imovie but need to modify content and save as - how do I do this? Why has the file functionality been taken off - very frustrating! Cheers

  • Reset hp envy 4500 printer to default factory settings

    The printer indicates that the cartridges are not suitable for this printer. That is strange, because both cartridges are original HP cartridges. I'm looking for a way to reset the printer to the default factory settings, but I can't find a way to do

  • Data lost in Weblogic 6.0 web server cluster

    We developed a system using JSP+Servlet+Weblogic 6.0. We use web sever cluster provided by weblogic 6.0. We implemented a business logic to login user data. Because data user has to input is too much, there are multiple pages for user to login data.

  • Dreamweaver CS6 will not open

    I asked this question last week, but have not gotten an answer. I have Dreamweaver CS6 as part of the Cloud. I am using Lion 10.7.4. When I double click on Dreamweaver it gets the little white dot under it, like it's open, but it's there for only a s