An important technique for extracting useful information, such as regularities, from usually historical data, is called as association rule mining. The query flocks technique, which extends the concept of association rule mining with a "generate-and-test" model for different kind of patterns, can also be applied to deductive databases. In this paper, query flocks technique is extended further, with view definitions including recursive views. We have designed architecture to compile query flocks from datalog into SQL in order to be able to use commercially available DBMS's as an underlying engine. Since recursive datalog views (IDB's) cannot be converted directly into SQL statements, they are materialized before the final compilation operation.