title: Reference different schema using "alter session set current_schema" inside a package
body: <p>Is it possible to do </p>
  
  <pre><code>alter session set current_schema=MySchema;
  </code></pre>
  
  <p>inside a package?</p>
  
  <p>Our asp.net web application call Oracle packages. We'd like to connect to database with an Oracle user that is not the owner of MySchema. For that, we grant execute permissions on Other_User to package MyPackage.  </p>
  
  <p>Example:</p>
  
  <pre><code>grant execute on MySchema.MyPackage to Other_User
  </code></pre>
  
  <p>But when web app connects to Oracle and try to execute the stored procedures of MyPackage, it gets errors because tables don't belong to Other_User.</p>
  
  <p>One way to avoid errors is creating synonyms, but we would prefere to use </p>
  
  <pre><code>alter session set current_schema=MySchema;
  </code></pre>
  
  <p>if possible, inside the package.</p>
  
  <p>EDIT: When trying to put "alter session" in package:
  <img src="https://i.stack.imgur.com/Xci50.jpg" alt="enter image description here"></p>