Record not inserting into the table through Forms 10g

Hi all,
I have created a form in 10g(10.1.2.0.2) based on just one table that has 4 columns(col1, col2, col3, col4).
Here col1, col2 and col3 are VARCHAR2 and col4 is date and all the columns are not null columns(There are no primary and foriegn key constrains, which means duplicates are allowed).
My form contains 2 blocks where block 1 has one text item (col1) and 3 buttons (Delete, Save, Exit).
And block2 is a database block and has col2,col3,col4 which are in tabluar layout frame displaying 10 records.
When the form is opened the cursor has to be in block1.col1 for querrying. Here i enter a value in col1, and then when I click on col2 in the block2, then I put execute_query in new_block_instance of block2, which displays the records.
The block2 properties are not updatable, insertable and query is allowed.
Everything is working good until here. But here in the block2 when I want to insert another record into the table, by navigating all the way down to the last empty record and entering the new values for col2, col3 and col4 And then Ctrl+S will display the message "*FRM-40400: Transaction complete: 1 record applied and saved.*" But actually the record is not inserted into the table.
I also disabled the col4 by setting the Enabled property to No, since while inserting new record the date have to be populated into it and it shouldnt be changed by the user. And im populating the sysdate into the new record by setting Intial Value property to *$$DATE$$*.
And another requirement which I could not work arround here is that, the col3 also should be populated with the username of the user while inserting.
please help me...

Hi Sarah,
I do not want to update the existing record. So I kept Udate Allowed to No in property palette for the items in block2.
Do I have to do this property at block level also?
I'm inserting a new record here.
Edited by: Charan on Sep 19, 2011 8:48 AM

Similar Messages

  • Record is not inserting into the Table thourgh forms 10g

    Hi All,
    I have the form built in 10g(10.1.2.0.2).
    Basically the form has 2 blocks.
    Block 1 with only one item, where we enter some value and hit enter(this will navigate to block2 and execute the query).
    Block 2(tabular) will fetch the records. Now this block2 have 3 columns(caseid, userid, date).
    Now when I insert a new record, I just need to enter the caseid only. And userid and date have to be automatically populated.
    I can populate the USERID and DATE fields.
    And when I enter some value in caseid item of block 2, and then do Control+S(to insert the record and Save the transaction),
    i get the message saying FRM-40400: Transaction complete: 1 records applied and saved.
    But when I query again for the same, I dont se the record inserted into the table.
    Why is this happening?
    Help please...

    @ Inol
    There is no promary or foriegn key relation ship. The form is fetching records from just one table. As I said block1 has col1. and Block2 has col2,3,4.
    @Andreas
    Yes I did select * from table, select count(*) from table in SQL*Plus. Nothing is inserted.
    And one thing I have to tall here is, I have a ON-INSERT trigger in block2.
    The code in ON-INSERT trigger is
    --  :BLOCK2.DATE := TO_DATE(:DATE,'DD-MON-YYYY') ;
    /* commented since I was populating date by assigning $$DATETIME$$ to the Initial value property of the data item. */
    :BLOCK2.SOURCE_CASE := :BLOCK1.SOURCE_CASEID;Forgot to tell you,
    Since I was inserting the record from block2(3 columns), to the table which has 4 columns, there is another item in block 2 which has the visible property No.
    So the block 2 has 4 columns. And the hidden column will hold the value that is in the item of block1. This is what i'm pushing in the ON-INSERT trigger.
    Edited by: Charan on Sep 20, 2011 1:51 PM

  • Record not inserting into sap table with connector framework ?

    here is the code, but record not being inserting into the table ... but same piece of code working fine while updating ... the record ...
    try {
    interaction = connection.createInteractionEx();
    IInteractionSpec interactionSpec = interaction.getInteractionSpec();
    String functionName = "Z_XYZ";
    interactionSpec.setPropertyValue("Name", functionName);
    String writingTable = "MYTABLE";
    RecordFactory rf = interaction.getRecordFactory();
    MappedRecord importParams = rf.createMappedRecord("input");
    importParams.put("ATTR1", "VALUE1");
    importParams.put("ATTR2", "VALUE2");
    IFunction function = connection.getFunctionsMetaData().getFunction(functionName);
    IStructureFactory sf = interaction.retrieveStructureFactory();
    IRecordSet table = (IRecordSet) sf.getStructure(function.getParameter(writingTable).getStructure());
    table.insertRow();
    table.setString("ATNAME", "VALUE");
    table.setString("ATWRT", "VALUE");
    importParams.put(writingTable, table);
    MappedRecord output = (MappedRecord) interaction.execute(interactionSpec, importParams);
    } catch (Exception e) {
    any idea?
    than ks
    MMK

    Hi Mohan,
    Does a creation through SE37 with the same input work?
    Yoav.

  • Avoiding duplicate records while inserting into the table

    Hi
    I tried the following insert statement , where i want to avoid the duplicate records while inserting itself
    but giving me the errror like invalid identifier, though the column exists in the table
    Please let me know Where i'm doing the mistake.
    INSERT INTO t_map tm(sn_id,o_id,txt,typ,sn_time)
       SELECT 100,
              sk.obj_id,
              sk.key_txt,
              sk.obj_typ,
              sysdate,
              FROM S_KEY sk
        WHERE     sk.obj_typ = 'AY'
              AND SYSDATE BETWEEN sk.start_date AND sk.end_date
              AND sk.obj_id IN (100170,1001054)
               and   not exists  (select 1
                                                                   FROM t_map tm1 where tm1.O_ID=tm.o_id
                                                                        and tm1.sn_id=tm.sn_id
                                                                        and tm1.txt=tm.txt
                                                                        and tm1.typ=tm.typ
                                                                        and tm1.sn_time=tm.sn_time )

    Then
    you have to join the table with alias tml where is that ?do you want like this?
    INSERT INTO t_map tm(sn_id,o_id,txt,typ,sn_time)
       SELECT 100,
              sk.obj_id,
              sk.key_txt,
              sk.obj_typ,
              sysdate,
              FROM S_KEY sk
        WHERE     sk.obj_typ = 'AY'
              AND SYSDATE BETWEEN sk.start_date AND sk.end_date
              AND sk.obj_id IN (100170,1001054)
               and   not exists  (select 1
                                                                   FROM t_map tm where sk.obj_ID=tm.o_id
                                                                        and 100=tm.sn_id
                                                                        and sk.key_txt=tm.txt
                                                                        and sk.obj_typ=tm.typ
                                                                        and sysdate=tm.sn_time )

  • Multi-table mapping is not inserting into the primary table first.

    I have an inheritance mapping where the children are mapped to the parent table oids with the "Multi-Table Info" tab.
    One of children is not inserting properly. Its insert is attempting to insert into one of the tables from the "Additional Tables" of "Multi-Table Info" instead of the primary table that it is mapped to.
    The other children insert correctly. This child is not much different from those.
    I looked through the forums, but found nothing similiar.

    I would expect the Children to be inserted into both the primary table and the Additional Table? Is the object in question inserted into the primary table at all? Is the problem that it is being inserted into the Additional Table first? If it is, are the primary key names different? Is it a foreign key relationship?
    If the object in question has no fields in the additional table is it mapped to the additional table? (it should not be)
    Perhaps providing the deployment XML will help determine the problem,
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • When inserting 2 column details in a single table using Stored Procedure.Only 2 Column details getting inserted.1column details are not getting into the table.Please see the below script and help me to change.

    Line 390 Under the (Insert into SALES_TRADEIN Table)
    I need to insert (TradeIn_1_VIN) Values If there is no values in (TradeIn_1_VIN) then i have to insert (TradeIn_2_VIN) values to the (SALES_TRADEIN) Table.
    After i run then below script only (TradeIn_2_VIN) values are get inserted in the table. (TradeIn_1_VIN) are not getting loaded in to the table.
    I think there is the problem from Line No (404 to 414) Please help me change those particular lines to insert (TradeIn_1_VIN) Values also.If there is no details then (TradeIn_2_VIN) need to be inserted.
    -- =============================================
    -- Stored Procedure for Flatfile_Sales
    -- =============================================
    USE [IconicMarketing]
    ---==========Sales_Cursor
    --USE [IconicMarketing]
    --GO
    DECLARE
    @FileType
    varchar(50),
    @ACDealerID
    varchar(50),
    @ClientDealerID
    varchar(50),
    @DMSType
    varchar(50),
    @DealNumber
    varchar(50),
    @CustomerNumber
    varchar(50),
    @CustomerName
    varchar(50),
    @CustomerFirstName
    varchar(50),
    @CustomerLastName
    varchar(50),
    @CustomerAddress
    varchar(50),
    @CustomerCity
    varchar(50),
    @CustomerState
    varchar(50),
    @CustomerZip
    varchar(50),
    @CustomerCounty
    varchar(50),
    @CustomerHomePhone
    varchar(50),
    @CustomerWorkPhone
    varchar(50),
    @CustomerCellPhone
    varchar(50),
    @CustomerPagerPhone
    varchar(50),
    @CustomerEmail
    varchar(50),
    @CustomerBirthDate
    varchar(50),
    @MailBlock
    varchar(50),
    @CoBuyerName
    varchar(50),
    @CoBuyerFirstName
    varchar(50),
    @CoBuyerLastName
    varchar(50),
    @CoBuyerAddress
    varchar(50),
    @CoBuyerCity
    varchar(50),
    @CoBuyerState
    varchar(50),
    @CoBuyerZip
    varchar(50),
    @CoBuyerCounty
    varchar(50),
    @CoBuyerHomePhone
    varchar(50),
    @CoBuyerWorkPhone
    varchar(50),
    @CoBuyerBirthDate
    varchar(50),
    @Salesman_1_Number
    varchar(50),
    @Salesman_1_Name
    varchar(50),
    @Salesman_2_Number
    varchar(50),
    @Salesman_2_Name
    varchar(50),
    @ClosingManagerName
    varchar(50),
    @ClosingManagerNumber
    varchar(50),
    @F_AND_I_ManagerNumber
    varchar(50),
    @F_AND_I_ManagerName
    varchar(50),
    @SalesManagerNumber
    varchar(50),
    @SalesManagerName
    varchar(50),
    @EntryDate
    varchar(50),
    @DealBookDate
    varchar(50),
    @VehicleYear
    varchar(50),
    @VehicleMake
    varchar(50),
    @VehicleModel
    varchar(50),
    @VehicleStockNumber
    varchar(50),
    @VehicleVIN
    varchar(50),
    @VehicleExteriorColor
    varchar(50),
    @VehicleInteriorColor
    varchar(50),
    @VehicleMileage
    varchar(50),
    @VehicleType
    varchar(50),
    @InServiceDate
    varchar(50),
    @HoldBackAmount
    varchar(50),
    @DealType
    varchar(50),
    @SaleType
    varchar(50),
    @BankCode
    varchar(50),
    @BankName
    varchar(50),
    @SalesmanCommission
    varchar(50),
    @GrossProfitSale
    varchar(50),
    @FinanceReserve
    varchar(50),
    @CreditLifePremium
    varchar(50),
    @CreditLifeCommision
    varchar(50),
    @TotalInsuranceReserve
    varchar(50),
    @BalloonAmount
    varchar(50),
    @CashPrice
    varchar(50),
    @AmountFinanced
    varchar(50),
    @TotalOfPayments
    varchar(50),
    @MSRP varchar(50),
    @DownPayment
    varchar(50),
    @SecurityDesposit
    varchar(50),
    @Rebate
    varchar(50),
    @Term varchar(50),
    @RetailPayment
    varchar(50),
    @PaymentType
    varchar(50),
    @RetailFirstPayDate
    varchar(50),
    @LeaseFirstPayDate
    varchar(50),
    @DayToFirstPayment
    varchar(50),
    @LeaseAnnualMiles
    varchar(50),
    @MileageRate
    varchar(50),
    @APRRate
    varchar(50),
    @ResidualAmount
    varchar(50),
    @LicenseFee
    varchar(50),
    @RegistrationFee
    varchar(50),
    @TotalTax
    varchar(50),
    @ExtendedWarrantyName
    varchar(50),
    @ExtendedWarrantyTerm
    varchar(50),
    @ExtendedWarrantyLimitMiles
    varchar(50),
    @ExtendedWarrantyDollar
    varchar(50),
    @ExtendedWarrantyProfit
    varchar(50),
    @FrontGross
    varchar(50),
    @BackGross
    varchar(50),
    @TradeIn_1_VIN
    varchar(50),
    @TradeIn_2_VIN
    varchar(50),
    @TradeIn_1_Make
    varchar(50),
    @TradeIn_2_Make
    varchar(50),
    @TradeIn_1_Model
    varchar(50),
    @TradeIn_2_Model
    varchar(50),
    @TradeIn_1_ExteriorColor
    varchar(50),
    @TradeIn_2_ExteriorColor
    varchar(50),
    @TradeIn_1_Year
    varchar(50),
    @TradeIn_2_Year
    varchar(50),
    @TradeIn_1_Mileage
    varchar(50),
    @TradeIn_2_Mileage
    varchar(50),
    @TradeIn_1_Gross
    varchar(50),
    @TradeIn_2_Gross
    varchar(50),
    @TradeIn_1_Payoff
    varchar(50),
    @TradeIn_2_Payoff
    varchar(50),
    @TradeIn_1_ACV
    varchar(50),
    @TradeIn_2_ACV
    varchar(50),
    @Fee_1_Name
    varchar(50),
    @Fee_1_Fee
    varchar(50),
    @Fee_1_Commission
    varchar(50),
    @Fee_2_Name
    varchar(50),
    @Fee_2_Fee
    varchar(50),
    @Fee_2_Commission
    varchar(50),
    @Fee_3_Name
    varchar(50),
    @Fee_3_Fee
    varchar(50),
    @Fee_3_Commission
    varchar(50),
    @Fee_4_Name
    varchar(50),
    @Fee_4_Fee
    varchar(50),
    @Fee_4_Commission
    varchar(50),
    @Fee_5_Name
    varchar(50),
    @Fee_5_Fee
    varchar(50),
    @Fee_5_Commission
    varchar(50),
    @Fee_6_Name
    varchar(50),
    @Fee_6_Fee
    varchar(50),
    @Fee_6_Commission
    varchar(50),
    @Fee_7_Name
    varchar(50),
    @Fee_7_Fee
    varchar(50),
    @Fee_7_Commission
    varchar(50),
    @Fee_8_Name
    varchar(50),
    @Fee_8_Fee
    varchar(50),
    @Fee_8_Commission
    varchar(50),
    @Fee_9_Name
    varchar(50),
    @Fee_9_Fee
    varchar(50),
    @Fee_9_Commission
    varchar(50),
    @Fee_10_Name
    varchar(50),
    @Fee_10_Fee
    varchar(50),
    @Fee_10_Commission
    varchar(50),
    @ContractDate
    varchar(50),
    @InsuranceName
    varchar(50),
    @InsuranceAgentName
    varchar(50),
    @InsuranceAddress
    varchar(50),
    @InsuranceCity
    varchar(50),
    @InsuranceState
    varchar(50),
    @InsuranceZip
    varchar(50),
    @InsurancePhone
    varchar(50),
    @InsurancePolicyNumber
    varchar(50),
    @InsuranceEffectiveDate
    varchar(50),
    @InsuranceExpirationDate
    varchar(50),
    @InsuranceCompensationDeduction
    varchar(50),
    @TradeIn_1_InteriorColor
    varchar(50),
    @TradeIn_2_InteriorColor
    varchar(50),
    @PhoneBlock
    varchar(50),
    @LicensePlateNumber
    varchar(50),
    @Cost varchar(50),
    @InvoiceAmount
    varchar(50),
    @FinanceCharge
    varchar(50),
    @TotalPickupPayment
    varchar(50),
    @TotalAccessories
    varchar(50),
    @TotalDriveOffAmount
    varchar(50),
    @EmailBlock
    varchar(50),
    @ModelDescriptionOfCarSold
    varchar(50),
    @VehicleClassification
    varchar(50),
    @ModelNumberOfCarSold
    varchar(50),
    @GAPPremium
    varchar(50),
    @LastInstallmentDate
    varchar(50),
    @CashDeposit
    varchar(50),
    @AHPremium
    varchar(50),
    @LeaseRate
    varchar(50),
    @DealerSelect
    varchar(50),
    @LeasePayment
    varchar(50),
    @LeaseNetCapCost
    varchar(50),
    @LeaseTotalCapReduction
    varchar(50),
    @DealStatus
    varchar(50),
    @CustomerSuffix
    varchar(50),
    @CustomerSalutation
    varchar(50),
    @CustomerAddress2
    varchar(50),
    @CustomerMiddleName
    varchar(50),
    @GlobalOptOut
    varchar(50),
    @LeaseTerm
    varchar(50),
    @ExtendedWarrantyFlag
    varchar(50),
    @Salesman_3_Number
    varchar(50),
    @Salesman_3_Name
    varchar(50),
    @Salesman_4_Number
    varchar(50),
    @Salesman_4_Name
    varchar(50),
    @Salesman_5_Number
    varchar(50),
    @Salesman_5_Name
    varchar(50),
    @Salesman_6_Number
    varchar(50),
    @Salesman_6_Name
    varchar(50),
    @APRRate2
    varchar(50),
    @APRRate3
    varchar(50),
    @APRRate4
    varchar(50),
    @Term2
    varchar(50),
    @SecurityDeposit2
    varchar(50),
    @DownPayment2
    varchar(50),
    @TotalOfPayments2
    varchar(50),
    @BasePayment
    varchar(50),
    @JournalSaleAmount
    varchar(50),
    @IndividualBusinessFlag
    varchar(50),
    @InventoryDate
    varchar(50),
    @StatusDate
    varchar(50),
    @ListPrice
    varchar(50),
    @NetTradeAmount
    varchar(50),
    @TrimLevel
    varchar(50),
    @SubTrimLevel
    varchar(50),
    @BodyDescription
    varchar(50),
    @BodyDoorCount
    varchar(50),
    @TransmissionDesc
    varchar(50),
    @EngineDesc
    varchar(50),
    @TypeCode
    varchar(50),
    @SLCT2
    varchar(50),
    @DealDateOffset
    varchar(50),
    @AccountingDate
    varchar(50),
    @CoBuyerCustNum
    varchar(50),
    @CoBuyerCell
    varchar(50),
    @CoBuyerEmail
    varchar(50),
    @CoBuyerSalutation
    varchar(50),
    @CoBuyerPhoneBlock
    varchar(50),
    @CoBuyerMailBlock
    varchar(50),
    @CoBuyerEmailBlock
    varchar(50),
    @RealBookDate
    varchar(50),
    @CoBuyerMiddleName
    varchar(50),
    @CoBuyerCountry
    varchar(50),
    @CoBuyerAddress2
    varchar(50),
    @CoBuyerOptOut
    varchar(50),
    @CoBuyerOccupation
    varchar(50),
    @CoBuyerEmployer
    varchar(50),
    @Country
    varchar(50),
    @Occupation
    varchar(50),
    @Employer
    varchar(50),
    @Salesman2Commission
    varchar(50),
    @BankAddress
    varchar(50),
    @BankCity
    varchar(50),
    @BankState
    varchar(50),
    @BankZip
    varchar(50),
    @LeaseEstimatedMiles
    varchar(50),
    @AFTReserve
    varchar(50),
    @CreditLifePrem
    varchar(50),
    @CreditLifeRes
    varchar(50),
    @AHRes
    varchar(50),
    @Language
    varchar(50),
    @BuyRate
    varchar(50),
    @DMVAmount
    varchar(50),
    @Weight
    varchar(50),
    @StateDMVTotFee
    varchar(50),
    @ROSNumber
    varchar(50),
    @Incentives
    varchar(50),
    @CASS_STD_LINE1
    varchar(50),
    @CASS_STD_LINE2
    varchar(50),
    @CASS_STD_CITY
    varchar(50),
    @CASS_STD_STATE
    varchar(50),
    @CASS_STD_ZIP
    varchar(50),
    @CASS_STD_ZIP4
    varchar(50),
    @CASS_STD_DPBC
    varchar(50),
    @CASS_STD_CHKDGT
    varchar(50),
    @CASS_STD_CART
    varchar(50),
    @CASS_STD_LOT
    varchar(50),
    @CASS_STD_LOTORD
    varchar(50),
    @CASS_STD_URB
    varchar(50),
    @CASS_STD_FIPS
    varchar(50),
    @CASS_STD_EWS
    varchar(50),
    @CASS_STD_LACS
    varchar(50),
    @CASS_STD_ZIPMOV
    varchar(50),
    @CASS_STD_Z4LOM
    varchar(50),
    @CASS_STD_NDIAPT
    varchar(50),
    @CASS_STD_NDIRR
    varchar(50),
    @CASS_STD_LACSRT
    varchar(50),
    @CASS_STD_ERROR_CD
    varchar(50),
    @NCOA_AC_ID
    varchar(50),
    @NCOA_COA_ADDSRC
    varchar(50),
    @NCOA_COA_MATCH
    varchar(50),
    @NCOA_COA_MOVTYP
    varchar(50),
    @NCOA_COA_DATE
    varchar(50),
    @NCOA_COA_DELCD
    varchar(50),
    @NCOA_COA_RTYPE
    varchar(50),
    @NCOA_COA_RTNCD
    varchar(50),
    @NCOA_COA_LINE1
    varchar(50),
    @NCOA_COA_LINE2
    varchar(50),
    @NCOA_COA_CITY
    varchar(50),
    @NCOA_COA_STATE
    varchar(50),
    @NCOA_COA_ZIP
    varchar(50),
    @NCOA_COA_ZIP4
    varchar(50),
    @NCOA_COA_DPBC
    varchar(50),
    @NCOA_COA_CHKDGT
    varchar(50),
    @NCOA_COA_CART
    varchar(50),
    @NCOA_COA_LOT
    varchar(50),
    @NCOA_COA_LOTORD
    varchar(50),
    @NCOA_COA_URB
    varchar(50),
    @NCOA_COA_Z4LOM
    varchar(50),
    @NCOA_COA_ACTION
    varchar(50),
    @NCOA_COA_QNAME
    varchar(50),
    @NCOA_DPV_AA
    varchar(50),
    @NCOA_DPV_A1
    varchar(50),
    @NCOA_DPV_BB
    varchar(50),
    @NCOA_DPV_CC
    varchar(50),
    @NCOA_DPV_M1
    varchar(50),
    @NCOA_DPV_M3
    varchar(50),
    @NCOA_DPV_N1
    varchar(50),
    @NCOA_DPV_P1
    varchar(50),
    @NCOA_DPV_P3
    varchar(50),
    @NCOA_DPV_RR
    varchar(50),
    @NCOA_DPV_R1
    varchar(50),
    @NCOA_DPV_STATUS
    varchar(50),
    @NCOA_DPV_F1
    varchar(50),
    @NCOA_DPV_G1
    varchar(50),
    @NCOA_DPV_U1
    varchar(50),
    @myerror
    varchar(500),
    @SalesID
    int,
    @errornumber int,
                @errorseverity varchar(500),
                @errorstate int,
                @errorprocedure varchar(500),
                @errorline varchar(50),
                @errormessage varchar(1000);
    DECLARE Sales_Cursor CURSOR FOR 
    SELECT * from FLATFILE_SALES;
    OPEN Sales_Cursor;
     :r C:\Clients\BlackBook\BlackBookMarketing\Bharath\LOG_SALES_INSERT.sql
    WHILE @@FETCH_STATUS = 0
    BEGIN
    PRINT @VehicleVIN    ;
    --===============================================================================
    -- ****************** insert into Sales Table ***********
    BEGIN TRY
        INSERT INTO Sales 
    IconicDealerID,
    DealNumber,
    CustomerNumber,
    DMSType,
    ContractDate
    VALUES (@ClientDealerID,@DealNumber,@CustomerNumber,@DMSType,@ContractDate);
    END TRY
    BEGIN CATCH
         SELECT
            @errornumber = ERROR_NUMBER()
            ,@errorseverity = ERROR_SEVERITY() 
            ,@errorstate = ERROR_STATE() 
            ,@errorprocedure = ERROR_PROCEDURE() 
            ,@errorline = ERROR_LINE()
            ,@errormessage = ERROR_MESSAGE();
           :r C:\Clients\BlackBook\BlackBookMarketing\Bharath\LOG_SALES_INSERT.sql
    @errornumber ,
                @errorseverity ,
                @errorstate,
                @errorprocedure,
                @errorline,
                @errormessage);
    END CATCH
    PRINT @errornumber;
    PRINT @errorseverity;
    PRINT @errorprocedure;
    PRINT @errorline;
    PRINT @errormessage;
    PRINT @errorstate;
    set @myerror = @@ERROR;
        -- This PRINT statement prints 'Error = 0' because
        -- @@ERROR is reset in the IF statement above.
        PRINT N'Error = ' + @myerror;
    set @SalesID = scope_identity();
    PRINT @SalesID;
    --================================================================================
    --Insert into SALES_TRADEIN Table
    BEGIN TRY
    INSERT INTO SALES_TRADEIN
    SalesID,
    TradeIn_VIN,
    TradeIn_Make,
    TradeIn_Model,
    TradeIn_ExteriorColor,
    TradeIn_Year,
    TradeIn_Mileage,
    TradeIn_Gross,
    TradeIn_Payoff,
    TradeIn_ACV,
    TradeIn_InteriorColor
    VALUES
    @SalesID,
    case when  @TradeIn_1_VIN is not null then @TradeIn_2_VIN end,
    case when  @TradeIn_1_Make is not null  then @TradeIn_2_Make end,
    case when  @TradeIn_1_Model is not null  then @TradeIn_2_Model end,
    case when  @TradeIn_1_ExteriorColor is not null  then @TradeIn_2_ExteriorColor end,
    case when @TradeIn_1_Year is not null  then @TradeIn_2_Year end,
    case when  @TradeIn_1_Mileage is not null  then @TradeIn_2_Mileage end,
    case when @TradeIn_1_Gross is not null  then @TradeIn_2_Gross end,
    case when @TradeIn_1_Payoff is not null  then @TradeIn_2_Payoff end,
    case when @TradeIn_1_ACV is not null  then @TradeIn_2_ACV end,
    case when  @TradeIn_1_InteriorColor is not null  then @TradeIn_2_InteriorColor end
    END TRY
    BEGIN CATCH
    SELECT
            @errornumber = ERROR_NUMBER()
            ,@errorseverity = ERROR_SEVERITY() 
            ,@errorstate = ERROR_STATE() 
            ,@errorprocedure = ERROR_PROCEDURE() 
            ,@errorline = ERROR_LINE()
            ,@errormessage = ERROR_MESSAGE();
          :r C:\Clients\BlackBook\BlackBookMarketing\Bharath\LOG_SALES_INSERT.sql
    END CATCH

    This is what I've understood from your question. You want to replace @TradeIn_2_VIN value if @TradeIn_1_VIN
    is NULL, else the value of @TradeIn_1_VIN.
    If this is the requirement then, your CASE statement is missing ELSE part. You can re-write this as below
    case when  @TradeIn_1_VIN is null then @TradeIn_2_VIN
    ELSE @TradeIn_1_VIN end,
    or simply you can replace the CASE statement with the below
    COALESCE function,
    COALESCE(@TradeIn_1_VIN, @TradeIn_2_VIN),
    Krishnakumar S

  • Urgent:-Values are not inserted into the custom table

    Hi, I am inserting the data from the custom OAF form into a custom table. Only the WHO columns are populated into the table but no field value is populated into the custom table. I have written the following code -
    In CO
    if (pageContext.getParameter("Continue") != null)
    OAApplicationModule am = pageContext.getRootApplicationModule();
    OAViewObject CwkInfo = (OAViewObject)am.findViewObject("CWKInfoVO1");
    am.invokeMethod("initializevo");
    in AM
    public void initializevo()
    CWKInfoVOImpl testVo = (CWKInfoVOImpl) this.getCWKInfoVO1();
    testVo.insertRow(testVo.createRow());
    getTransaction().commit();
    Urgent Help is required.
    Regards,
    Ashish

    Hi Ashish,
    Double check whether you have attached the correct EO based VO attribute to the columns.
    In the Controller
    Process Request use the following code:-
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (!pageContext.isFormSubmission())
    am.invokeMethod("initQuery", null);
    ProcessForm Request
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    System.out.println("Inside Process Form Request");
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("submitButton")!=null)
    am.invokeMethod("submit")
    AM Code
    public void initQuery()
    OAViewObject vvo = (OAViewObject)getEmployeeEOVO1();//Give you EO based VO Name
    if (!vvo.isPreparedForExecution())
    vvo.executeQuery();
    Row row = vvo.createRow();
    vvo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    public void submit()
    getTransaction().commit();
    Import necessage classes.
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • The record is not added into the table.

    Hi,
    I am new to Hibernate.
    I have contact.hbm.xml
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping>
    <class name="Contact" table="CONTACT">
    <id name="id" type="string" column="ID" >
    <generator class="assigned"/>
    </id>
    <property name="firstName">
    <column name="FIRSTNAME" />
    </property>
    <property name="lastName">
    <column name="LASTNAME"/>
    </property>
    <property name="email">
    <column name="EMAIL"/>
    </property>
    </class>
    </hibernate-mapping>
    And I have hibernate.cfg.xml
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
    <session-factory>
    <property name="hibernate.connection.driver_class">sun.jdbc.odbc.JdbcOdbcDriver</property>
    <property name="hibernate.connection.url">jdbc:odbc:test</property>
    <property name="hibernate.connection.username"></property>
    <property name="hibernate.connection.password"></property>
    <property name="hibernate.connection.pool_size">10</property>
    <property name="show_sql">true</property>
    <!-- <property name="dialect">org.hibernate.dialect.MySQLDialect</property> -->
    <property name="dialect">com.hxtt.support.hibernate.HxttAccessDialect</property>
    <property name="hibernate.hbm2ddl.auto">update</property>
    <!-- Mapping files -->
    <mapping resource="contact.hbm.xml"/>
    </session-factory>
    </hibernate-configuration>
    And my client program to add a record into the table is as follows..
    File f=new File("..src/com/hibernateaction/chapter01/hello/hibernate.cfg.xml");
    Configuration cfg = new Configuration().addFile(f);
    Iterator itr=cfg.getClassMappings();
    while(itr.hasNext())
         System.out.println("V="+itr.next());
    SessionFactory sessionFactory = cfg.configure().buildSessionFactory();
    session =sessionFactory.openSession();
    System.out.println("Inserting Record");
    Contact contact = new Contact();
    contact.setId("3");
    contact.setFirstName("Senniappan");
    contact.setLastName("Gounder");
    contact.setEmail("[email protected]");
    session.save(contact);
    System.out.println("Done");
    session.flush();
    session.close();
    The output displayed as "Done" and "Hibernate: insert into CONTACT (FIRSTNAME, LASTNAME, EMAIL, ID) values (?, ?, ?, ?) ".
    But there is no record is added into the DB.
    Kindly help in this regards.

    I used transaction.commit() it workd fine. Thanks Balu.
    My query is, is it necessary to start a transaction to add a single row into the table? Could u brief about this implementation?

  • Why I can not insert into a table?

    Hi, all,
    I have a table "personstudy" with records already. Its primary key is "subjectid". and I have added a new column named "personstatus" varchar2(20) to it. After that, I want to insert into the field with "enrolled" for all records there. My script is like this:
    insert into personstudy (personstatus) values ('enrolled');
    the system reports:
    ERROR at line 1:
    ORA-01400: cannot insert NULL into ("FLOWLIMS"."PERSONSTUDY"."SUBJECTID")
    I just can not understand it. Is there any wrong with my script?
    Thank you!
    Qian

    maybe want you need is not insert a new rows but to update the existing records to have the 'enrolled' value put into the column personstatus.
      update personstudy
         set personstatus = 'enrolled';

  • Taking More Time while inserting into the table (With foriegn key)

    Hi All,
    I am facing problem while inserting the values into the master table.
    The problem,
    Table A -- User Master Table (Reg No, Name, etc)
    Table B -- Transaction Table (Foreign key reference with Table A).
    While inserting the data's in Table B, i need to insert the reg no also in table B which is mandatory. I followed the logic which is mentioned in the SRDemo.
    While inserting we need to query the Table A first to have the values in TableABean.java.
    final TableA tableA= (TableA )uow.executeQuery("findUser",TableA .class, regNo);
    Then, we need to create the instance for TableB
    TableB tableB= (TableB)uow.newInstance(TableB.class);
    tableB.setID(bean.getID);
    tableA.addTableB(tableB); --- this is for to insert the regNo of TableA in TableB.. This line is executing the query "select * from TableB where RegNo = <tableA.getRegNo>".
    This query is taking too much time if values are more in the TableB for that particular registrationNo. Because of this its taking more time to insert into the TableB.
    For Ex: TableA -- regNo : 101...having less entry in TableB means...inserting record is taking less than 1 sec
    regNo : 102...having more entry in TableB means...inserting record is taking more than 2 sec
    Time delay is there for different users when they enter transaction in TableB.
    I need to avoid this since in future it will take more time...from 2 sec to 10 sec, if volume of data increases mean.
    Please help me to resolve this issue...I am facing it now in production.
    Thanks & Regards
    VB

    Hello,
    Looks like you have a 1:M relationship from TableA to TableB, with a 1:1 back pointer from TableB to TableA. If triggering the 1:M relationship is causing you delays that you want to avoid there might be two quick ways I can see:
    1) Don't map it. Leave the TableA->TableB 1:M unmapped, and instead just query for relationship when you do need it. This means you do not need to call tableA.addTableB(tableB), and instead only need to call tableB.setTableA(tableA), so that the TableB->TableA relation gets set. Might not be the best option, but it depends on your application's usage. It does allow you to potentially page the TableB results or add other query query performance options when you do need the data though.
    2) You are currently using Lazy loading for the TableA->TableB relationship - if it is untriggered, don't bother calling tableA.addTableB(tableB), and instead only need to call tableB.setTableA(tableA). This of course requires using TopLink api to a) verify the collection is an IndirectCollection type, and b) that it is hasn't been triggered. If it has been triggered, you will still need to call tableA.addTableB(tableB), but it won't result in a query. Check out the oracle.toplink.indirection.IndirectContainer class and it's isInstantiated() method. This can cause problems though in highly concurrent environments, as other threads may have triggered the indirection before you commit your transaction, so that the A->B collection is not up to date - this might require refreshing the TableA if so.
    Change tracking would probably be the best option to use here, and is described in the EclipseLink wiki:
    http://wiki.eclipse.org/Introduction_to_EclipseLink_Transactions_(ELUG)#Attribute_Change_Tracking_Policy
    Best Regards,
    Chris

  • Records not displayed on the table view

    We have a scenario as follows :
    I am working on webdynpro project in which i have table on one of my second view.
    when i insert a records in the table by entering its values from the Form on the startView,  it is being shown as populated on the table.
    But once I insert my second record(s) also, the first or the previous records are not visible once i click on the display button.
    Can anyone help me to solve my problem as to how to see all the records inserted in the table on this view.
    Also plz let me know how to physically check the records on the database side.I am using the dictionary tables as my datasource and using SAPDB database.
    Thanx in advance..

    hi
    Try this code.
    Node-->Person
    Attributes of Person-->FirstName,LastName(String)
    ComponentController-->FirstCompController
    FirstView:
    onActionDisplay(...){
    String fname= wdContext.nodePerson().currentPersonElement().getFirstName();
    String lname=wdContext.nodePerson().currentPersonElement().getLastName();
       wdThis.wdGetFirstCompController().wdGetContext().nodePerson().currentPersonElement().setFirstName(fname);
       wdThis.wdGetFirstCompController().wdGetContext().nodePerson().currentPersonElement().setLastName(lname);
        wdThis.wdFirePlugOut1();
    SecondView:
    onPlug<plugname>(..)
    String fname=wdThis.wdGetFirstCompController().wdGetContext().nodePerson().currentPersonElement().getFirstName();
      String lname=wdThis.wdGetFirstCompController().wdGetContext().nodePerson().currentPersonElement().getLastName();
       IPrivateSecondView.IPersonElement elem=wdContext.nodePerson().createPersonElement();
       elem.setFirstName(fname);
       elem.setLastName(lname);
       wdContext.nodePerson().addElement(elem);
    you have to do navigationlinks from FirstView to SecondView and viceversa and also context mapping between ComponentController and views.
    In the second view also create actionbutton for navigating to the firstview and
    Fire the oubound plug also.
    Regards
    sowmya.

  • Invalid record not going into E$ table

    Hi,
    I am using Oracle as source and target but source and target table is on different database.lets say
    base table EMP_SRC table --> ABC database
    fact table EMP_TRG table --> XYZ database
    and some dimension table are also in XYZ Database. and all FK constraint are there in fact table.
    I created one interface in which on source dataset i drag base table and dimension table for lookup and join the code columns with base table code and on target side i am populating keys and measures value correspondence the  base table data which matched with dim table.
    I am using KM
    LKM SQL to SQL
    IKM SQL incremental update
    Option:
    Flow control : true
    CKM SQL
    when i run the Interface it is getting successful with valid records but in base table there is some invalid record also which is not going into E$ table
    why it is happening ? did I miss something ? Please help me
    Thanks.

    I am doing little modification here
    BASE_DATA:
    RSN_CODE
    QUANTITY
    DATA_DIM:
    ID_RSN (PK)
    RSN_CODE
    your join need to be BASE_DATA.RSN_CODE = DATA_DIM.RSN_CODE(+)
    your target table will have as mapping
    TGT_DIM:
    ID_RSN (PK): DATA_DIM.ID_RSN
    QUANTITY: BASE_DATA.QUANTITY
    Now
    Base_Data
    RSN_CODE       Quantity
    1A                    120
    1B                    260
    1C                     130
    1E                    300
    DATA_DIM
    ID_RSN          RSN_CODE
    1                    1A
    2                     1B
    3                    1C
    4                    1D
    ------------------------------OK--------------------------
    After execution
    TGT_DIM
    ID_RSN          QUANTITY
    1                    120
    2                    260
    3                    130
    and in E$ table
    ODI_ROW_ID    :    F                   
    ODI_ERR_MESS  :   ODI-15066: The column ID_RSN cannot be null.
    ODI_CHECK_DATE  :   24-JUL-13
    RSN_CODE   :    (null)
    Quantity       : 300
    ---------------------OK----------------------------------
    but I want in E$ table consist following result
    ODI_ROW_ID    :    F                   
    ODI_ERR_MESS  :   ODI-15066: The column ID_RSN cannot be null.
    ODI_CHECK_DATE  :   24-JUL-13
    RSN_CODE   :    1E  
      Quantity       : 300
    Thanks

  • Insert into other table from form

    Hi All,
    I have created a data block with view as a data source. I need to save the data from a form to some other table.
    I have tried using INSTEAD OF Trigger. howeverwhen I try to save, getting an error : ORA-01445 cannot select ROWID from a join view without a key-preserved table.
    I appreciate any suggestions on it.
    Thanks and Regards
    Sai

    Sorry, it looked at first as if you wanted help on the problem you encountered. After reading again your response to Zaibiman I see that you were just tricking us with the detailed explanation of the error.
    To insert into a table other than the one you queried, use the on-insert trigger.
    However, an Instead Of trigger on the view is usually the best method. If you have set the key mode, defined a primary key item and removed any references to rowid, as per Zaibiman, then it should work. You'll need your own locking method if the view uses Group By or Distinct.

  • Rows are not inserted in the order entered - Forms 4.5 to 9i database

    hi
    we are using forms 4.5 version with 9i oracle database.
    when we save a multi-record block (for eg 5 rows)
    the records are not inserted in the database in the
    order in which they are entered.
    for eg if we enter A,B,C,D,E Records and save
    on query the records appearing in the order of C,D,E
    A,B like that.
    Is there any database parameter or setting which
    effects the order of inserting rows in the database(when using forms 4.5).
    Pls inform if you have any solution.
    Thanks in advance
    cks

    This is a very common misconception.
    You should never concern yourself about the order in which rows are stored in the database. Oracle does not guarantee to return rows in any particular order so you must specify an order by clause when you select the rows.
    Without an order by clause, there are various reasons why the order of selected rows could change in different circumstances, and the order in which they are stored should be treated as irrelevant.

  • When inserting 3 column details in a single table using Stored Procedure.Only 1 Column details getting inserted.Other 2 Column details are not getting into the table.Please see the below script and help me to change.

    From the Parent Table i need to insert rows which are all under this column {(TradeIn_1_VIN),(TradeIn_2_VIN),(TradeIn_3_VIN) } into SALES_TRADEIN Table .
    I have used the below Query,
    But it reads only (TradeIn _1_Vin) Column in the SALES_TRADEIN table rest 2 records got skipped..
    INSERT INTO SALES_TRADEIN
    SalesID,
    TradeIn_VIN,
    TradeIn_Make,
    TradeIn_Model,
    TradeIn_ExteriorColor,
    TradeIn_Year,
    TradeIn_Mileage,
    TradeIn_Gross,
    TradeIn_Payoff,
    TradeIn_ACV,
    TradeIn_InteriorColor
    VALUES
    @SalesID,
    case when @TradeIn_1_VIN is null then @TradeIn_2_VIN else @TradeIn_1_VIN end,
    case when @TradeIn_1_Make is null then @TradeIn_2_Make else @TradeIn_1_Make end,
    case when @TradeIn_1_Model is null then @TradeIn_2_Model else @TradeIn_1_Model end,
    case when @TradeIn_1_ExteriorColor is null then @TradeIn_2_ExteriorColor else @TradeIn_1_ExteriorColor end,
    case when @TradeIn_1_Year is null then @TradeIn_2_Year else @TradeIn_1_Year end,
    case when @TradeIn_1_Mileage is null then @TradeIn_2_Mileage else @TradeIn_1_Mileage end,
    case when @TradeIn_1_Gross is null then @TradeIn_2_Gross else @TradeIn_1_Gross end,
    case when @TradeIn_1_Payoff is null then @TradeIn_2_Payoff else @TradeIn_1_Payoff end,
    case when @TradeIn_1_ACV is null then @TradeIn_2_ACV else @TradeIn_1_ACV end,
    case when @TradeIn_1_InteriorColor is null then @TradeIn_2_InteriorColor else @TradeIn_1_InteriorColor end
    END TRY
    Actually my problem is
     If  [(TradeIn_1_VIN),(TradeIn_2_VIN),(TradeIn_3_VIN)] these 3 columns have details i need all the 3 columns  details need to be read to SALES_TRADEIN table.
    Suppose if we have data only in [(TradeIn_1_VIN),(TradeIn_2_VIN)] then these column details need to loaded in the SALES_TRADEIN table.
    If any columns are blank no problem it can move next process.
    Please help me change those particular lines to insert all the 3 records  (TradeIn_1_VIN) (TradeIn_2_VIN) (TradeIn_3_VIN) in to the table.

    From SQL2008 on, besides INSERT-SELECT, and INSERT-EXEC, the INSERT-VALUES form of the insert command is improved. It can insert multiple rows like this:
    INSERT INTO my_table(MyColA, MyColB)
    VALUES
    (1, 1),
    (2, 2),
      (3, 3)
    You could also use that in SELECTs, like this:
    SELECT *
    FROM
    (    VALUES (1,2), (3,4)
    ) t(a, b)

Maybe you are looking for

  • Mass update of huge list of Material master records

    Hi dudes, I want to update 1 field for the huge list of  material master record, i.e., statistics field in sales org 2 tab. please help regards, madhav

  • Issue regarding picking.

    Hi, I have a question, Please clarify it according to ur convenience. I have 2 scenarios in at my client's place. General orders and sample orders. General orders are using Warehouse Mgmt and Sample Orders are Inventory managed. Both orders share the

  • Invalid SQL

    Post Author: Jon80 CA Forum: Desktop Intelligence Reporting The following SQL Statement was generated by BI Desktop Intelligence whilst I was trying to retrieve data that retrieves data WHERE TRS_ACTIVITY.TIME_ALLOCATED = 1 as well as TRS_ACTIVITY.TI

  • FCE Compatibility with AVCHD Format

    Does anyone know if Apple has announced, or if we should otherwise expect, updates for FCE or FCP to be compatible with the AVCHD format a few newer cameras are starting to use?

  • Adobe Reader 8.1.2 Installation Error(error code: 1406)

    When i install the Adobe Reader, it appear the error and said it cannot have right to write the reg-key {5F226421-451D-408D-9A09-0DCD94E25B48} But i am using the local admin a/c to install, so just want to find some help to look for the reason and so