Our project needs to design a packet sending and receiving and parsing function. After carefully studying the packet format, we find it very tricky. Generally, the packet data comes from multiple tables in the database, and each row of the packet data comes from one row in a table in the database. If this is the case, it will be much simpler. However, there are exceptions in everything. Some database records need to be split into multiple lines in the message, and multiple data rows need to be merged into one report line.
As a result, it is very difficult to create a common message module, and the definition of the Message format will become very complex. It is not only necessary to define the Message format but also the relationship with the database.
We have also considered using stored procedures to generate data required by various packets. However, Oracle does not support the stored procedures for returning data sets.