Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Updating rows via package with updating just a few columns..

Richard LeggeSep 27 2019 — edited Sep 30 2019

Morning all.

APEX 5.1, 12.1 SE..

Im updating my APEX application to remove as much code in the APEX app as possible, and use packages to do all the DML..

So I create a standard procedure in package with the following column notation for my tables e.g. P_COL_NAME in TABLE.COL_NAME%type default null

But in my app there all sorts of places where I may just update one or two columns not the whole table (I may not even have the data on the screen). However, now creating a procedure in a package, the associated update on the table updates all rows.  if I call the package with an update then any nulls get set to null on the row.  I can put nvl onto each column on the update statement, so that if there is no value it updates to itself  i.e. 

update tab1

set col1 = nvl(value1,col1)

...

I cant see how nvl2 would help either

I'm sure I've missed something basic here.

Thanks

Richard

Comments
Post Details
Added on Sep 27 2019
8 comments
901 views