Last post Jan 21, 2014 03:36 AM by wmec
Nov 10, 2013 02:13 AM|Anishamhr|LINK
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;
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'
Nov 11, 2013 03:43 AM|er_abhi|LINK
there is something wrong with this line 'BOOKING_ID_SEQUENCE.CURRVAL' .. why you are ussing currval here? if u want to insert new record u need to use nextval.
Jan 21, 2014 03:36 AM|wmec|LINK
Please check the table trigger on which the error arose.