Print at Home (PAH) Reprint... SQL

Asking the experts...

We are in the process of automating (creating a custom stpred procedure) the process of changing the delivery method of specific orders to "Print at Home" and validating that the PAH email was sent successfully.  

The general process being...

  1. Change the delivery method of the order to "Print at Home"
  2. Validate that the email was sent...
  3. If email was sent ([T_ORDER_SEAT_HIST].[event_code]=23), then do nothing (process successfull)
  4. If email not sent ( [T_ORDER_SEAT_HIST].[event_code]=NULL), then create a Print at Home (PAH) Reprint request within the stored procedure
  5. End.

Everything is working correctly with the exception of coding step 4... creating a Print at Home (PAH) Reprint request within the stored procedure

I'm hoping that it's as simple as changing an existing flag/value or adding a record to a table, however, I can't seem to find any documentation regarding this.

Does anyone know how to accomplish this in code?

Any assistance would be greatly appreciated.

Cheers,
Brad



[edited by: Brad Staples at 12:11 PM (GMT -6) on 20 Jul 2017]