Example: my_bit_xor Declaration

The “my_bit_xor” example is analogous to the SAP Sybase SQL Anywhere® built-in BIT_XOR, except it operates only on unsigned integers.

my_bit_xor declaration

The resulting declaration is:

CREATE AGGREGATE FUNCTION my_bit_xor(IN arg1 UNSIGNED	INT)
 RETURNS UNSIGNED INT
	ON EMPTY INPUT RETURNS NULL
	EXTERNAL NAME 'describe_my_bit_xor@my_shared_lib'

Like the my_sum example, my_bit_xor has no associated usage restrictions, and is therefore usable as a simple aggregate or as an OLAP-style aggregate with any kind of a window.