Congrats for nailing it down!
This is just a proof of concept, right? Otherwise you could use static SQL in this case.
Edit: I've originaly overlooked your question:
Jigar M Gohil wrote:This raised another question: is there a way to re-use the repeated bind variables? (similar to what I was trying earlier)
Not in your case. See
the documentation.