Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7934449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:39:02+00:00 2026-06-03T21:39:02+00:00

Below I am creating table. public static final String CREATE_SQL = CREATE TABLE +DATABASE_TABLE

  • 0

Below I am creating table.

    public static final String CREATE_SQL = "CREATE TABLE " +DATABASE_TABLE +
        "(ID number(10,0), " +
        " CGUID VARCHAR(255), " + 
        " PGUID VARCHAR(255), " + 
        " SGUID VARCHAR(255), " + 
        " USERID VARCHAR(255), " +
        " ULOC VARCHAR(255), " +
        " SLOC VARCHAR(255), " +
        " PLOC VARCHAR(255), " +
        " ALOC VARCHAR(255), " +
        " SITEID VARCHAR(255), " +
        " ATTRIBUTEID VARCHAR(255), " +
        " ATTRIBUTEVALUE VARCHAR(255), " +
        " PRIMARY KEY ( ID ))";

This is the below UPSERT_SQL query when I am trying to update my database table I am always getting- java.sql.SQLException: ORA-00936: missing expression
. I checked my SQL, I am not able to find where the expression is missing. Is something wrong with the below SQL?

public static final String UPSERT_SQL = "MERGE INTO " +DATABASE_TABLE+ " USING (  SELECT ? AS ID, " +    // We will maybe add this record
    "                ? AS CGUID, " +
    "                ? AS PGUID, " +
    "                ? AS SGUID, "+
    "                ? AS USERID, "+
    "                ? AS ULOC, "+
    "                ? AS SLOC, "+
    "                ? AS PLOC, "+
    "                ? AS ALOC, "+
    "                ? AS SITEID, "+
    "                ? AS ATTRIBUTEID, "+
    "                ? AS ATTRIBUTEVALUE, "+
    "                FROM dual ) maybe "+
    "   ON (maybe.ID = "+DATABASE_TABLE+".ID) "+
    "         WHEN MATCHED THEN "+
            // We only need update the fields that might have changed
    "       UPDATE SET " +DATABASE_TABLE+ ".ULOC = maybe.ULOC, " +DATABASE_TABLE+ ".SLOC = maybe.SLOC, " +DATABASE_TABLE+ ".PLOC = maybe.PLOC, " +DATABASE_TABLE+ ".ALOC = maybe.ALOC "+
    "         WHEN NOT MATCHED THEN "+
       // Insert new record
    "   INSERT VALUES (maybe.ID, maybe.CGUID, maybe.PGUID, maybe.SGUID, maybe.USERID, maybe.ULOC, maybe.SLOC, maybe.PLOC, maybe.ALOC, maybe.SITEID, maybe.ATTRIBUTEID, maybe.ATTRIBUTEVALUE)";

And from below I am executing that UPSERT_SQL Statement.

LnPDataConstants.PSTMT = LnPDataConstants.DB_CONNECTION.prepareStatement(LnPDataConstants.UPSERT_SQL); // create a statement
                        LnPDataConstants.PSTMT.setInt(1, (int) ind);
                        LnPDataConstants.PSTMT.setString(2, LnPDataConstants.CGUID_VALUE);
                        LnPDataConstants.PSTMT.setString(3, LnPDataConstants.PGUID_VALUE);
                        LnPDataConstants.PSTMT.setString(4, LnPDataConstants.SGUID_VALUE);
                        LnPDataConstants.PSTMT.setString(5, LnPDataConstants.UID_VALUE);
                        LnPDataConstants.PSTMT.setString(6, LnPDataConstants.ULOC_VALUE);
                        LnPDataConstants.PSTMT.setString(7, LnPDataConstants.SLOC_VALUE);
                        LnPDataConstants.PSTMT.setString(8, LnPDataConstants.PLOC_VALUE);
                        LnPDataConstants.PSTMT.setString(9, LnPDataConstants.ALOC_VALUE);
                        LnPDataConstants.PSTMT.setString(10, LnPDataConstants.SITEID_VALUE);
                        LnPDataConstants.PSTMT.setString(11, "10200");
                        LnPDataConstants.PSTMT.setString(12, attrValue1.toString().split("=")[1]);
                        LnPDataConstants.PSTMT.executeUpdate();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:39:03+00:00Added an answer on June 3, 2026 at 9:39 pm

    Yes, there is something wrong with the SQL, and it is that you wrote a comma before FROM dual. This causes Oracle’s SQL parser to complain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a node by using crrm as below $(#TreeDiv).jstree(create, $(#somenode), inside, {
I'm getting this error on ORM Lite when creating table ActivityLog : 10-23 04:06:32.255:
The code below is creating a server to communicate with clients.This code works fine
How can you put an array to the WHERE -clause below without creating 50
Below I am creating an object in JavaScript. Within the constructor I am setting
I am creating an XDocument as shown below. The output has xmlns = for
I am creating a chunk of HTML/JavaScript with the below code: $result = mysql_query(SELECT
I am creating a random ID using the below code: from random import *
I am creating UIButtons inside a loop as shown below. for(int i = 1;
Below is my way, albeit a basic way of creating a Decision Tree...The problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.