Make global sql work

The template needed fixing as well

Change-Id: I72734d7ecdef9110d35319aae0d42987bd17b93d