Working pipeline insert query