Jordan Parmer
Jordan Parmer

Reputation: 37254

How do I query for the state of a session variable in PL/SQL?

I see that in PL/SQL it is possible to set the session state of a particular variable for the remainder of the session's lifetime. For instance:

ALTER SESSION SET CURRENT_SCHEMA=<schema>

How do I query for the current state of this schema so I can revert back to it after performing some other statements?

Upvotes: 1

Views: 2020

Answers (1)

Justin Cave
Justin Cave

Reputation: 231871

SELECT SYS_CONTEXT( 'USERENV', 'CURRENT_SCHEMA' ) FROM dual;

Upvotes: 2

Related Questions