0% found this document useful (0 votes)
5 views2 pages

Read Me

The document provides instructions for executing stored procedures in SQL Query Analyzer, emphasizing the requirement for at least one output parameter. It also explains how to execute multiple result-set queries and join results from different sources. Additionally, it lists shortcut keys for enhancing productivity within the application.

Uploaded by

Diego
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Read Me

The document provides instructions for executing stored procedures in SQL Query Analyzer, emphasizing the requirement for at least one output parameter. It also explains how to execute multiple result-set queries and join results from different sources. Additionally, it lists shortcut keys for enhancing productivity within the application.

Uploaded by

Diego
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 2

SQL Query Analyzer 2.1.

EXECUTING A STORED PROCEDURE

To execute a stored procedure use following syntax

- exec <<procedure name>> (<<param1>>,<<param2>>,……)

Your stored procedure should adhere to following rule


1. It should have at least one output parameter. The result of stored procedure should be written
to that output parameter.
Example:
Create or replace PROCEDURE "USP_GETCUSTOMERPARAMETERS"
(
v_CustomerNumber IN VARCHAR2 DEFAULT 'All',
cv_1 IN OUT SYS_REFCURSOR
)
AS
OPEN cv_1 FOR
SELECT *
FROM CustomerParameters
WHERE CustomerNumber = v_CustomerNumber;

To execute this procedure run following command in Oracle worksheet


exec usp_getCustomerParameters(‘10001’)

EXECUTING MULTIPLE RESULT-SET QUERIES

To execute multiple result-set queries, separate the queries with semicolon (;) character.
To execute result-sets from two separate tables, run following command
Select * from Customer;
Select * from CustomerParameters

You can also join result-set from select statements and stored procedure.
Select * from Customer;
Select * from CustomerParameters;
exec usp_getCustomerParameters(‘10001’);

Output will be displayed simultaneously in same output panel in separate grids.


SHORTCUT KEYS
 Ctrl + F : To toggle find & replace windows
 Shift + Ctrl + R : To toggle result panel
 Tab : To add right indent to selected text or current line
 Shift + Tab : To add left indent to selected text or current line
 Space : Format the last word with syntax color

You might also like