Questions relating to code, libraries, or applications that parse SQL-style query languages.
Questions tagged [sql-parser]
129 questions
0
votes
0 answers
I have a question about extracting table names from Postgresql
I want to ask about extracting table names from Postgresql queries using Python 3.X.
Here is my conditions.
1.Python 3.X
packages
sqlparse
2.Postgresql
This is my sql code.
$postgresql
With
a as (
select x,y
from g
)
select x, y,z
from …

user10722486
- 9
- 2
0
votes
2 answers
How to convert array values to MySQL query using PHP SQL Parser?
I'm using PHP SQL PARSER
my Code

Siddhu
- 241
- 2
- 3
- 16
0
votes
0 answers
Is there a parser for Firebird SQL
Using Firebird and the .Net Firebird provider. Looking for something like:
using (var cmd = new FbCommand()) {
var parser = new FbParser(someSqlText);
// Add a filter to the where clause. May need code for adding a "where" if there is none…

Paul
- 5,700
- 5
- 43
- 67
0
votes
2 answers
How to extract all table names and aliases from Tsql select statements in .net
All of my tenanted tables in sql server have a field customer_id. I'm attempting to write an interceptor for NPoco that will extract all table and alias names from the query. match it to an exception list of tables that are not tenanted, and…

Matthew Vines
- 27,253
- 7
- 76
- 97
0
votes
1 answer
Parsing T-SQL To Extract Part of WHERE Clause
I have a large SQL database containing 'curves'. Each curve has an ID (curveid). I'm trying to determine main users of each curve and if it is used at all. To enable this, the DBAs are providing logs of all statements executed against the…

GinjaNinja
- 776
- 6
- 18
0
votes
1 answer
Parsing SQL to determine complexity level
I have to determine the complexity level (simple/medium/complex etc) of a sql by counting number of occurrences of specific keywords, sub-queries, derived tables, functions etc that constitute the sql. Additionally, I have to syntactically validate…

Raj Aryan
- 59
- 3
- 12
0
votes
1 answer
PostgreSQL Transformation Process Code
I need to parse SQL query and form the relational algebra tree. Currently I used the postgres internal parser to parse the query. (More specificly I've the result of step 1 in the link…
0
votes
0 answers
Slow java class loading on Windows Server 2008 R2
For SQL parsing we use General SQL Parser (GSP) in our Java web application. If we deploy our application with GSP on Windows Server 2008 R2 with Java 7 we see a 100% CPU peak during class loading which could last up to some minutes. After initial…

mystygage
- 371
- 1
- 3
- 6
0
votes
0 answers
Parse FOR loop using ANTLR based PLSQL parser
I have modified the PLSQL parser given by [Porcelli] (https://github.com/porcelli/plsql-parser ). I am using this parser to parse PlSql files. I am facing issue with parsing FOR loop statements, e.g.
for i in…

Mohit Chawda
- 53
- 1
- 1
- 8
0
votes
2 answers
Split string by ;
I've checked quite a lot, but I can't get a hang of it.
I need to split a sql dump into queries.
what I need s basically to take a string like this:
DROP TABLE IF EXISTS `GDN_Activity`;
CREATE TABLE `GDN_Activity` (
`ActivityID` int(11) NOT NULL…

Indra
- 692
- 6
- 18
0
votes
1 answer
Get the tablename and columns selected using a SELECT query
I have a requirement where in I have queries in the form:
select tab1.col1 as column1, tab2.col1 as column1
from table1 tab1 inner join table2 tab2 on tab1.key1=tab2.key2
I would like to get the three things from…

user3357241
- 31
- 3
0
votes
1 answer
how to parse android sqlite query to java
I have a lot of android sqlite queries fed as input. I have to parse those to java, search from vectors and return the result. How can I handle this ???
Are there any plugins like JSqlParser, SQL parser, JoSQL for android sqlite ?

user3022690
- 71
- 6
0
votes
2 answers
How to encode the evaluation order for a SQL query using Java?
I am trying to develop a SQL query evaluator using JSQLParser, and I am really confused as to how do I decide on the evaluation order, like if I have a query of the following form
Select *
From A,B,C
Where A.id=B.id
And B.id=C.id
And…

AnkitSablok
- 3,021
- 7
- 35
- 52
0
votes
2 answers
Anybody knows if exists an open-source SQL parser?
I'm searching an open source SQL parser written in Java. I founded only this commercial software that satisfy my requires: http://www.sqlparser.com/sql-parser-java.php

Giacomo
- 1
- 1
- 1
0
votes
2 answers
Getting table name from query through c# .net
I have been tasked with writing a function which will be passed a sql query as a string, it should parse this query prepending "tablename" to any tables it finds. I have been given some code as an example (its simply looking for instances of "from"…

GowthamanSS
- 1,434
- 4
- 33
- 58