Jump to content
Sign in to follow this  

SQL Statment Reader Made easy

Recommended Posts

Hi Guys / Girls

Heres a random Idea I have had, I have started working with SQL and MYSQL recently and today got a statment a user made that was HUGE.

So had a search for a application or something I could past the statment into and just easily see what the databases it was selecting were, etc... without having to read through it... trust me it was a LOOOOOOOOOONG statment.

Had a look around here but didnt see anything like that,

So im going to try make a little app that will read the pasted SQL statment. give 3 listings 1, a basic overview of what is selected. 2 from what tables, 3 what restrictions / limitations are also placed.

so select options from tables where restrictions =-like 'bob' O_o lol not right I know but you get the Idea.

Before I start wanted to know if anyone else thinks this is a good idea, or if you know of something that will do it, pass me the name etc...

also if you like the idea, what else you want to see in it?

remember basic interpritation application nothing major. not yet anyway lol :idea:

Saru Mo Ki Kara Ochiru[u]Direct Translation[/u]: Even monkeys will fall from trees.[u]I.E.:[/u] To Error is HumanMy Splash Screen applet: Splash Screen Coding

Share this post

Link to post
Share on other sites

First have your SQL correctly formatted. There are too many solutions to name them all. An easy one is there. Correct formatting gives a much better view of a long SQL statement.

What do you call "LONG" btw?

Your project is a bit ambitious (or not ambitious enough) because the devil is in the detail (as usual). You probably don't need anything to see which column will be selected (then again, details can make a huge difference). From which tables should be clear as well, at the outer level. Inner subqueries can reveal extremely difficult to "explain". Then the restrictions can be very messy.

All in all, I believe that "basic interpretation" won't buy you anything useful, while "exhaustive interpretation in full detail" won't be any clearer than the SQL itself! Anything in between is likely to bite you when applied to real-world queries (stored procedures, custom functions).

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...