2

I'm using Oracle database and I've created a test table "Table1" with a varchar column "column1". I ran the following loop to add some rows:

BEGIN
 FOR i in 1..10 LOOP
 INSERT INTO TABLE1 (COLUMN1) 
 VALUES (i);
 END LOOP;
END;

If I run 'select count(*) from table1' I get '10' as my result. However, in SQL Developer, nothing shows up. I can add rows manually and commit them to the database(these appear in SQL Developer), but I can't seem to view the ones created in sqlplus command line. Why is that?

asked Dec 27, 2013 at 14:28

1 Answer 1

4

I see no COMMIT up there in your code. By default SQL*Plus autocommit is off. Data changes are not visible to other sessions until they are not commited.

answered Dec 27, 2013 at 14:36
1
  • 1
    Ah, thank you very much! I knew it had to be something simple Commented Dec 27, 2013 at 14:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.