CURRENT_SCHEMA
CURRENT_SCHEMA()
Section titled “CURRENT_SCHEMA()”Example
Section titled “Example”CREATE SCHEMA tech;SET search_path TO tech;SELECT CURRENT_SCHEMA;Output
Section titled “Output” current_schema------------------ tech(1 row)Explanation
Section titled “Explanation”In the example, a new schema named ‘tech’ is created. After that, the search path is set to ‘tech’, effectively making it the current schema. The CURRENT_SCHEMA function is then used to return the name of the current schema, which is ‘tech’.
CURRENT_SCHEMA
Section titled “CURRENT_SCHEMA”Example
Section titled “Example”SELECT CURRENT_SCHEMA FROM dual;Output
Section titled “Output”'HR'Explanation
Section titled “Explanation”The above SQL code retrieves the current schema in an Oracle database. The output ‘HR’ indicates that the current schema in use is ‘HR’.
current_schema()
Section titled “current_schema()”Example
Section titled “Example”SELECT current_schema();