Typically this is done for layout views. I understand a common technique for layout is to perform an XOR (exclusive-OR) of the two views and any output is the result of differences between the two input views. However, I am not sure if you can use the dbLayer* functions for a schematic view, I have not tried this. There is a dbLayerXor() function:
Try it out and look at the documentation for more information if needed.
I hope that this helps you.