Search code examples
oracleoracle-sqldeveloper

Tables not showing up after adding them in command line (Oracle SQL)


I added a test table using cmd sql

CREATE TABLE TESTJDBC (NAME varchar(8), NUM NUMBER);
INSERT INTO TESTJDBC VALUES ('ALIS', 67);
INSERT INTO TESTJDBC VALUES ('BOB', 345);
COMMIT;

The response was that it was successfully added, table created, row added, etc. But when I do

select NAME, NUM from TESTJDBC

or

select * from TESTJDBC

I just get a blank line with an indented "2"

SQL> select NAME, NUM from TESTJDBC
    2

I connected to my database on sql developer, and on there I can't even find the table. I know the table itself is definitely there, because when I try to create a new table with the same name I can't. What's the issue?


Solution

  • You should terminate the statement with semi-colon:

    select name, num from testjdbc;
    

    or forward slash:

    select name, num from testjdbc
    /
    

    Because, "indented 2" just means that you're now in line #2 and should enter some more code (if you want).