Missing operator in query expression (Help)

Hi I'm trying to implement "OR" into my SQL statement and I think I'm doing something wrong.. Could someone take a quick look at my query and tell me where I'm missing this operator.
int insert=stmt.executeUpdate("INSERT INTO tblTest(EnglishName, FileName, RlsID, InitRlsInd, DirID, ObsoleteRlsInd) VALUES
("+"\'"+jTextFieldName.getText()+"\'"+","+
"\'"+jTextFieldFileName.getText()+"\'"+","+
"\'"+getComboID(jComboBoxRelease)+"\'"+","+
"\'"+getRadioID(jRadioButtonInitRlsY)+"\'"+","+"OR"+getRadioID (jRadioButtonInitRlsN)+"\'"+","+
"\'"+getComboID(jComboBoxDirectory)+"\'"+","+
"\'"+getRadioID(jRadioButtonObsoRlsY)+"\'"+","+"OR"+getRadioID(jRadioButtonObsoRlsN)+"\'"+ ")");
Thanks in advance.

cotton if your still out there..
String sql = "INSERT INTO tblTest("
+ "EnglishName,"
+ "FileName,"
+ "RlsID,"
+ "InitRlsInd,"
+ "DirID,"
+ "ObsoleteRlsInd,"
+ "VALUES(?,?,?,?,?,?)";
PreparedStatement pstmt = dB.prepareStatement(sql);
Now if I use pstmt and continue my INSERT I am not able to implement the values the users will put into the text and combo boxes..
I tried this for the textbox, but it doesn't work... pstmt.setString(jTextFieldName.getText()); I know this is obviously wrong, but I'm unfirmilar with prepared statments and I looked at the Java Docs and they don't show a specific example for what I want to do.. Atleast what I found doesnt. Could you show me a quick example??
Thanks,

Similar Messages

  • Missing operator in query expression

    Greetings,
    I'm attempting to access a MS Acess database, but getting the following error.
    Syntax error (missing operator) in query expression 'Org Name'.
    The error occurs between the following two lines.
    String SQL = "SELECT Org Name FROM OrganizationTable";
    ResultSet resultset = statement.executeQuery(SQL);Where Org Name is the data set I'm trying to access and OrganizationTable is the database table.
    Any help would be appreciated.

    What is happening is that the interpreter is seeing
    "Org Name" as two different columns and/or values and
    is expecting an operator. Somehow you need to
    indicate that it should be interpreted as a single
    column.
    Try one of these (I'm not sure if one will work since
    I don't work with access much, but I'm guessing that
    it would work similar to other dbs I've used):
    String SQL = "SELECT [Org Name] FROM
    OrganizationTable";
    or
    String SQL = "SELECT 'Org Name' FROM
    OrganizationTable";
    Thanks boss,
    I started to get it figured as I was able to open a result set that didn't have any whitespace in the name in the same table.
    FYI, [Org Name], did the trick. Single quotes do not work.
    Thanks again :)

  • Syntax error (missing operator) in query expression works in sql

    Hi guys,
    I am having a problem with this query in Access 2007, it runs
    fine in MSSQL.
    I get this error when I run it.
    [Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error
    (missing operator) in query expression
    'tbl_skuoption_rel.optn_rel_Option_ID = tbl_skuoptions.option_ID
    INNER JOIN tbl_skus ON tbl_skuoption_rel.optn_rel_SKU_ID =
    tbl_skus.SKU_ID INNER JOIN tbl_products AS p ON
    tbl_skus.SKU_ProductID = p.product_ID'.

    Access may require parenthesis ( ) around the JOINs when
    joining more than two tables

  • Syntax error (missing operator) in query expression

    Hi all
    I am creating a couple of pages where a dynamic list is created from an access database and then products from that list are displayed, the user then has the option of clicking more details, this then should pass the KITID over to the details page, However when i click on the details page i get the following error
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'KitID = Kit 01'.
    /classicclocks/Kieninger_gallery.asp, line 21
    Here is the code from the page i am building, can anybody see anything obvious here
    strKitID = Request.QueryString("KitID")
    ' If KitID does not exist then redirect to Gallery page
    If strKitID = False Then
      Response.Redirect("kit_gallerytest.asp")
    End If
    ' SQL Query for specific KitID details only
    Dim objRS
    Set objRS = Server.CreateObject ("ADODB.Recordset")
    ' Open new objRS
      strSQL = "SELECT KitID,ImgKitCatalogue,KitDescriptionShort FROM tblMovements WHERE KitID = " & strKitID & " ORDER BY KitID"
      objRS.Open strSQL, MM_dbConn_STRING,,,adCmdTable
      ' Get all rows from table and asign values to array for use in form
      Do While Not(objRS.EOF)
      Images = True
      fsImagesArray = objRS.GetRows()
        Const arrKitID = 0
        Const arrImgKitCatalogue = 1
        Const arrKitDescriptionShort = 2
      Loop
    ' Close objConn and objRS
    objRS.Close
    strSQL = "SELECT * From tblMovements WHERE KitID = " & strKitID
    objRS.Open strSQL, MM_dbConn_STRING
    thanks
    John

    String values in a SQL where clause must be wrapped in quotes. Try this:
    strSQL = "SELECT KitID,ImgKitCatalogue,KitDescriptionShort FROM tblMovements WHERE KitID = '" & strKitID & "' ORDER BY KitID"

  • How to solve System.Data.OleDbException (0x80040E14): Syntax error (missing operator) in query expression..

    The codes are..
     Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
            conn.ConnectionString = connstring
            If conn.State = ConnectionState.Closed Then
                conn.Open()
            Else
                MsgBox("Close")
            End If
            If (String.IsNullOrWhiteSpace(TextBox1.Text)) Then
                MessageBox.Show("PLEASE FILL IN ALL THE BOXES")
            ElseIf (String.IsNullOrWhiteSpace(TextBox2.Text)) Then
                MessageBox.Show("PLEASE FILL IN ALL THE BOXES")
            ElseIf (String.IsNullOrWhiteSpace(RichTextBox1.Text)) Then
                MessageBox.Show("PLEASE FILL IN ALL THE BOXES")
            End If
            Try
                Dim SqlQuery As String = "INSERT INTO Research (Title,Abstract,Proponents,Ryear) VALUES ('" & TextBox1.Text & "', '" & RichTextBox1.Text & "', '"
    & TextBox2.Text & "', '" & DateTimePicker1.Text & "')"
                Dim SqlCommand As New OleDbCommand
                With SqlCommand
                    .CommandText = SqlQuery
                    .Connection = conn
                    .ExecuteNonQuery()
                End With
                MsgBox("One record Succesfully Added")
            Catch ex As Exception
                MsgBox(ex.ToString)
            End Try
            Me.Close()
            main.Show()
        End Sub
    The situation is, I cannot add data if it is copied from the text from the ms word and paste it to the RichTextbox in my project..I can only add if I type Manually the data the richtextbox..If I copy paste it..this error comes out.
    Please help me to solve this problem..i attached the image of the error

    Windows Form forums are here.
    http://social.msdn.microsoft.com/Forums/windows/en-US/home?category=windowsforms
    or ASP.Net forums are over here.
    http://forums.asp.net/
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • "java ODBC Microsoft Access Driver Syntax error (missing operator) in query

    Hi I am new to java and I am getting this error message when using java to access and insert data into an MS Access database.
    "java ODBC Microsoft Access Driver Syntax error (missing operator) in query expression"
    The commands are
    String insertCommand = "INSERT into MetricOutput(A1,A,DRR,DeRR,RE,WDRR,WDeRR,WRE,ARF,SRF,HRF,WARF,WSRF,WHRF,SDC,WSDC,MAR,WMAR,H1,H11,H2,H21,cluster) "+
                             "VALUES("+comMappedCount+","+stdCount+","+DRR+","+DeRR+","+RE+","+WDRR+","+WDeRR+","+WRE+","+ARF+","+SRF+","+HRF+","+WARF+","+WSRF+","+WHRF+","+SDC+","+WSDC+","+MAR+","+WMAR+","+H1+","+H11+","+H2+","+H21+",+array)";

    "VALUES("+comMappedCount+","+stdCount+","+DRR+","+DeRR+","+RE+","+WDRR+","+WDeRR+","+WRE+","+ARF+","+SRF+","+HRF+","+WARF+","+WSRF+","+WHRF+","+SDC+","+WSDC+","+MAR+","+WMAR+","+H1+","+H11+","+H2+","+H21+",+array)";After looking at your post in the editor, I see what your real query looks like.  You realize that ",+array[i])" is part of the query, right?  And not actually looking at your Java array?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Query expression help

    Hello -
    I am very new to query in PeopleSoft. I need to calculate the amount of days that a position in HCM has been in a 'frozen' status.
    I know that I need to subtract the STATUS_DT from the current date (date that the query is run) and then show the results as a number in its own column, but I cannot get my expression to work. Is anyone familiar with this?
    Thank you in advance!

    This is the error I get:
    SQL error occurred. Please consult your system log for details.
    Error in running query because of SQL Error, Code=8601, Message=[Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor. [Microsoft][SQL Native Client][SQL Server]'TO_DATE' is not a recognized built-in function name. [Microsoft][SQL Native Client][SQL Server]Incorrect syntax near the keyword 'AND' (50,380)
    When I create the expression, I can do the following:
    Select Expression Type (Char, Num, Date, etc). I am choosing Number.
    Select the Length fo the characters. I am putting 4 as the length.
    Enter in Expression Text. I am entering your text into this field and replacing STATUS_DT with E.STATUS_DT.
    Like I said. i am new at this, so might need a more basic explanation.

  • [ODBC Microsoft Access Driver] Syntax error (missing operator)

    Aello' - as you can see in my database table their are two
    records to delete based on the HISTORY_ID of 1. This was working
    just fine when I was using a MS SQL Server database but when I
    switched to the MS Access database I get this error now.
    Is their a syntax difference?

    mikeap wrote:
    > Attached code. Clearly their are records to delete, what
    am I missing?
    >
    > Using MS Access database.
    >
    > [Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft
    > Access Driver] Syntax error (missing operator) in query
    expression
    > 'R_PROJECT_MEDIA WHERE Media_ID IN (1)'.
    >
    > <cfquery datasource="tbar">
    > DELETE R_HISTORY_MEDIA
    > WHERE History_ID IN (#FORM.pHistory#)
    > </cfquery>
    DELETE
    FROM R_HISTORY_MEDIA
    WHERE History_ID IN (#FORM.pHistory#)
    Jochem
    Jochem van Dieten
    Adobe Community Expert for ColdFusion

  • Syntax error in query expression

    I am receiving the following error message:
    Microsoft][ODBC Microsoft Access Driver] Syntax error
    (missing operator) in query expression 'customerid_cus='.
    for the following code:
    If IsEmpty(Request.Form("company_cus")) Then
    rs_company.Source = "SELECT customerid_cus, company_cus FROM
    customers_cus WHERE customerid_cus= "&
    Request.QueryString("customerid") &" "
    Else
    rs_company.Source = "SELECT customerid_cus, company_cus FROM
    customers_cus WHERE company_cus = '"&
    Request.Form("company_cus") &"' "
    End If
    What could the problem be?

    Are you sure that you are passing the querystring customerid
    when the form
    company_cus is empty.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "aonefun" <[email protected]> wrote in
    message
    news:epmf3n$f3u$[email protected]..
    >I am receiving the following error message:
    >
    > Microsoft][ODBC Microsoft Access Driver] Syntax error
    (missing operator)
    > in
    > query expression 'customerid_cus='.
    >
    > for the following code:
    >
    > If IsEmpty(Request.Form("company_cus")) Then
    >
    > rs_company.Source = "SELECT customerid_cus, company_cus
    FROM
    > customers_cus
    > WHERE customerid_cus= "&
    Request.QueryString("customerid") &" "
    >
    > Else
    >
    > rs_company.Source = "SELECT customerid_cus, company_cus
    FROM
    > customers_cus
    > WHERE company_cus = '"& Request.Form("company_cus")
    >
    > End If
    >
    > What could the problem be?
    >

  • Issue sourcing from Microsoft Access - Syntax error (missing operator)

    I apologize if this has been discussed before. I used the search and went through 7 pages of results, but didn't see a similar issue.
    I'm using Windows 7, ODI 11.1.1.5.
    I'm trying to source from a local MS Access DB to an Oracle DB.
    The session fails pretty much immediately (on step 3) - trying to pull data from the source table.
    "Syntax error (missing operator) in query expression"
    The source table is very simple and for this test I'm using no joins. Literally a 'select * from'.
    However - when I look at the SQL generated - it's wrong. It's got duplicate lines in the SQL and not all columns selected have a comma after and before the next column.
    If I run it direct on Access - I get the same error.
    If I clean up the SQL - it'll run fine on Access.
    I'm using the SQL to Oracle LKM.
    I wondered if it was something with the ODBC driver - so I've tried other versions of ODBC drivers for MS Access, and even switched the database itself from the Office 2007 format, back to 2003, and tried a driver for that.
    Same result.
    If I go to the model and right click and look for the data in the table - it displays fine. So obviously ODI can connect and see the data...
    So I guess my questions are:
    - is the SQL to Oracle LKM the correct one to source from Access ? I've even gone into it and specified MS Access as the source. Same result.
    - if it is the right one - what's going on ?? I've got to assume other people are pulling data from MS Access. Why the garbage SQL ? Clearly I'm missing something.
    - and finally - worst case - but is there a way for me to overwrite the SQL being generated so I can correct it myself. This will be a PITA since I'll be source from a bunch of tables - but at least it might be a temporary stop gap...
    thanks

    I'm going to mark this as closed for now. I solved the SQL issue. It was to do with the way the tables / fields were named and how the fields were being brought into the workflow. Tidying up there fixed the problem.
    Getting past that brought me to several other issues which I'm still working through. The current is an Invalid Fetch size error - but that appears to have been resolved in patch Doc ID: 13528165 in ODI 11g (ver 11.1.1.5.0)
    given the initial issue that I'd raised is no longer a concern - I'm closing.
    Edited by: 940843 on Jun 15, 2012 1:27 PM

  • HELP! How can i restore/recover files from Bootcamp with Boot Failure - Missing operating system error?

    Hi,
    I am having a few problems with bootcamp on my imac. When i tried to move the bootcamp partition on windows 7 into free space, it crashed and turned off. Ever since i have had the error 'Missing operating system' and it fails to boot. I have some very important files on the bootcamp partition. Is it possible to recover these files or even to restore the bootcamp partition to it's original state? I do not have a backup of my bootcamp partition. Another problem i have is that ever since i tried to expand my macintosh HD partition into free space, when i hold alt while booting up (to choose which partition to boot like i normally do), the bootcamp partition has stopped appearing. This means that i cannot even boot the windows 7 bootcamp partition anymore!
    So basically here are my 2 questions:
    How can i restore/recover files from Bootcamp with Boot Failure - Missing operating system error?
    How can i make the Bootcamp partition appear in Startup Disk and when i hold the option key while starting up my computer to allow me to boot windows 7?
    Any solutions are very much apreciated!
    Thanks!
    I know that bootcamp (disk0s4) hasn't been fully deleted since it appears in disk utility (i cant do anything to it though)
    And here is the error i see when i try to launch bootcamp (back when i was actually able to boot up bootcamp to the error screen)

    WinClone 3 is OS X and saves Windows image it makes for restore - that should work but you will have to try and you would need to make a new image unless it also works with a native Windows system restore image. It is now supported and has come a long way.
    http://www.twocanoes.com/
    Paragon Clone OS works and does disk-to-disk clone just like CCC you end up with two bootable drives. But does not work with your setup. It would let you clone and move your Windows install to an SSD or another disk drive though and be bootable.
    During its clone process it checks for errors which is very helpful and lets you know - something CCC and others should adopt more of.
    http://www.paragon-software.com/downloads/demo.html
    I wish for our/my sake you had re-read and rewritten the long 'story' and broken it into a brief list of facts we needed.
    OS X
    Windows
    Backup (though external is much safer) and you want bootable OS X clones as well as TimeMachine
    https://support.apple.com/kb/HT1427
    https://support.apple.com/kb/HT1553
    There are a number of things to do like chkdsk and others as well as Windows DVD to do automatic system repairs and find out why.
    AppleHFS - the abilty to mount and read HFS volumes can be notorious.
    I would rearrange and redo your storage setup and how you use the 4-5 internal hard drive bays.

  • Help! This is driving me crazy. CASE statement report syntax error (missing operator)

    Hi
    Can anyone help with this SQL statement please. It uses a
    CASE statement but I keep getting back a syntax error (missing
    operator) error message. The SQL statement works without the CASE
    statement, so everything else is fine - its just when I put the
    CASE statement back in.
    Here's the SQL statement:-
    SELECT transactions.ourRef, transactions.transDate, CASE WHEN
    transactions.transTypeID = 2 THEN transactionDetails.goodsVatable *
    -1 ELSE transactionDetails.goodsVatable END,
    transactionDetails.goodsNonVat, transactionDetails.VAT,
    transactionDetails.grandTotal, clients.clientCode,
    transTypes.transTypeDesc
    FROM transactions, transactionDetails, clients, transTypes
    WHERE transactions.transID = transactionDetails.transID
    AND transactions.clientID = clients.clientID
    AND transactions.transTypeID = transTypes.transTypeID
    TransID = 2 means that its a credit not instead of an
    invoice, therefore I want the goods vatable returned as a negative
    number.
    Thanks in advance.
    Wez

    quote:
    ...the client wishes for me to use an MS Access db
    Too bad you didn't say that to begin with. I believe that
    with Access you might consider using IIF().
    Syntax:
    IIf(expr, truepart, falsepart)
    SELECT transactions.ourRef,
    transactions.transDate,
    IIf(transactions.transTypeID = 2,
    transactionDetails.goodsVatable * -1,
    transactionDetails.goodsVatable),
    transactionDetails.goodsNonVat,
    transactionDetails.VAT,
    transactionDetails.grandTotal,
    clients.clientCode,
    transTypes.transTypeDesc
    FROM transactions, transactionDetails, clients, transTypes
    WHERE transactions.transID = transactionDetails.transID
    AND transactions.clientID = clients.clientID
    AND transactions.transTypeID = transTypes.transTypeID
    Phil

  • Help :ge600 win7 home permium - after recovery , missing operating system

    i press f3 and and choose recovery from menu
    message me recovery success press ok to restarting
    then
    black screen and missing operating system .
    plz help soon

    the result of quick search again, doing the deeper search now..
    http://www.cgsecurity.org
    Disk /dev/disk0 - 1000 GB / 931 GiB - 1953525168 sectors (RO)
         Partition               Start        End    Size in sectors
    >P EFI System                    40     409639     409600 [EFI]
    D Mac HFS                   409640  784286823  783877184
    D Mac HFS                   409640 1187802503 1187392864
    D Mac HFS                784286824  785556359    1269536
    D MS Data               1185742409 1578317384  392574976
    D Mac HFS               1187802504 1565289863  377487360
    D MS Data               1336457409 1747931328  411473920
    D MS Data               1336491681 1747965600  411473920
    D MS Data               1345430017 1756903936  411473920
    D MS Data               1365586273 1758161248  392574976
    D MS Data               1366505153 1759080128  392574976
    D MS Data               1606725547 1606731720       6174
    D MS Data               1606731720 1606737893       6174 [Boot]
    D MS Data               1606731739 1606737912       6174
    D MS Data               1606737912 1606744085       6174 [Boot]
    D MS Data               1606737931 1606744104       6174
    Structure: Ok.  Use Up/Down Arrow keys to select partition.
    Use Left/Right Arrow keys to CHANGE partition characteristics:
                    P=Primary  D=Deleted
    Keys A: add partition, L: load backup, T: change type, P: list files,
         Enter: to continuelogout
    FAT32, blocksize=512, 209 MB / 200 MiB

  • Lion install in BootCamp.  Now "Missing Operating System"!  Help!

    Just installed Lion w BootCamp on a white MB and now when I boot to the Win7 side, I get "Missing Operating System".  Any ideas how to fix this? 
    Thanks in advance.

    This is the same problem that I find myself. Help me.
    Este es el mismo problema en el que me encuentro.
    Re: Lion install in BootCamp.  Now "Missing Operating System"!  Help! 
    02-ago-2011 4:49 (in response to William Cochran)
    hey can you tell me how to do that?
    because when I press the option/alt button on the keyboard, there's just two boot source option , because before upgrade into lion, I have windows 7 too in my mac
    There are only two boot option : 1.Macintosh HD , 2.Recovery HD
    I just finished downloading the Bootpicker, and got no idea how to use it to change the boot and getting back my windows 7, I have lots of critical data in there

  • "Missing operating system" help!

    Hey all,
    My Mini's hard drive died the other day, so I installed a new one. I have the OSX dvd in my drive, and when I go to boot up, I get an error message "Missing operating system."
    If I try to boot from CD by holding down the C button on my keyboard, nothing happens -- same error message. It appears my USB keyboard isn't powered.
    Any ideas?

    The Apple Aluminum keyboard doesn't work with the startup keys on the mini.
    You can use your Apple remote instead: as soon as you hear the startup chime or beep, hold down the menu button on the remote. It will put disc icon up on the screen that you can select with your mouse.
    Keep in mind that you need to use the install disc that shipped with your model of Mini -- or else a full retail version.

Maybe you are looking for

  • Initial View is disabled on a Form created in LiveCycle ES2

    Hi, I am trying to change the preferences using the Initial View tool in Acrobat.  I want to set it to open with bookmarks visible.  However, the entire initial view page is disabled for me.  The PDF is one that I created myself using LiveCycle Desig

  • Weblogic6.1 sp3 and oracle9.2.0.6

    Hi, We are migrating oracle8i to ora9.2.0.6 and app is running in weblogic6.1 sp3 on sun solaris5.8. we are using oracle oci driver.i have kept required dll's and classes12.jar in path.when try to read CLOB i am getting the below error. java.sql.SQLE

  • HT201269 sync ipad and itouch

    I am trying to share content frin my iPad and iTouch - picas and music using iCloud? COULD NOT !!! Any one has easy stepsthat do work ?

  • Can you tether a Palm Trio 700p to a MacBook and use Safari & Entourage?

    I am trying to make a decision whether to keep my new Palm Trio 700p and upgrade from my PowerBook G4 1.25 to a dual processor MacBook or MacBook Pro. It depends on whether I can download the necessary Verizon software to the Windows side of the new

  • Why do you insist in calling my home phone EVERY hour to complete a survey!

    I have been interrupted on no less than 3 conference calls while working from home today. I even called and politely asked that I stop receiving them but received ANOTHER interruption. I am happy to complete a survey but not during my work day and th