Hey all,
I'm working on a SQL select query of ticketing and seat information, and I'd like to be able to add the n-scan ticket number to the query, but for the life of me I can't find where the number lives in the database. I know it's possible to get the number from the Order Export Utility when it's run in individual mode, but Does anyone have a table or view that they know it lives on?
I'm not an nscan expert, but... pretty much any number could be presented as an nscan number. In this case, I had a quick look at TP_ORDER_EXPORT (unsure if thats the right procedure for that report) and it appears to be pushing ticket and perf numbers to FS_NSCAN_BARCODE function. I.e. not a table or a view, but from a function.
Since the output mode parameter selects between single seats or mutliples, I think it's probably the right procedure. So here's the code:
barcode_data = CASE When @output_mode = 2 then dbo.FS_NSCAN_BARCODE(s.ticket_no, pf.perf_no) else NULL end
And here's the description from that function, which seems to line up with the above:
/******************************************************************************************
This procedure is called from TP_GET_TICKET_ORD_ELEMENTS and TP_GET_BATCH_SUBS_TICKETS when
the N-Scan access control barcode element is used. It takes the components of the barcode and puts them
in the correct format
Data is returned in this format:
AATTTTTTTTTTPPPPPPPP
where A = access code, T = ticket number and P = performance or package number.
Note that this formula only handles perf_no's up to 8 digits