use dollar variables instead of named variables in sql functions