Proc sql updating multiple columns

Depending on the answers to these questions you may be able to execute multiple update statements, one for each column that you wish to update and place the condition on that column's value in the where clause of the update so that zero rows are updated if that column has the wrong value.

Try and think set-based, don't assume that update needs to update a single row found by the primary key.

It’s fine to use two conditions in the WHERE clause: in my real table, the unique identifier is not indexed, so I pass a second condition in the WHERE clause with a date that is indexed.

Finally, it’s good practice to test the automatic macro variables SQLOBS and SQLRC to verify the PROC SQL executed correctly.

proc sql updating multiple columns-23

How many different combinations of columns to update do you have? Are indexes in place for fast access to rows to update?

The amount of rows to update will most likely vary, could be dozens or hundreds.

I assume not since I couldn't find anything about this, but maybe someone has a clever alternative (besides using a procedure or updating each column using a : In my case I have 14 potential columns that may be updated, with only one being updated per matching row (the table to be updated is joined with another in the query).

By January 2009, the game had sold nearly three million copies.

The game takes place in a sprawling African landscape, with terrain ranging from desert to savannah to jungle.

Leave a Reply