Free software to reverse engineer existing complex database diagrams in SQL Server 2008+ Ask Question Asked 5 years, 10 months ago. Active 6 months ago. Viewed 25k times 34. Up until a few years ago I used Microsoft Visio to reverse engineer an existing database to a diagram. This feature has been deprecated for a while now, and I'm rather stuck in finding an alternative.
- PL/SQL Tutorial
- PL/SQL Useful Resources
- Selected Reading
A FOR LOOP is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times.
Syntax
Following is the flow of control in a For Loop −
- The initial step is executed first, and only once. This step allows you to declare and initialize any loop control variables.
- Next, the condition, i.e., initial_value .. final_value is evaluated. If it is TRUE, the body of the loop is executed. If it is FALSE, the body of the loop does not execute and the flow of control jumps to the next statement just after the for loop.
- After the body of the for loop executes, the value of the counter variable is increased or decreased.
- The condition is now evaluated again. If it is TRUE, the loop executes and the process repeats itself (body of loop, then increment step, and then again condition). After the condition becomes FALSE, the FOR-LOOP terminates.
![Reverse Engineering Tools For Pl Sql Update Reverse Engineering Tools For Pl Sql Update](http://www.oracle.com/ocom/groups/public/@otn/documents/digitalasset/114507.gif)
Following are some special characteristics of PL/SQL for loop −
- The initial_value and final_value of the loop variable or counter can be literals, variables, or expressions but must evaluate to numbers. Otherwise, PL/SQL raises the predefined exception VALUE_ERROR.
- The initial_value need not be 1; however, the loop counter increment (or decrement) must be 1.
- PL/SQL allows the determination of the loop range dynamically at run time.
Example
When the above code is executed at the SQL prompt, it produces the following result −
Reverse FOR LOOP Statement
By default, iteration proceeds from the initial value to the final value, generally upward from the lower bound to the higher bound. You can reverse this order by using the REVERSE keyword. In such case, iteration proceeds the other way. After each iteration, the loop counter is decremented.
However, you must write the range bounds in ascending (not descending) order. The following program illustrates this −
When the above code is executed at the SQL prompt, it produces the following result −
Hello, and welcome to this presentation on Toad Data Modeler Version 5. Today, I'm going to show you how to define a new database connection and how to reverse engineer your existing database structures. Click the Connections icon on toolbar to open a form where we can manage all connections to supported database platforms. To create a new connection, click the first icon on toolbar. Define connection name. In the next step, select target database platform. In this case, it will be Oracle 10g Database. As we can see, Toad Data Modeler supports various database platforms. Then select connection method. My favorite option for Oracle Databases is TCP/IP collection. In the next step, it's necessary to select local net service name. Specify username and password. In step what to reverse, choose object types and properties you wish to reverse engineer. And in the last step, specify advanced settings and then click Finish to confirm changes. The new connection is now listed in the grid. You can test the connection, mark the connection as favorite, then filter just favorite connections, and do some other operations, like add the connection, delete the connection, and so on. Let's move to the next task and use the connection for reverse engineering. Select the connection and click button Create New Model from Database. The Reverse Engineering Wizard opens. Choose a schema. Use filter with wild cards to reduce the number of tables in the grid. Do some additional selections manually. And choose what tables you wish to reverse engineer. And you can also choose Views, Stored Procedures, and Functions. Then click Execute. And Toad Data Modeler will create a new model for you. We can see progress and a log at the bottom of the form. Reverse engineering has been finished. And we can close the form. Here, we can see a visual representation of the database structure. We can use layout features to change the appearance of the diagram. And we can continue with other tasks, like report generation, SQL code generation, and so on. Let's see the Connections form again. In my example, I forgot to reverse engineer stored procedures. Theoretically, I could do model synchronization, compared the model with existing database, find out what the difference is, choose what items I wish to update in my model, and so on. But in my scenario, I just need to add one missing start procedure to my model. In case you need to do something similar, click the Open Object Explorer button. Object Explorer pane opens. Let's close the Connections form. And now we can click the Stored Procedures tab, select the stored procedure, and use drag-and-drop technique to add the stored procedure from our database to our existing model. And now you know how to establish connection to your database and how to create new model via reverse engineering.