Friday, September 5, 2008

How to use TOAD for to write oracle PL SQL?




1. Multiple SELECT statement can not be executed in TOAD



2. Simplest PL/SQL code in TOAD

DECLARE iDocID NUMBER(6);
BEGIN
SELECT COUNT(*) INTO iDocID FROM TBL_TW_DOCS;
DBMS_OUTPUT.PUT_LINE(iDocID);
END;
3. If a statement is returing more than one value(i.e rowset), then we can not execute using BEGIN and END.

Therefore,following code does not execute in TOAD and thows error:





4. Simplest correct code:





5. Opening an Oracle Stored Procedure ( compiled object ) in TOAD



a) Click on new procedure window.


b) New procedure window appears as follows




c) Click on Proc tab. Procedure TAB appears as follows.






d) Click on filter button and following screen appears where user is allowed to filder by package name or SP name
















































No comments: