Help to Parse complex SQL queries
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello Community.
I am currently building a workflow, that "scans" other .yxmd workflows for inputs and outputs.
For many inputs its somewhat straightforward to parse out what fields are being input from the source.
But when it comes to database inputs where complex SQL queries are used it becomes very difficult.
Do you know of any resources or tools to parse SQL queries into which columns are being input from which tables?
Currently i can parse simple "select table.x from schema.xxxxx" by using regex.
When the SQL query consists of several nested layers of select statements it becomes a whole different scenario.
Ideally i am hoping that there is some python code or macro that i can read the sql code into, which then outputs tables and columns.
All help will be greatly appreciated!
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Not sure if this is what you're looking for, but I have a series of parsing tools that take a query with subqueries and display it in a more readable format like this:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @GloriousWater
Thanks for posting to the Community!
I did some digging, and have found some other posts that tackle the same general idea you have.
I haven't been able to find an existing workflow that's been shared to do this, but this post covers the rough steps you would need to complete.
This second article also contains some additional conversations that may be useful for you as you work through this process!
Additionally, are you able to provide a sample of what your SQL looks like? This will give the Community a better idea of what you are trying to parse.
I hope these help to get you moving in the right direction!
Thanks,
TrevorS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
First of all sorry for the slow response. I was occupied by higher priorities, however i will return to this once opportunity presents. I will update once so. In the meantime thank you very much for your inputs!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
Could you share those tools? I am interested in parsing some existing sqls so that I can update the naming convention as we will be upgrading databases here shortly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
would you be able to share the parsing tools you reference? this is exactly what i am looking for. Thank you in advance!
