tpp_works and sql