sql_ functions and automatic decoding