What about http://db.apache.org/derby/docs/10.2/ref/rrefcasenullif.html#rrefcasenullif ?
CASE
WHEN 1 = 2 THEN 3
WHEN 4 = 5 THEN 6
ELSE 7
END
So maybe you can try something like:
CASE
WHEN select 1 from customers where name='somename' = 1 THEN update...
ELSE insert...
END
I have no idea if this will work, but it seems like a start. Good luck
:. ... , . , SELECT INSERT; , CASE . , , ...