PRB: Error Creating Stored Procedure

ID: Q42624


The information in this article applies to:


SYMPTOMS

When using the following procedure as a stored procedure


   Create procedure workshop as
   use pubs
   select * from authors 

after pressing CTRL+E in SAF, the error message "USE statement cannot be used in a stored procedure." Deleting the USE PUBS command returns the error message "Unknown object authors."


WORKAROUND

When using stored procedures, you must be in the database that you want the procedure to be executed in. This is also where the procedure should be created. You must first enter USE PUBS, then create the procedure. Now you can execute the procedure as long as you are in the "pubs" database.


Keywords          : kbprg SSrvStProc 
Version           : 4.2
Platform          : OS/2 
Issue type        : 

Last Reviewed: March 6, 1999