getting java.sql.SQLSyntaxErrorException: ORA-00936: missing expression error

John Park

I'm using JDBC to connect to the Oracle database and ask how many methods are in the String class. I keep getting the following error:

Exception in thread "main" java.sql.SQLSyntaxErrorException: ORA-00936: missing expression 

at the following line:

ResultSet res1 = stmt.executeQuery("SELECT (Distinct method_name) FROM all_java_method WHERE name LIKE 'String' Order BY method_name");

I don't have a ton of experience with SQL yet so any help would be appreciated. Thanks.

Alexander

Substitute (Distinct method_name) with Distinct method_name because that is the correct syntax for the SELECT
Also, you need to substitute 'String' with 'String%' or '%String%' (depends on what exactly are you wanna fetch, I don't know java, so...), otherwise it is logicaly become equal to name = 'String'

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

SQL Error -- ORA-00936: missing expression

From Dev

ora:00936 Missing Expression error

From Dev

ORA 00936 Missing Expression

From Dev

ORA-00936: missing expression, although there seems to be no missing expression (SQL)

From Dev

ORA-00936: missing expression, although there seems to be no missing expression (SQL)

From Dev

ORA-00936: missing expression error when inserting values

From Dev

Oracle data access error: ORA-00936: missing expression

From Dev

ORA-00936: missing expression bad SQL grammar

From Dev

java.sql.SQLSyntaxErrorException:: ORA-00907: missing right parenthesis error

From Dev

ORA-00936: missing expression distinct on oracle

From Dev

ORA-00936: missing expression - what is the cause?

From Dev

ORA-00936: missing expression oracle

From Dev

ORA-00936: missing expression in order by case

From Dev

ORA-00936: Missing Expression Teradata

From Dev

java.sql.SQLSyntaxErrorException: ORA-00905: missing keyword

From Dev

ORA-00936, Java and SQL

From Dev

Sql throws 'DBError: ORA-00936: missing expression' when empty expression_list is passed

From Dev

Entity Framework ExecuteStoreCommand gives {"ORA-00936: missing expression"}

From Dev

ORA-00936: missing expression while executing in C#.

From Dev

ORA-00936: missing expression ORACLE please help me

From Dev

ORA-00936: missing expression while using stringbuilder

From Dev

ORA-06550: line 12, column 9: PL/SQL: ORA-00936: missing expression ORA-06550: line 9, column 5: PL/SQL: SQL Statement ignored

From Dev

JDBC resultset not working when using aliases I receive " java.sql.SQLSyntaxErrorException: ORA-00905: missing keyword"

From Dev

HQL with one-to-many relationship is giving "ORA-00936: missing expression" exception

From Dev

HQL with one-to-many relationship is giving "ORA-00936: missing expression" exception

From Dev

java.sql.SQLSyntaxErrorException: ORA-00972: identifier is too long

From Dev

java.sql.SQLSyntaxErrorException: ORA-00903: invalid table name

From Dev

java.sql.SQLSyntaxErrorException: ORA-00947: not enough values

From Dev

java.sql.SQLSyntaxErrorException: ORA-00911: invalid character

Related Related

  1. 1

    SQL Error -- ORA-00936: missing expression

  2. 2

    ora:00936 Missing Expression error

  3. 3

    ORA 00936 Missing Expression

  4. 4

    ORA-00936: missing expression, although there seems to be no missing expression (SQL)

  5. 5

    ORA-00936: missing expression, although there seems to be no missing expression (SQL)

  6. 6

    ORA-00936: missing expression error when inserting values

  7. 7

    Oracle data access error: ORA-00936: missing expression

  8. 8

    ORA-00936: missing expression bad SQL grammar

  9. 9

    java.sql.SQLSyntaxErrorException:: ORA-00907: missing right parenthesis error

  10. 10

    ORA-00936: missing expression distinct on oracle

  11. 11

    ORA-00936: missing expression - what is the cause?

  12. 12

    ORA-00936: missing expression oracle

  13. 13

    ORA-00936: missing expression in order by case

  14. 14

    ORA-00936: Missing Expression Teradata

  15. 15

    java.sql.SQLSyntaxErrorException: ORA-00905: missing keyword

  16. 16

    ORA-00936, Java and SQL

  17. 17

    Sql throws 'DBError: ORA-00936: missing expression' when empty expression_list is passed

  18. 18

    Entity Framework ExecuteStoreCommand gives {"ORA-00936: missing expression"}

  19. 19

    ORA-00936: missing expression while executing in C#.

  20. 20

    ORA-00936: missing expression ORACLE please help me

  21. 21

    ORA-00936: missing expression while using stringbuilder

  22. 22

    ORA-06550: line 12, column 9: PL/SQL: ORA-00936: missing expression ORA-06550: line 9, column 5: PL/SQL: SQL Statement ignored

  23. 23

    JDBC resultset not working when using aliases I receive " java.sql.SQLSyntaxErrorException: ORA-00905: missing keyword"

  24. 24

    HQL with one-to-many relationship is giving "ORA-00936: missing expression" exception

  25. 25

    HQL with one-to-many relationship is giving "ORA-00936: missing expression" exception

  26. 26

    java.sql.SQLSyntaxErrorException: ORA-00972: identifier is too long

  27. 27

    java.sql.SQLSyntaxErrorException: ORA-00903: invalid table name

  28. 28

    java.sql.SQLSyntaxErrorException: ORA-00947: not enough values

  29. 29

    java.sql.SQLSyntaxErrorException: ORA-00911: invalid character

HotTag

Archive