I don't think you need to purchase anything.
I'm pretty sure that the Dell P2415Q comes with the cable that you need in the box!
The mini DisplayPort plugs in to your MBPro (into the thunderbolt port), and the other end (DisplayPort) plugs in to the Dell display.
You do know that your 2012 MBPro does not have the capability to support the 4k video that your display can provide (3840 x 2160), but you can get the full HD resolution of 2560x1600, which is still a pretty nice image...