This discussion is archived
8 Replies Latest reply: Mar 1, 2010 6:06 AM by EdStevens RSS

Create Table - SqlPlus

753539 Newbie
Currently Being Moderated
Hi

I created a user ME
>>
Create user ME
Default tablespace Users
Temporary tablespace temp;
>>
I connected to ME

If I create a table:
>>
CREATE TABLE projects (
deptno NUMBER(3,0) PRIMARY KEY,
dname VARCHAR2(15),
loc VARCHAR2(25))

TAVBLESPACE users;
>>

Should I see the table projects in the User tables in SQl Developer??
Do I need to add it??
  • 1. Re: Create Table - SqlPlus
    dba-hyd Pro
    Currently Being Moderated
    Should I see the table projects in the User tables in SQl Developer??
    Yes.
    Do I need to add it??
    No need it will automatically be created in ME schema when you connected as ME and ran the create table command, which can be now seen from sql developer tool or any other tool when you connect.
  • 2. Re: Create Table - SqlPlus
    716550 Pro
    Currently Being Moderated
    whether u connect from any tool or sqlplus if your are the owner of the objects it will be visible to you in user_objects. you need't to add it seperately

    Anil Malkai
  • 3. Re: Create Table - SqlPlus
    753539 Newbie
    Currently Being Moderated
    I ran @projects.sql
    SQl replied table created.
    When I typed "Select * from ME.projects" got no table or view.
    When I search in SQL Developer, do not see the table??

    Any suggestions??
  • 4. Re: Create Table - SqlPlus
    716550 Pro
    Currently Being Moderated
    SQL> select table_name from user_tables;

    TABLE_NAME
    ------------------------------
    CUSTOMER
    DEMO_TEST
    DEMO_TEMP
    EMP1
    FLASHBACK_VERSION_QUERY_TEST
    FLASHBACK_QUERY_TEST
    FLASHBACK_DROP_TEST
    DEPT
    EMP
    BONUS
    SALGRADE
    SYS_TEMP_FBT
    JEDB_ARCHIVE

    +13 rows selected.+

    SQL> create table test (empnname varchar2(30),empnum number);

    Table created.

    SQL> select table_name from user_tables;

    TABLE_NAME
    ------------------------------
    CUSTOMER
    DEMO_TEST
    DEMO_TEMP
    EMP1
    FLASHBACK_VERSION_QUERY_TEST
    FLASHBACK_QUERY_TEST
    FLASHBACK_DROP_TEST
    DEPT
    EMP
    BONUS
    SALGRADE
    TEST
    SYS_TEMP_FBT
    JEDB_ARCHIVE

    +14 rows selected.+


    you should be able to see ... see above example.

    Anil Malkai

    Edited by: Anil Malkai on Mar 1, 2010 2:46 AM
  • 5. Re: Create Table - SqlPlus
    753539 Newbie
    Currently Being Moderated
    I created table test in ME.

    SQL> create table test (empnname varchar2(30),empnum number);

    Then ran select table_name from user_tables;

    Got error no table or view??

    Is there a problem with the ME user???
    Used:
    CREATE USEr ME
    DEFAULT TABLESPACE USERS;
  • 6. Re: Create Table - SqlPlus
    716550 Pro
    Currently Being Moderated
    Plz provoide the steps you followed.. so that it will be easy for us to diangose.

    or follow this step

    1. connect to database as system or sys or any user which has previllege to create user.then issue following command
    create user me_1 identified by passoword;
    2. grant connect,resource to me_1;
    3. conn me_1/password
    4. create table test (empnname varchar2(30),empnum number);
    5. select table_name from user_tables;

    Anil Malkai
  • 7. Re: Create Table - SqlPlus
    753539 Newbie
    Currently Being Moderated
    Many thanks!!

    I missed out a step, forgot to log-on as SYS first!!
  • 8. Re: Create Table - SqlPlus
    EdStevens Guru
    Currently Being Moderated
    Clive_S wrote:
    I created table test in ME.

    SQL> create table test (empnname varchar2(30),empnum number);

    Then ran select table_name from user_tables;

    Got error no table or view??

    Is there a problem with the ME user???
    Used:
    CREATE USEr ME
    DEFAULT TABLESPACE USERS;
    As you have been told several times before, the quality of help you receive here will be greatly improved, and time to resolution greatly reduced, if you will quit describing what you think you did and the response you got, and show us what you actually did and the response you actually got. One more time: work at a sqlplus command prompt, copy your commands and responses, and paste that in your postings. We are not looking over your shoulder, we cannot see over your shoulder to see all of the steps you describe, to see if you mis-keyed something or you mis-intrpreted, mis-represented what you thought you did.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points