Menu

#99 Allow sub-queries in SQL FROM clause

open
nobody
None
5
2016-02-19
2016-02-08
No

Allow sub-queries in the FROM clause of SQL statements. For example,

SELECT ID FROM (SELECT ID FROM sample) AS X

CsvJdbc currently throws an SQLException for this SQL statement, without any helpful information in the error message.

java.sql.SQLException: Syntax error: Encountered " "FROM" "FROM "" at line 1, column 27.
Was expecting:
<EOF>

at org.relique.jdbc.csv.CsvStatement.executeQuery(CsvStatement.java:298)
at org.relique.jdbc.csv.Runner2.main(Runner2.java:64)

Discussion

  • Simon Chenery

    Simon Chenery - 2016-02-08

    Originally reported in csvjdbc-develop forum topic message for queries on derived tables .

     
  • Simon Chenery

    Simon Chenery - 2016-02-19

    Provide readable "derived tables not supported" error message if derived table used in SQL SELECT statement.

    Added unit test TestSubQuery.testDerivedTable.

    Files changed:
    src/main/java/org/relique/jdbc/csv/ParsedStatement.java
    src/main/java/org/relique/jdbc/csv/ParsedTable.java
    src/main/java/org/relique/jdbc/csv/SqlParser.java
    src/main/javacc/org/relique/jdbc/csv/where.jj
    src/main/resources/org/relique/jdbc/csv/messages.properties
    src/test/java/org/relique/jdbc/csv/TestSubQuery.java

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.