Open 23bca310 opened 1 month ago
cur.execute(''' create trigger if not exists product_rate_qty before insert on product for each row begin select case when new.prate = 0 THEN raise (abort, 'Product rate cannot be zero.') when new.pqty = 0 THEN raise (abort, 'Product quantity cannot be zero.') end; end; ''')
how to write table data into csv file using writer object
with open('product2.csv','w',newline='')as file: writer=csv.writer(file) writer.writerow(['userid','pid','pname','prate','pqty'])
explain this code
explain trigger syntax