setrow and setjson methods for sub