0

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?

Insanit
  • 37
  • 1
  • 8

1 Answers1

0

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).

Littlefoot
  • 131,892
  • 15
  • 35
  • 57
  • See [this answer](https://stackoverflow.com/a/21145229/1509264) for what using a semi-colon or a slash means. – MT0 Nov 25 '21 at 21:05