SQL proc diagram generating software of a program flow [closed] - sql

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I have a couple of very long procs in Oracle 2000+ lines with lots of calls. And I'd like to generate program flow Diagram (algorithm) for better understanding of the process for further refactoring.
It's not the code I wrote so I don't know the logic enough.
What would you advise to do in this case? I tried to draw a text-like flow but it takes lots of time and still hard to cover all the logic for understanding.
The best approach I see would be flow chart generated from SQL proc with links to "jump" between code and chart.
UPDATE:
Found couple of software doing the same:
ClearSQL - makes CRUD diagrams, call map, and flow chart.
Quest SQL Navigator Expert (using it now): it has Outline (makes code flow with ability to collapse-expand blocks of code - really cool one!), Code Explorer (enumerates all func, params with links ti SQL text - just in interface) features

There is a product, Code Visual to Flowchart, which can take code in various languages and do something like what you're describing. Unfortunately though Oracle doesn't appear to be in the list of supported languages, but Microsoft TSQL is; maybe you could at least translate your proc from Oracle into MS and use this to roughly visualize your proc's flow.
Failing that burnall's suggestion sounds like the best way to go, essentially divide and conquer.

I doubt that such tool, even if it exists could help better understanding. I think, time of big flow-charts is over.
I would advice to understand logic with step-by-step refactoring:
iteratively extract parts of procedure to smaller procedures and add tests.

Related

Are there any tools to visualize a complicated SQL join? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Given that many frameworks will create complicated (and maybe not so readable/logical) SQL queries, it would seem that having a tool to show, visually, how the joins were done might be a helpful tool. But I have not found such a tool.
I took a query that included a lot of tables and created a graphic as an example of what I think would be the output from such a tool:
The text on the links are the field names that are used in the join. The bold items are inputs to the query. The table names ending in digits are just repeat instances of the same table (ie Partner and Partner2 are the same table, just part of the query more than once).
I would like to be able to drop an SQL query into a tool and see a diagram like this. Possible?
I found this tool, it might be useful.
http://queryviz.com/online/
Although the SQL syntax supported looks to be quite limited..
You can get this sort of output using SQL Analyzer with SQL Server. Something similar exists for postgresql: I've never seen anything graphical for MySql or Oracle.
In other words: nothing generic (which is perhaps what one would expect given the complex and individual nature of database optimizer engines).

Ready web query interface to SQL databases [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Do you know any free tool which would constitute a web-based SQL database generic query interface, incl.:
(mainly) allowing to type in an SQL query and display the result in some nice way
the interface should allow for some basic security - allowing only SELECT queries
the very need is to support MS SQL Server, but Oracle support would be useful
should run against an existing database instance without any re-configuration needed
might be simple, no need to browse tables, analyze database columns or anything else you would experience in SQLDeveloper or SQL Server Management Studio
Platform / language / etc. is of second importance.
The StackExchange Data Explorer has this functionality (example) and it is open source, so you may be able to just install and make use of it, or even extract the relevant code.
Perhaps something like the SQL Fiddle?
Obviously, this is mainly for demonstration purposes - it won't help you if you want to install it on top of your own database.
Re:dash (Redash) is a promising new open-source player on the market. From their own website:
re:dash is our take on freeing the data within our company in a way
that will better fit our culture and usage patterns.
Prior to re:dash, we tried to use traditional BI suites and discovered
a set of bloated, technically challenged and slow tools/flows. What we
were looking for was a more hacker'ish way to look at data, so we
built one.

Source code analyzing tool for COBOL on VMS/VAX Platform [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Can someone please recommend a tool for analyzing, improving, finding "dead code", provide statistics etc. for a source code on COBOL language on VMS/VAX OS and RDB Database?
Thanks.
Some compilers have options for locating dead code, so you may already have the tools you desire. Please keep in mind that there are going to be situations where the code is dead and you cannot tell via static source code analysis.
if a = 1
move 'error' to out-message
end-if
If a can never be 1 then this is dead code. Static source code analysis may not find more complicated instances of this scenario, particularly if the value of a comes from outside the program being analyzed - perhaps a database.
A cursory scan of the static source code analysis tools listed on Wikipedia shows the commercial products are pricy (thousands of euros). The open source tools don't appear to provide much COBOL coverage. You might want to check those out for yourself as I admit I didn't do a thorough evaluation but instead just scanned their documentation.
COBOL is a difficult language to parse.
I have never used it, but the DecSet suite of products includes a product called PCA - Performance and Coverage Analyser. This may be what you are looking for.

Introduction to SQL triggers? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am a student, with decent knowledge of SQL, but have had very little to do with triggers in the past. I've looked at a few sites for guidance, but comprehensive explanation on all commonly used statements seems fairly sparse.
Is there a 'definitive' site for this kind of thing? Perhaps like a w3chools for advanced SQL?
Once you know a little SQL, try to check out Joe Celko's books. Advanced SQL Programming has a short section on triggers. Since you're a student, you can probably get a copy at the library. If you think you're going to be doing deeper SQL dev work, you'll be glad to score your own personal copy of the book. You can get the relational DB engine to do a significant amount of work in a small amount of code - thinking that way will make you a much more efficient programmer. Most book stores (my local Borders always has a couple copies) will have a copy on the shelf, so browse before you buy.
Also, check out the online manuals for the database you're using as itsmatt suggests.
I've always thought that the SQL Server Books Online (installed with SQL Server) were a good source of info.
This sounds a bit like an "old shoe or glass bottle" question.
Triggers are one of those things that you should really stay away from unless you really really know what you're doing and have a very good reason for doing what you're doing. So naturally, one of the prerequisites to ever using a trigger is that you should have a thorough understanding of how they work and their implications. Thus, you can see how the idea of an "Intro to Triggers" text may sound like a very dangerous thing to some people.
So my advice, cruel as it may sound, is this: If you're the sort of person who needs an intro text on this particular topic, then you might be better served in the long run by simply avoiding Triggers for the time being.

What program can I use to generate diagrams of SQL view/table structure? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I've been tasked with redesigning part of a ms-sql database structure which currently involves a lot of views, some of which contain joins to other views.
Anyway, I wonder if anyone here could recommend a utility to automatically generate diagrams to help me visualise the whole structure.
What's the best program you've used for such problems?
I am a big fan of Embarcadero's ER/Studio. It is very powerful and produces excellent on-screen as well as printed results. They have a free trial as well, so you should be able to get in and give it a shot without too much strife.
Good luck!
Toad Data Modeller from Quest does a nice job on this and is reasonably priced. Embarcadero E/R studio is good too, as Bruce mentioned.
OP asked about diagramming views and view dependencies, SQL Management Studio and Enterprise Manager doesn't allow you to diagram views. I can't vouch for the other tools.
The LINQ to SQL designer for Visual Studio does allow you to drop views on the design surface but there isn't a easy way to model the dependencies between the views. I'm not sure which tool has this type of diagramming functionality. You could take a look at Red Gate's SQLDoc tool but it just provides text based output.
If you are talking about MS SQL Server tables, I like the diagram support in SQL Server Management Studio. You just drag the tables from the explorer onto the canvas, and they are laid out for you along with lines for relationships. You'll have to do some adjusting by hand for the best looking diagrams, but it is a decent way to get diagrams.
I upmodded Mark's post about Toad Data Modeler and wanted to point out that they have a beta version that is fully functional and free. The only downsides are the occasional bug and built in expiration (typically around the time a new beta is available), but for this poor bloke it does wonders until I can get my boss to chip in for a license.