Development Software
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb Site ManagementDevelopment Software

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old November 1st, 2003, 07:28 PM
ChibiGuy's Avatar
ChibiGuy ChibiGuy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: USA
Posts: 470 ChibiGuy User rank is Lance Corporal (50 - 100 Reputation Level)ChibiGuy User rank is Lance Corporal (50 - 100 Reputation Level)ChibiGuy User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 8 h 30 m 50 sec
Reputation Power: 6
Send a message via AIM to ChibiGuy
need an sql parser

Honest to god, I searched the internet for a good hour and half and found nothing.

Does anyone know of an sql parser that can validate an sql statement? It doesn't have to be in php.

I remember seeing one here before and can't find it now.

Reply With Quote
  #2  
Old November 1st, 2003, 08:03 PM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,224 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 34 m 57 sec
Reputation Power: 174
Moved to Development Software.

Chibiguy, please keep your posts on-topic, thanks.
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever.
Analyze twice; hack once.
The world's first existential ITIL question: If a change is released into production without a ticket to track it,
was it actually released?


About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect -
Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire


Reply With Quote
  #3  
Old November 2nd, 2003, 09:00 AM
ChibiGuy's Avatar
ChibiGuy ChibiGuy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: USA
Posts: 470 ChibiGuy User rank is Lance Corporal (50 - 100 Reputation Level)ChibiGuy User rank is Lance Corporal (50 - 100 Reputation Level)ChibiGuy User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 8 h 30 m 50 sec
Reputation Power: 6
Send a message via AIM to ChibiGuy
my fault.

Reply With Quote
  #5  
Old May 6th, 2004, 07:52 AM
bergner bergner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 144 bergner User rank is Private First Class (20 - 50 Reputation Level)bergner User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 h 48 m 6 sec
Reputation Power: 5
If you want to write your own parser

The O'Reilly Lex & Yacc book contains the implementation of an SQL parser, but that is probably not what you want, just thought I would mention it.

Reply With Quote
  #6  
Old May 6th, 2004, 11:09 PM
dejaone dejaone is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 300 dejaone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 7 m 22 sec
Reputation Power: 5
SQL parser is server specific. the one works with Oracle may not work with MS SQLServer, Sybase, or MySQL

Reply With Quote
  #7  
Old May 7th, 2004, 05:02 AM
pabloj's Avatar
pabloj pabloj is online now
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,707 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 2 h 56 m 40 sec
Reputation Power: 259
You can try a workaround, send an EPLAIN query to the database and watch the response.
On Oracle there is a php function ociparse which is said to
Quote:
It returns the statement identity if the query is valid, FALSE if not

Hope this helps!

Reply With Quote
  #8  
Old July 9th, 2006, 07:30 PM
ChibiGuy's Avatar
ChibiGuy ChibiGuy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: USA
Posts: 470 ChibiGuy User rank is Lance Corporal (50 - 100 Reputation Level)ChibiGuy User rank is Lance Corporal (50 - 100 Reputation Level)ChibiGuy User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 8 h 30 m 50 sec
Reputation Power: 6
Send a message via AIM to ChibiGuy
I thought that I'd mention that I did finally create a parser ...

http://txtsql.dotgeek.org and click "development" link at the top... it's in two files - txtSQL.tokenizer.php and txtSQL.lexer.php

Tell me what you guys think...
Comments on this post
pabloj agrees: Thanks for your feedback

Reply With Quote
  #9  
Old March 3rd, 2008, 08:38 AM
mrtwice99 mrtwice99 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 49 mrtwice99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 6 m 29 sec
Reputation Power: 5
Dead link

ChibiGuy, do you still have that parser available? The link above is dead.

Thanks!

Reply With Quote
  #10  
Old March 8th, 2008, 01:39 AM
HardlyNoticable HardlyNoticable is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 3 HardlyNoticable User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 38 sec
Reputation Power: 0
Repost Link?

Quote:
Originally Posted by ChibiGuy
<URL> and click "development" link at the top... it's in two files - txtSQL.tokenizer.php and txtSQL.lexer.php


The link is dead. Do you know if there's another link?

Reply With Quote
  #11  
Old April 10th, 2008, 11:55 AM
fishtoprecords's Avatar
fishtoprecords fishtoprecords is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2007
Location: outside Washington DC
Posts: 957 fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)fishtoprecords User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 21 h 6 m 9 sec
Reputation Power: 418
Just curious, do you really want a generic SQL parser?
They are mostly useless. Nobody writes SQL. Or perhaps very, very few people write SQL. They write in sql for some implementation such as MySql, SQL Server, Oracle, etc.

While it is technically possible to use pure SQL, each package adds some cool stuff that makes your life easier, and so most humans fall into the trap of using the extensions.

Reply With Quote
  #12  
Old April 10th, 2008, 12:03 PM
mrtwice99 mrtwice99 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 49 mrtwice99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 6 m 29 sec
Reputation Power: 5
Quote:
Originally Posted by fishtoprecords
Just curious, do you really want a generic SQL parser?
They are mostly useless. Nobody writes SQL. Or perhaps very, very few people write SQL. They write in sql for some implementation such as MySql, SQL Server, Oracle, etc.

While it is technically possible to use pure SQL, each package adds some cool stuff that makes your life easier, and so most humans fall into the trap of using the extensions.


Yes, I do. While its true that people use different features, most SQL is in fact portable. Take just about any SELECT, UPDATE, or INSERT statement. They are going to work most of the time on any platform as long as the correct objects are in the database.

Reply With Quote
  #13  
Old April 10th, 2008, 12:46 PM
pabloj's Avatar
pabloj pabloj is online now
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,707 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 2 h 56 m 40 sec
Reputation Power: 259
Quote:
Originally Posted by HardlyNoticable
The link is dead. Do you know if there's another link?
Here it is

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementDevelopment Software > need an sql parser


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump