Wednesday, May 13, 2015

Understand Oracle MODEL clause in one sentence


Short Version

Oracle MODEL clause allows 3-D access to a data set, compared to regular SQL functions' 1-D access.

Long Version

Oracle MODEL clause let you access any columns in the same row (1st dimension), and in any other rows (2nd dimension). In addition, you can use the calculated results immediately in the same query, enabling sequential calculation (3rd dimension).

Implication

The 3-D access extends SQL's data calculation capability in a revolutionary leap. It is similar to compare a 3-D printer to a hand-held label printer. It enables implementation of complex business logic within SQL, which previously has to be implemented in custom functions or stored procedures, or even outside of database using other programming languages.

No comments: