Error in SQL calling iv table for $prod_id.