Questions tagged [jsqlparser]

JSqlParser is a SQL statement parser. It translates SQLs in a traversable hierarchy of Java classes.

About

JSqlParser is a SQL statement parser. It translates SQLs in a traversable hierarchy of Java classes.

JSqlParser is not limited to one database but provides support for a lot of specials of Oracle, SqlServer, MySQL, PostgreSQL ...

To name some, it has support for Oracles join syntax using (+), PostgreSQLs cast syntax using ::, relational operators like != and so on.

Links

60 questions
0
votes
0 answers

JSQLPARSER with ExpressionDeParseron with insert/select

I use the jsqlparser framework to intercept the SQL launched by the client program on a MySQL database. I would like that for some fields (columns) during the insertion / update, I use AES_ENCRYPT on parameter (?) And the same, I use of AES_DECRYPT…
Ardile
  • 9
0
votes
1 answer

JSqlParser for Data Lineage?

We are a data warehouse development team and most of our ETL logic can be expressed as a series of SQL select statements. I am looking for a tool to extract data lineage in a structured manner by parsing the queries. The query and the simplified…
Anand Kannan
  • 141
  • 3
  • 8
0
votes
0 answers

OutOfMemory Error on parsing a big SQL query

While parsing a big SQL query, I am getting JVM OutOfMemory error. This error raised during SQL query translation using JSqlParser. The below lines coped from the thread error stack: Thread 0x648608688 at java.lang.OutOfMemoryError.()V…
Britto
  • 1
  • 4
0
votes
1 answer

Cannot resolve method accept for JSQLParser

For condition.accept I get the error "cannot resolve method 'accept(cs4321.project2.Operators.SelectExpressionVisitor)". I'm not sure why because I'm following the Expression accept method syntax correctly. public class SelectExpressionVisitor…
Alex
  • 2,369
  • 3
  • 13
  • 23
0
votes
2 answers

Remove an expression in JSqlParser

I'm trying to find the easiest way to remove an expression (for example, a condition) from a query parsed with JSQLParser. Let's assume I have the following query (no real logic here): select a,b,c from table where a > 1 and c > 4 and a =…
Tomer Shay
  • 771
  • 6
  • 17
0
votes
2 answers

Can I modify the table Finder class in JsqlParser to be column finder class?

Here I found this code Table Finder which allow you to find the Tables in the select statement can we modify this code to be Attribute finder
Amr Azzam
  • 81
  • 1
  • 1
  • 10
0
votes
1 answer

How Can I get multiple Sub queries from "From Clause" using JSQLparser ?

I want to get all the Sub-queries in a from clause but When I have used FromItem fromItems = plainSelect.getFromItem(); It just retrieves the first sub query in the from clause and when I used Expression exp = plainSelect.getJoins().get(i); It…
Amr Azzam
  • 81
  • 1
  • 1
  • 10
0
votes
1 answer

JSqlParser for 'create table as ..' Query

Is there any option in JSqlParser to parse Query like create table public.sales1 as (select * from public.sales)
Muhammad Imran Tariq
  • 22,654
  • 47
  • 125
  • 190
0
votes
1 answer

JSqlParser:CCJSqlParserUtil.parse(sql) Exception;

In the sqlserver 2008: /** sql1:use Subquery AS 'PIVOT' ResultSet */ SELECT * FROM ( SELECT a.Station_ID stationId, b.Factor_Code factoryCode, a.Value value FROM T_Data_Real a LEFT JOIN T_Bas_Factor b ON a.Factor_ID = b.Id )f PIVOT…
user7393258
  • 31
  • 1
  • 6
0
votes
1 answer

How to do unit testing of Visitors in Jsqlparser?

I have implemented the Visitors of JSqlparser to parse SQL queries. The code is working absolutely fine. I am not sure how to do unit testing for those visitors. For example I have the following sql statement: Select a.a1, a.a2 from foo as a To…
MSS
  • 3,306
  • 1
  • 19
  • 50
0
votes
1 answer

JSQLParser and Oracles LNNVL (akin to IIF)

I'd like to extend the JSQLParser so that it accepts the IIF command of oracle. The following stmt produces an exception because the function uses a expression: SELECT LNNVL(A > 10, 1, 0) FROM TBL_NAME; Do you mind giving me hints how to change the…
Markus
  • 763
  • 7
  • 24
0
votes
4 answers

how can I make this JAVACC grammar work with [ ]?

I'm trying to change a grammar in the JSqlParser project, which deals with a javacc grammar file .jj specifying the standard SQL syntax. I had difficulty getting one section to work, I narrowed it down to the following , much simplified…
teddy teddy
  • 3,025
  • 6
  • 31
  • 48
0
votes
1 answer

please help for CCJSqlParser issue

I use below code to get selected columns. But in the column item, why the table.getName() is alias name t1 or t2 and table.getAlias() is null? Is any sample code to get the table name(Spark_Test_1, Spark_Test_2) and the alias table name(t1,t2) in…
simafengyun
  • 423
  • 1
  • 9
  • 19
0
votes
1 answer

please help for fix CCJSqlParser exception

I use CCJSqlParser to parse sql. I fase fatal issues. my java code as below String sqlStr = "SELECT t1.Key as Key1, t2.Key as Key2 FROM tabel1 as t1, tabel2 as t2 WHERE t1.Key = t2.Key"; Statement statement =…
simafengyun
  • 423
  • 1
  • 9
  • 19
0
votes
1 answer

Picking up multiple from items using JSQLParser

I am writing a SQL query evaluator and I am using JSQLParser for parsing the query. Now it seems (and also suggested by this link http://sourceforge.net/p/jsqlparser/feature-requests/2/ ) that JSQLParser does not allow multiple items in the FROM…
ping localhost
  • 479
  • 3
  • 22
1 2 3
4