Oracle Database - Create Table
by
Jeremy Canfield |
Updated: October 19 2023
| Oracle Database articles
This assumes you have an Oracle database up and running. If not, check out my article Install Oracle Express Database on Docker.
The select sys_context('USERENV', 'CURRENT_SCHEMA') from dual statement can be used to list the schema being used by the user you are logged in as.
SQL> select sys_context('USERENV', 'CURRENT_SCHEMA') from dual;
SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
--------------------------------------------------------------------------------
SYS
And here is an example of how to create a table in your users schema.
SQL> CREATE TABLE SYS.persons(person_id NUMBER GENERATED BY DEFAULT AS IDENTITY, first_name VARCHAR2(50) NOT NULL, last_name VARCHAR2(50) NOT NULL, PRIMARY KEY(person_id));
Table created.
Did you find this article helpful?
If so, consider buying me a coffee over at