implemented code to generate input stored procedure