Waste Event

Order Field Name Values/Table Reference
0 Result Set Type 9
1 Update Type
  • 0 = Pre-Update
  • 1 = Post-Update
2 Transaction Number
3 User Id Waste_Event_Details.User_Id

Users.User_Id

4 Transaction Type
  • 1 = Add
  • 2 = Update
  • 3 = Delete
5 Waste Event Id Waste_Event_Details.WED_Id
6 PU_Id Waste_Event_Details.PU_Id

Prod_Units.PU_Id

7 Location Waste_Event_Details.Source_PU_Id

Prod_Units.PU_Id

8 Type Id Waste_Event_Details.WET_Id

Waste_Event_Types.WET_Id

9 Measure Id Waste_Event_Details.WEMT_Id

Waste_Event_Meas.WEMT_Id

10 Reason 1 Waste_Event_Details.Reason1

Event_Reasons.Reason_Id

11 Reason 2 Waste_Event_Details.Reason2

Event_Reasons.Reason_Id

12 Reason 3 Waste_Event_Details.Reason3

Event_Reasons.Reason_Id

13 Reason 4 Waste_Event_Details.Reason4

Event_Reasons.Reason_Id

14 Event Id Waste_Event_Details.Event_Id

Events.Event_Id

15 Amount Waste_Event_Details.Amount
16 Marker 1 Waste_Event_Details.Marker1
17 Marker 2 Waste_Event_Details.Marker2
18 Timestamp Waste_Event_Details.TimeStamp
19 Action 1 Waste_Event_Details.Action1

Event_Reasons.Reason_Id

20 Action 2 Waste_Event_Details.Action1

Event_Reasons.Reason_Id

21 Action 3 Waste_Event_Details.Action1

Event_Reasons.Reason_Id

22 Action 4 Waste_Event_Details.Action1

Event_Reasons.Reason_Id

23 Action Comment Id Waste_Event_Details.Action_Comment_Id

Comments.Comment_Id

24 Research Comment Id Waste_Event_Details.Research_Comment_Id

Comments.Comment_Id

25 Research Status Id Waste_Event_Details.Research_Status_Id
26 Research Open Date Waste_Event_Details.Research_Open_Date
27 Research Close Date Waste_Event_Details.Research_Close_Date
28 Waste Event Comment Id Waste_n_Timed_Comments.WTC_Id
29 TargetProdRate Waste_Event_Details.Target_Prod_Rate
30 Research User Id Waste_Event_Details.Research_User_Id

Users.User_Id

If the Transaction Number is set to a ‘0’, it means that a value of ‘0’ returned for any dimension fields will be set to NULL in the database. If the Transaction Number is set to a ‘2’, it means that a value of ‘0’ returned for any dimension fields will be set to ‘0’ in the database.

Example


DECLARE @WasteEvents TABLE (   ResultSetType	int DEFAULT 9,
	                         PreUpdate	   int DEFAULT 1,
	                         TransNum	    int DEFAULT 0,
	                         UserId	      int NULL,
	                         TransType	   int DEFAULT 1,
	                         WEDId	       int NULL,
	                         PUId	        int NULL,
	                         SourcePUId	  int NULL,
	                         WETId	       int NULL,
	                         WEMTId	      int NULL,
	                         Cause1	      int NULL,
	                         Cause2	      int NULL,
	                         Cause3	      int NULL,
	                         Cause4	      int NULL,
	                         EventId	     int NULL,
	                         Amount	      float NULL,
	                         Marker1	     float NULL,
	                         Marker2	     float NULL,
	                         TimeStamp	   datetime NULL,
	                         Action1	     int NULL,
	                         Action2	     int NULL,
	                         Action3	     int NULL,
	                         Action4	     int NULL,
	                         ActionCommentId    int NULL,
	                         ResearchCommentId  int NULL,
	                         ResearchStatusId   int NULL,
	                         ResearchOpenDate   datetime NULL,
	                         ResearchCloseDate  datetime NULL,
	                         CommentId	   int NULL,
	                         TargetProdRate    float NULL,
	                         ResearchUserId    int NULL)