Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

SQL Table References

Received Response
1
Views
1
Comments
f55372a8-e53e-4312-b12b-a3fbdea96611
f55372a8-e53e-4312-b12b-a3fbdea96611 Rank 1 - Community Starter

When creating a stored procedure within SQL, would I have to explicitly state which tables would be used if that procedure is shared?

Here is an example:

I wrote a procedure that would allow for easy modifying of data. The procedure is meant to truncate all of the relevant tables to my task, then adds the original data back in, always providing me a clean copy of the tables. - Yes I know this is not realistic in production.

Here is a snippet:

BEGIN

/* trauncate info in all existing tables */

       execute immediate 'truncate table Customers';

/*insert data into table */

      insert into customers values(2111,'JCP Inc.',103,50000);

END;

Would I have to pass in as a parameter the username of the tables that are accessed if every user has teh same tables as me? - making the new truncate command:

execute immediate 'truncate table userName.Customers';

Answers

  • Hi,

    Welcome to the forum ....

    Where does OBIEE fit into your question? You are actually posting in the space but it smells like a "generic" SQL question ... There are many other spaces for DB / SQL questions in case.