Or use virtual column...
Toon, July 05, 2016 - 11:46 am UTC
The STATUS column is basically a redundant column at the row level, the way you describe your use-case. You could either just code it's derivation in a view, and use the view to query STATUS, or have STATUS be a virtual column to your table.
CREATE TABLE
(...
,STATUS varchar2(8)generated always as
(case when lname is not null then 'APPROVED' else 'PENDING' end )
)
July 05, 2016 - 12:17 pm UTC
Yep, great point Toon
Perfect answer.
Nitesh, July 06, 2016 - 6:15 pm UTC
Answer was as accurate as it can be.
Keep helping us
Thanks and regards
July 06, 2016 - 11:52 pm UTC
glad we could help out