Formatting Data as INSERT Statements


Formatting Data as INSERT Statements

TOAD allows you to export data from the Schema Browser into INSERT statements. Right-clicking on the table in the Tables tab of the Schema Browser brings up the list of menu items illustrated in Figure 8.4. Select Export Data and you get the Data Export window shown in Figure 8.5. The Columns tab of the Data Export window allows you to select the columns you want.

Figure 8.4. Exporting data in the Schema Browser.

Figure 8.5. The Columns tab of the Data Export window.

Creating a script with INSERT statements is very useful in moving data between instances of Oracle and even in moving data to other relational databases.


The Options tab of the Data Export window (see Figure 8.6) allows you to create a file or copy to the clipboard, and add some additional information such as schema owner to the text, add WHERE and ORDER BY clauses, and so on.

Figure 8.6. The Options tab of the Data Export window.

Figure 8.7 shows the output that results from this option. Notice that this option creates a script of INSERT statements.

Figure 8.7. INSERT-formatted data in Notepad.

If you are dealing with a large number of rows, particularly if the rows contain a large amount of data, you might want to do a COMMIT a little bit more frequently than 1000 rows. This really aids Oracle in handling larger transactions and the REDO logs.




TOAD Handbook
TOAD Handbook (2nd Edition)
ISBN: 0321649109
EAN: 2147483647
Year: 2003
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net