The article describes the situation of a database breakdown when a dish with a zero code appears in it.
An example of such a case in a cube report:
- Communication failure and asynchronous behavior of the reference or report server and the SQL database
- Rollback of the reference or report server database to the state when the sold dishes were not yet in the menu of the manager station
Search for Error Cause
The first step is to find out the error cause.
Open SQL Server Management Studio and query your database:
select distinct sifr from SESSIONDISHES where SIFR not in (select sifr from MENUITEMS)CODE
The request shows the sold dishes that are not on the menu. In this case, there was one such dish
Next, by searching in the manager station, check if there are dishes with such identifiers
If there are such dishes, then it is case #1. The problem can be solved by uploading the references to the SQL database. Read the details below.
Solution for Case #1
To do this:
- Go to Sevice > Data Export > Export to Other DB
- Specify connection parameters, login, and password
- Check the boxes by default by unchecking the ExportCHKdb box. If you leave the box checked, the sales data will be overwritten
- Click the Test button and then Ok
- Wait for the export to finish.
If after these steps the dish is found in the manager station but is not in the SQL database, create a task for the support desk.
Solution for Case #2
If there are no dishes with zero code in the manager station, then it is case #2 - the database of the reference or report server was rolled back to the state when these dishes had not yet been created. To solve the problem:
- Remember the price, name, and other data of these dishes
- Create new dishes in the manager station with the parameters same as those from the previous paragraph
Execute a query to the SQL database from the field below. One dish — one request. That is, for each dish, make a line with the old and new dish ID
update sessiondishes set sifr = 111111 where sifr = 1000979CODE
where 1000979 is the identifier of the old dish, absent in the rk7.udb database, and 111111 is for the new dish, created in the manager station.
- Ready. Now, cube reports will show the dishes we have created instead of those with a zero code.