質問

Question: I have table with three column, with column names APP_NAME, APP_TYPE and VALUE_TIME.

enter image description here

I would like to edit VALUE_TIME for particular APP_NAME and APP_TYPE. So my query should look like below mentioned if VALUE_TIME column is Nullable. So what would be the best way to delete the data for particular condition ?

UPDATE TABLE_NAME
SET VALUE_TIME = null
WHERE APP_NAME = 'XYZ'
AND APP_TYPE = 'TEST'; 

Thanks

役に立ちましたか?

解決 2

Simple Answer, You can't update non-nullable column data to NULL or ' ' in oracle. I could only think of is Alter the column to have null.

ALTER 
TABLE TABLE_NAME 
MODIFY VALUE_TYPE VARCHAR2(500) NULL

他のヒント

If you want to delete the row:

DELETE TABLE_NAME WHERE APP_NAME = 'XYZ' AND APP_TYPE = 'TEST'; 

The column VALUE_TYPE is defined as NOT NULL, so you can't set it to null. You could alter the table to make it nullable:

ALTER TABLE TABLE_NAME MODIFY VALUE_TYPE VARCHAR2(500) NULL;

And then run the UPDATE statement in your question.

Hopefully this answers your question - it wasn't clear what you want to do exactly.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top