PSLine2000Documentation/Queries/AddnlPROC Query.md

1.9 KiB

AddnlPROC Query

Analysis generated on: 4/2/2025 9:56:41 AM

SQL Statement

UPDATE AddnlPROC SET AddnlPROC.WC2 = "304"
WHERE (((AddnlPROC.WC2)="330") AND ((AddnlPROC.WC3)="035") AND ((AddnlPROC.WC4)="035"));

Dependencies

  • None

Parameters

  • None

What it does

SQL Code Explanation

Table Update: AddnlPROC

This SQL code updates the values in the WC2 column of the AddnlPROC table based on specific conditions.

**UPDATE AddnlPROC SET AddnlPROC.WC2 = "304"**

*   Updates the value in the `WC2` column.
*   The new value is set to `"304"`.

**WHERE Condition**
--------------------

The update operation is restricted by a complex condition that must be met before any changes can be made to the `WC2` value. The condition is:

```markdown
**WHERE (((AddnlPROC.WC2)="330") AND ((AddnlPROC.WC3)="035") AND ((AddnlPROC.WC4)="035"))**

*   Checks if the current value in the `WC2` column is equal to `"330"`.
*   If this condition is not met, the update operation will be skipped.
*   After verifying that `WC2` equals `"330"`, it checks if the current value in the `WC3` column equals `"035"` and also verifies that the value in the `WC4` column equals `"035"`.
    *   If either of these conditions is not met, the update operation will be skipped.
        +   For example, if `WC2` is `"330"` but `WC3` or `WC4` has a different value than specified, the update will not proceed.
*   Only when all three conditions are met (`WC2 = "330"`, `WC3 = "035"`, and `WC4 = "035"`), the update operation for the `WC2` column with the new value `"304"` is performed.

### Summary

This SQL code updates the `WC2` column in the `AddnlPROC` table to `"304"` only if three specific conditions are met:
- The current value of `WC2` equals `"330"`.
- The current value of `WC3` equals `"035"`.
- The current value of `WC4` equals `"035"`.