I have a table with a BLOB column. I have NOT NULL constraint on the same BLOB column. I want to allow nonempty files to be inserted into the column only. Now, NN constraint does not help to check the empty file. It allows both valid file and empty file into it.
How can I restrict to empty files being inserted into the BLOB column?
We are using Oracle 19c.
I tried with creating a CHECK constraint something like this. But it failed. I got an invalid identifier error - dbms_lob.getlength.
ALTER TABLE tb_name
ADD CONSTRAINT cons_name
CHECK(dbms_lob.getlength("col_name")>0);
Share your inputs and suggestions.
Thanks.