I'm unsure whether looking up the vdc_name by vapp_name is the right thing to do -- it depends on vapp names being unique in an organisation. This may be correct (and if so then this query is fine) but it is worth confirming.