TOAD SQL Editor Useful Shortcuts

AshokTechnical TipsLeave a Comment

This will run only the SQL that your cursor is on. You do not need to highlight the line or the entire SQL statement; simply place your cursor anywhere inside the SQL statement and click SHIFT-F9.

This will verify (parse) the statement without executing it.

This will execute an explain plan on the current statement.

This will bring up your previous SQL statement. If you use SHIFT-F9 and are disciplined about keeping all iterations of executed statements in the screen…

Oracle Autoincrement

AshokTechnical TipsLeave a Comment

Unlike Oracle, other less expensive and less robust databases make autoincrementing a simple task…typically a couple of clicks in some easy to understand UI. Some examples are with SQL Server, MySQL, and Access. As we know, with Oracle’s additional “flexibility” can come additional work (but this is sometimes for a legitimate reason). Approach 1 Following are the steps on how you can mimic an autoincrement in Oracle: 1) create a table 2) create a sequence 3) create a trigger 4) insert record(s) CREATE TABLE test_table ( test_id INT PRIMARY KEY, test_col varchar2(100));   CREATE SEQUENCE test_seq;   CREATE TRIGGER test_trigger … Read More