1

I have a few lines that have worked in the past for inserting new values into an existing table.

INSERT INTO TABLE_NAME (OLD_NAME, NEW_NAME, COUNTED, ORIGIN)
VALUES ('old name', 'new name', null , null)

When executing this code it replies with

1 row inserted in 0.008 seconds

but when I check the actual table I see that the table hasn't been updated. I have tried multiple times, placing every piece of data in a line of its own. After checking I found out that the lines are indeed inserted into the table only not showing up when the whole table is queried, but showing up when counting lines.

Also, maybe important, the last two columns don't need information so they are null and the name columns are in a language written from right to left instead of being from left to right.

1
  • 3
    Consider posting the whole case - table description, INSERT statement, result of subsequent SELECT (which - as you say - proves that nothing was inserted). By the way, if you checked that in another session, you won't see anything until you commit changes you've made. Commented Apr 10, 2022 at 7:06

1 Answer 1

1

Any command that updates the table or enters new data must be committed. Did you use the comet command in Oracle after executing the insert command? You can try this command after insert query:

COMMIT WORK;

Sign up to request clarification or add additional context in comments.

2 Comments

Well, not necessarily - if you're in the same session, it doesn't matter as you'll see changes you've made. But, if you want other users (sessions) to see that, then yes - you have to commit. It is unclear what the OP did so ... you might, or might not be right.
Thanks, do you perhaps know how to deal with the 'ghost' lines that don't show

Your Answer

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.