User1909408015 posted
I have a problem in inserting data in a database. I have 2 tables, Reservation and Customer_Info. Reservation table has a field "Booking_id" that needs to be inserted into "booking_id" field ofcustomer_info table too. There is a trigger in database
that increments the value while inserting the data in database. But the error occurs once I try to insert through the browser.
Here is my code:
//inserting into into table RESERVATION
Reservation.MODE_OF_PAYMENT = Request.Form["ModeTypeList"].ToString();
Reservation.COUNTRY = Request.Form["countryList"].ToString();
Reservation.ENTRY_DATE = DateTime.Now;
//inserting into table CUSTOMER_INFO
customerInfo.TITLE = Request.Form["titleList"].ToString();
customerInfo.FIRST_NAME = Request.Form["customerInfo.FIRST_NAME"].ToString();//Retriving text from textbox
customerInfo.MIDDLE_NAME = Request.Form["customerInfo.MIDDLE_NAME"].ToString();
customerInfo.LAST_NAME = Request.Form["customerInfo.LAST_NAME"].ToString();
customerInfo.ENTRY_DATE = DateTime.Now;
_hotelEntities.RESERVATIONs.Add(Reservation);
_hotelEntities.CUSTOMER_INFO.Add(customerInfo);
_hotelEntities.SaveChanges();
return View(_hotelEntities);
When i run the program error occurs at. "_hotelEntities.SaveChanges()"
ORA-08002: sequence BOOKING_ID_SEQUENCE.CURRVAL is not yet defined in this session
ORA-06512: at "ITCORE.RESERVATION_CUSTOMER_BOOKING", line 3
ORA-04088: error during execution of trigger 'ITCORE.RESERVATION_CUSTOMER_BOOKING'