I have seen the help.In my analysis in no way does the code give
an example of changing the values of the virtual record. In the 
example the SYS_NEW table is "SalesDetails". The Update statement
refers to the "ProductCount" table. In my mind these are two different
tables. 


This is not the behavior we are discussing. The object of the game would be 

to update/set values in the virtual record for the transaction that will be
posted to the SalesDetails table.

The example does not uses tables from the CONCOMP or RRBYW18 databases supplied
by RBase. 


I am not being confused by the non-used of the BEFORE keyword. Also, You can 
easily read
values of the SYS_New virtual record into variables and that seed to be what 
the bolded words seem to incicate. In no way does this indicate that you can 
change the virtual record.  


Jim Bentley,
American Celiac Society 1-504-737-3293



From the help files I get this. Note the bolded phrase. The example 
specifically changes a value in the update statement. Are you being confused by 
the syntax where R:Base does not specifically include the keyword BEFORE in the 
before triggers?

Albert


***********************************
The SYS_NEW parameter is used in a WHEREclause within, and only within, the 
context of a Trigger. 
This virtual pointer is available to INSERT and UPDATE triggers. It allows code 
to access the contents of the row as it will be after the INSERT or 
UPDATEaction. Using this in the body of a WHERE clause allows code to act on 
the contents of that virtual row and NOT fire off another trigger. 
Example
The following command is within the body of an Insert Trigger and is being used 
to increment the count of how many items have been used. 
SELECT ProductType INTO vPType INDIC v1 +
FROM SalesDetails +
WHERE CURRENT OF SYS_NEW
UPDATE ProductCount +
SET ProductCount = (ProductCount + 1) +
WHERE ProductType = .vPType
********************************************
On 2/28/2014 7:09 PM, James Bentley wrote:
Albert,
>
>If as you sy we can alter the SYS_NEW record in an BEFORE INSERT
        or BEFORE UPDATE trigger I would appreciate
>your posting to this list. To the Best of knowledge the SYS_NEW
        record is implemented as a READ ONLY Cursor and
>cannot be altered within the trigger code.
>
>
>Jim Bentley, 
>
>
>
>
>American Celiac Society 
>
>
>
>
>1-504-737-3293
>

Reply via email to