insert and fetch rows