Result Set 1 - Production Events

The following table lists the parameters used in a Production Event Result Set.

Order

Field Name

Req

Values/Table Reference

0

Result Set Type

X

1

1

Not Used

 

Not used.

2

Transaction Type

X

1 Add, 2 Update, 3 - Delete

3

Event Id

X

Events (Event_Id).  Not required on updates.

4

Event Number

X

Events (Event_Num)

5

Production Unit Id

X

Events (PU_Id), Prod_Units (PU_Id)

6

Timestamp

X

Events.(TimeStamp)

7

Applied Product

 

Events (Applied_Product)

8

Source Event

 

Events (Source_Event)

9

Event Status

 

Events (Event_Status)

10

Confirmed

 

 

11

User Id

X

Events (User_Id), Users (User_Id).  Allows a specific User_Id to be used and tracked.  If not using a specific User_Id account then set it to 0 and the appropriate Service User_Id will be used.

12

Update Type

 

0 = Pre Update. Database Manager writes to database and sends to client.

1 = Post Update. Data already in database and sent to clients only.

13

Conformance

 

0 - Target

1 - Upper/Lower User Limit Exceeded
2 - Upper/Lower Warning Limit Exceeded

3 - Upper/Lower Reject Exceeded

14

TestPctComplete

 

Events (Testing_Prct_Complete)

15

StartTime

 

Events (Start_Time)

16

TransNum

 

0 Update fields that are not null to the new values.

2 Update all fields of Events to the values in Result Set. 

17

Testing Status

 

Events (Testing_Status)

1- Normal

2 - Skip

3 - Reset

18

Comment Id

 

Events (Comment_Id)

19

EventSubTypeId

 

Events (Event_Subtype_Id),

Event_Subtypes (Event_Subtype_Id)

20

EntryOn

 

Events (Entry_On)

21

ApprovedUserID

 

User ID of eSig approver

22

SecondUserID

 

User ID of eSig second approver

23

ApprovedReasonID

 

Reason ID of reason code for approval

24

UserReasonID

 

Reason ID for user sign-off

25

UserSignOffID

 

User ID for user sign-off

26

ExtendedInfo

 

Extended information field

27

ESignature

 

Signature ID from the ESignature table

See Also

Partial Example Code for Using Result Set 1

--Declare the SQL variables used

Declare

@EUOrderId int,

@EUTransaction_Type int,

@EUEvent_Id int,

@EUEvent_Num varchar(25),

@EUPU_Id int,

@EUTimestamp datetime,

@EUApplied_Product int,

@EUSource_Event int,

@EUEvent_Status int,

@EUConfirmed int,

@EUUser_Id int,

@EUPostUpdate int,

@EUConformance int,

@EUTestPctComplete int,

@EUStartTime datetime,

@EUTransactionNumber int,

@EUTestingStatus int,

@EUComment_Id int,

@EUEvent_Subtype_Id int,

@EUEntry_On datetime

--Create a temporary table to hold all event result set rows

CREATE TABLE #EventUpdates (

  EUId int,

  EUTransaction_Type int,

  EUEvent_Id int NULL,

  EUEvent_Num Varchar(25),

  EUPU_Id int,

  EUTimeStamp varchar(25),

  EUApplied_Product int Null,

  EUSource_Event int Null,

  EUEvent_Status int Null,

  EUConfirmed int Null,

  EUUser_Id int,

  EUPostUpdate int,

  EUConformance int,

  EUTestPctComplete int,

  EUStartTime datetime,

  EUTransactionNumber int,

  EUTestingStatus int,

  EUComment_Id int,

  EUEvent_Subtype_Id int,

  EUEntry_On datetime)

--Set Result Set Variables to values retrieved in your custom code.  No specific custom code is being show.

Select @EUOrderId

Select @EUTransaction_Type = 1

Select @EUEvent_Id = Null

Select @EUEvent_Num = @NewEvent_Num

Select @EUPU_Id = @PU_Id

Select @EUTimestamp = @EventTimestamp

Select @EUApplied_Product = NULL

Select @EUSource_Event = NULL

Select @EUEvent_Status = ProdStatus_Id from Production_Status

  Where ProdStatus_Desc = 'Active'

Select @EUConfirmed = 1

Select @EUUser_Id = Null

Select @EUPostUpdate = 0

Select @EUConformance = Null

Select @EUTestPctComplete = Null

Select @EUStartTime = @EventTimestamp

Select @EUTransactionNumber = Null

Select @EUTestingStatus = Null

Select @EUComment_Id = Null

Select @EUEvent_Subtype_Id = Null

Select @EUEntry_On = Getdate()

 

Insert into #EventUpdates (EUId,EUTransaction_Type,EUEvent_Id,EUEvent_Num,EUPU_Id,EUTimeStamp,EUApplied_Product,EUSource_Event,EUEvent_Status,EUConfirmed,EUUser_Id,EUPostUpdate,EUConformance, EUTestPctComplete,EUStartTime,EUTransactionNumber,EUTestingStatus, EUComment_Id, EUEvent_Subtype_Id,EUEntry_On)

Values(@EUOrderId,@EUTransaction_Type,@EUId,@NewEvent_Num,@PU_Id,@EventTimestamp,@EUApplied_Product,@EUSource_Event,@EUEvent_Status,@EUConfirmed,@EUUser_Id,@EUPostUpdate,@EUConformance,@ EUTestPctComplete,@EUStartTime,@EUTransactionNumber,@EUTestingStatus,@EUComment_Id,@EUEvent_Subtype_Id,@EUEntry_On)

--Send out Result Set Message back to the calling Service

If (Select Count(*) From #EventUpdates) > 0

  Select 1,* From #EventUpdates

Select @ReturnStatus = 1

Return