11

Oracle SQL Developer allows you to update field values directly to the table without needing to write a sql script. However it doesnt allow you to set a null value for a field? the update script that gets generated is below : UPDATE "TABLE" SET field_required = 'null' WHERE ROWID = 'AAAnnZAAFAAAGMfAAC' AND ORA_ROWSCN = '14465324'

Any idea how to set a null value to a field in the table without writing an update statement ?

6 Answers 6

13

Using SQL Developer 3.0 here. What works for me is to first highlight the cell that I want to set to null. Hit backspace twice and move out of the cell (or do whatever you need to do to get out of edit mode). The first backspace puts the cell into edit mode and clears out the existing value. The second backspace is where the "null" value gets set (this is not visually apparent). Commit your changes and the null values will now show up in the refreshed data.

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

1 Comment

I can also confirm that with SQL Developer 4.0, setting a null value is as simple as deleting the contents of the cell. As far as I know, versions as old as 9.0R2 is compatible with it and it can be downloaded here: oracle.com/technetwork/developer-tools/sql-developer/downloads/…
7

What version are you using? I've got 1.5.4 right now and it works perfectly. Just click the value and hit delete, then commit.

1 Comment

Presently,I use 1.5.4 and today morning installed the latest updates. Now it works. My Version is 1.5.4 Build MAIN-5940 Thanks
3

Do you mean editing in the data tab? Just insert an 'empty' string, which in oracle is equal to null.

Set "Display null value as" to (null) in tools -> preferences -> Database -> advanced settings

create table ff (v VARCHAR2(1));

INSERT INTO FF VALUES ('1');

Select table and select data tab.

This shows

V
=
1

Now double click the value 1 and delete the 1. Commit generates this statement in log:

UPDATE "OSIVOLG"."FF" SET V =  WHERE ROWID = 'AAA+zcAAFAAF9rgAAA' AND ORA_ROWSCN = '77536476584'

Which is syntacticly not a valid SQL statement but data tab now shows.

V
======
(null)

3 Comments

Still not working. I tried deleting a value from help tables which are pre-installed when a new db is created. Below is the logs UPDATE "SYSTEM"."HELP" SET INFO = WHERE ROWID = 'AAACfmAABAAAG66AAL' AND ORA_ROWSCN = '169734' One error saving changes to table "SYSTEM"."HELP": Row 12: Invalid column index: getValidColumnIndex
Either you don't have privileges to update that table or your db is hosed. Try updating a table in a regular user schema. I just updated that table in my DB with no problem, but it's a user that does have DBA privileges.
This seems to be some kind of a bug : forums.oracle.com/forums/…
0

Some tools use <ctrl+0> to enter a NULL value.

Comments

0

there is a setting in tools -> preferences -> Database -> advanced settings that allows you to reset the default display of NULL columns. If you set it to blank that will probably solve your issue.

1 Comment

Nope. This just toggles the display to blank. It doesnt solve. Below are the scripts that run when i do the intended null update UPDATE "DEPARTMENT" SET NAME = 'cgh' WHERE ROWID = 'AAAoA8AAFAAAHk2AAA' AND ORA_ROWSCN = '14471109' Commit Successful UPDATE "DEPARTMENT" SET NAME = WHERE ROWID = 'AAAoA8AAFAAAHk2AAA' AND ORA_ROWSCN = '14471114' One error saving changes to table "DEPARTMENT": Row 1: Invalid column index: getValidColumnIndex. I see the above error when I deleted all the letters in the field and tried to commit the data
0

Select the relevant columns with the mouse (pressing CTRL to keep the selection as you go), then pressing SHIFT + DEL. This worked for me

Comments

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.