Problem in inserting data into oracle database. RRS feed

  • Question

  • 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;

    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-04088: error during execution of trigger 'ITCORE.RESERVATION_CUSTOMER_BOOKING'

    Sunday, November 10, 2013 2:13 AM

All replies

  • User398825048 posted

    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.

    Monday, November 11, 2013 3:43 AM
  • User364663285 posted

    Please check the table trigger on which the error arose.

    Tuesday, January 21, 2014 3:36 AM