Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How MAP member function are different from member function of Object Type in Oracle

I am curious about MAP keyword given to member function of Object type and wish know about how MAP member function are different from member function of Object Type in Oracle

like image 716
Amol Avatar asked Dec 29 '25 08:12

Amol


1 Answers

MAP member function are special functions used to compare objects. "Ordinary" member functions are for your own usage.

The real comparison is more between MAP member functions and ORDER methods.

You can define either one or the other for your objects. It will be automatically called when you compare two objects using the relational operators <, <=, >, ... as well as when performing implicit comparison using DISTINCT, GROUP BY, UNION, and ORDER BY clauses.

But:

  • The former one will define ordering of your object by mapping them to a scalar value
  • The later will force you to programmatically define comparison rules between two objects.

MAP member function implies an absolute ordering, whereas ORDER method will use relative ordering.

like image 175
Sylvain Leroux Avatar answered Jan 01 '26 01:01

Sylvain Leroux



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!