Child table console error

Hi,
i am developing a custom connector for OIM 11g. I have defined a main form and its associated child form to add user to groups. I have also defined a simple task that on group add prints to console the child key of the child process form instance. To make it clearer, each time i do an add, it will print the key of the added data in the child process form instance.
Now, when i do a group add, i get the child key as expected, but also this message error
<28-dic-2010 11.28.16 CET> <Error> <XELLERATE.APIS> <BEA-000000> <tcFormInstanceOperationsBean/isProcessFormChildDataDataUnique: no PRF isKey set up for sdk:26>
i've searched in metalink but found nothing. To build the child form, i've looked closely at the groups child form in the AD connector.
Any ideas?
thx in advance

Please check that you have performed next steps “Mapping a Single Value Field” and “Mapping a Single Value Field” of the “10.3.2.3.2 Mapping a Target Resource Field to Oracle Identity Manager ” chapter in the “Developer's Guide for Oracle Identity Manager 11g”.

Similar Messages

  • Truncating table throws error although no child record exists

    I have 2 tables
    table_master (This is master table)
    table_child (This is child table)
    truncate table table_child ;
    the above executes properly
    BUT
    truncate table table_master;
    ERROR at line 1:
    ORA-02266: unique/primary keys in table referenced by enabled foreign keys
    Although there is no child record even though the above error is occuring.Please sove my problem.

    Hi,
    >>lthough there is no child record even though the above error is occuring.Please sove my problem.
    In fact, doesn't matter if child table contain or not data.
    LEGATTI> create table a (id number primary key);
    Table created.
    LEGATTI> create table b (id number constraint fk_b_a references a);
    Table created.
    LEGATTI> truncate table a;
    truncate table a
    ERROR at line 1:
    ORA-02266: unique/primary keys in table referenced by enabled foreign keys
    LEGATTI> alter table b disable constraint fk_b_a;
    Table altered.
    LEGATTI> truncate table a;
    Table truncated.
    -- In addition, in order to drop the parent table, just disable the constraint's child table is not sufficient.
    LEGATTI> select constraint_name,status from user_constraints where table_name='B';
    CONSTRAINT_NAME                STATUS
    FK_B_A                         DISABLED
    LEGATTI> drop table a;
    drop table a
    ERROR at line 1:
    ORA-02449: unique/primary keys in table referenced by foreign keys
    LEGATTI> drop table a cascade constraints;
    Table dropped.
    LEGATTI> select * from user_constraints where table_name='B';
    no rows selectedCheers
    Legatti

  • OIM: Getting an error when trying to add entry into child table

    Hi OIM Guru,
    I have a process form and child table I am using for provisionng. Everthing was working so far, but suddenly I am getting the following error whenever I try to add an entry into the child table. I
    Can someone tell me what might be going on here?
    Thanks a lot
    tcFormInstanceOperationsBean/addProcessFormChildData encounter some problems: maoErrors:Cannot schedule a task for child table change, schedule item save failed
    tcFormInstanceOperationsBean/addProcessFormChildData encounter some problems: Cannot schedule a task for child table change, schedule item save failed
    Thor.API.Exceptions.tcAPIException: Cannot schedule a task for child table change, schedule item save failed
    at com.thortech.xl.ejb.beansimpl.tcFormInstanceOperationsBean.addProcessFormChildData(Unknown Source)
    at com.thortech.xl.ejb.beansimpl.tcFormInstanceOperationsBean.addProcessFormChildData(Unknown Source)
    at com.thortech.xl.ejb.beans.tcFormInstanceOperationsSession.addProcessFormChildData(Unknown Source)
    at com.thortech.xl.ejb.beans.tcFormInstanceOperations_2j82mm_EOImpl.addProcessFormChildData(tcFormInstanceOperations_2j82mm_EOImpl.java:1298)
    at com.thortech.xl.ejb.beans.tcFormInstanceOperations_2j82mm_EOImpl_CBV.addProcessFormChildData(Unknown Source)
    at Thor.API.Operations.tcFormInstanceOperationsClient.addProcessFormChildData(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.security.Security.runAs(Security.java:41)
    at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Source)

    Never mind. I got it figured out.
    What happened is I changed my adapter that is being called and because of this change the task mappings in Process Definition got wiped out and I had to remap all the attributes again. It now works.
    Whew!! It took me a while to figure this out.
    Thanks

  • Retrieving all FK from child table in a resultset

    I have a parent and its child table.In child table there are many records containing the same PK of the parent as a foreign key(one to many relationship).Now how can I get all those values (in a resultset) of child table containing the same FK .The code i produced can fetch the first record of the same PK of the parent.But how can I get all with a single SQl statement and iterate through them as necessary.
    String sql1="SELECT * FROM ChildTableName WHERE id= ' 100 ' ; //100 is the PK of Parent table // there are many records in Child Table having 100 as foreign key resultset = statement.executeQuery(sql1); resultset .next();      try{          System.out.println("Data> "+resultset.getString(1));         System.out.println("Data> "+resultset.getString(2));         System.out.println("Data> "+resultset.getString(3));   }catch(SQLException sqle){System.out.println("ERROR REFRESH : " + sqle); }{code} Edited by: Tanvir007 on Apr 17, 2008 4:35 AM Edited by: Tanvir007 on Apr 17, 2008 4:37 AM Edited by: Tanvir007 on Apr 17, 2008 4:40 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    duffymo wrote:
    First of all,ARE U BLIND brother, didn't you see what I wrote-
    String sql= "SELECT Flat_Rent.rent_id,Flat_Rent.flat_name FROM Month_Rent INNER JOIN Flat_Rent ON Month_Rent.rent_id = Flat_Rent.rent_id WHERE Flat_Rent.rent_id = '4-2008'" ;      
    Actually, I did see that. It makes me wonder why you were asking in the first place and what the problem is now.In the first place, I didnt use join,I did it later as u advised.But u asked me later about the join.Why?
    >
    People who have empty catch blocks are fools. If you don't want to be one, log or print the stack trace. It's good information to have, and it'll help you avoid problems in the future.People are fools for many reasons LIKE - even if I told u that I can retrieve record (but only the first record),there is no question of throwing an exception.And I DID fill catch block in the first place,look back.Later, it wasnt that much necessary bcos no exception throws at all.
    However brother many thanks for an attempt to help me.I think I have solved the problem-
    try{
    String sql= "SELECT flat_name,flat_rent,elec_bill FROM Month_Rent INNER JOIN Flat_Rent ON Month_Rent.rent_id = Flat_Rent.rent_id WHERE Flat_Rent.rent_id = '4-2008'" ;      
                             resultset = statement.executeQuery(sql);               
                             resultset .next();
                             do
                                  System.out.println("Flat Name>> " + resultset .getString(1));
                                  System.out.println("Rent>> " + resultset .getString(2));
                                  System.out.println("Elec Bill>> " + resultset .getString(3));
                             while(rs.next());
                        }catch(SQLException sqle){ sqle.printStackTrace();           }But the problem is, The fields in my DB are in this serial- rent_id,flat_name,flat_rent,elec_reading,elec_bill,total_rent,status
    But as you can see from the code that I get the Flat name in 1,Rent in 2 and bill in 3 which should be 2,3,5 respectively.Can you tell me why it is so?

  • How to delete the duplicate rows present in the parent table & insert the latest duplicate record into the parent table linked with the child table.

    I have a master table and i need to import the rows into the parent and child table.
    Master table name is Flatfile_Inventory
    Parent Table name is INVENTORY
    Child Tables name are INVENTORY_AMOUNT,INVENTORY_DETAILS,INVENTORY_VEHICLE,
    Error details will be goes to LOG_INVENTORY_ERROR
    I have 4 duplicate rows in the Flatfile_Inventory which i have already inserted in the Parent and child table.
    Again when i run the query using stored procedure,
    its tells that all the 4 rows are duplicate and will move to the Log_Inventory_Error.
    I need is if i have the duplicate rows in the flatfile_Inventory when i start inserting into the parent and child table the already inserted row have the unique ID i
    must identify it and delete that row in the both parent and chlid table.And latest row must get inserted into the Parent and child table from Flatfile_Inventory.
    Please help me to write the query i have attached the Full stored procedure Script..
    Arunraj Kumar

    Hi Santhosh,
    This is my Script.
    -- =============================================
    -- Stored Procedure for FLATFILE_INVENTORY
    -- =============================================
    -- Drop stored procedure if it already exists
       DROP PROCEDURE SP_Flatfile_Inventory
    GO
    CREATE PROCEDURE SP_Flatfile_Inventory
    AS
    --USE IconicMarketing
    GO
    DECLARE
    @FileType  varchar(50)  ,
    @ACDealerID  varchar(50)  ,
    @ClientDealerID  varchar(50)  ,
    @DMSType  varchar(50)  ,
    @StockNumber  varchar(50)  ,
    @InventoryDate  datetime  ,
    @StockType  varchar(100)  ,
    @DMSStatus  varchar(50)  ,
    @InvoicePrice  numeric(18, 2)  ,
    @CostPack  varchar(50)  ,
    @SalesCost  numeric(18, 2)  ,
    @HoldbackAmount  numeric(18, 2)  ,
    @ListPrice  numeric(18, 2)  ,
    @MSRP  varchar(max)  ,
    @LotLocation  varchar(50)  ,
    @TagLine  varchar(max)  ,
    @Certification  varchar(max)  ,
    @CertificationNumber  varchar(max)  ,
    @VehicleVIN  varchar(50)  ,
    @VehicleYear  bigint  ,
    @VehicleMake  varchar(50)  ,
    @VehicleModel  varchar(50)  ,
    @VehicleModelCode  varchar(50)  ,
    @VehicleTrim  varchar(50)  ,
    @VehicleSubTrimLevel  varchar(max)  ,
    @Classification  varchar(max)  ,
    @TypeCode  varchar(100)  ,
    @VehicleMileage  bigint  ,
    @EngineCylinderCount  bigint  ,
    @TransmissionType  varchar(50)  ,
    @VehicleExteriorColor  varchar(50)  ,
    @VehicleInteriorColor  varchar(50)  ,
    @CreatedDate  datetime  ,
    @LastModifiedDate  datetime  ,
    @ModifiedFlag  varchar(max)  ,
    @InteriorColorCode  varchar(50)  ,
    @ExteriorColorCode  varchar(50)  ,
    @PackageCode  varchar(50)  ,
    @CodedCost  varchar(50)  ,
    @Air  varchar(100)  ,
    @OrderType  varchar(max)  ,
    @AgeDays  bigint  ,
    @OutstandingRO  varchar(50)  ,
    @DlrAccessoryRetail  varchar(50)  ,
    @DlrAccessoryCost  varchar(max)  ,
    @DlrAccessoryDesc  varchar(max)  ,
    @ModelDesc  varchar(50)  ,
    @Memo1  varchar(1000)  ,
    @Memo2  varchar(max)  ,
    @Weight  varchar(max)  ,
    @FloorPlan  numeric(18, 2)  ,
    @Purchaser  varchar(max)  ,
    @PurchasedFrom  varchar(max)  ,
    @InternetPrice  varchar(50)  ,
    @InventoryAcctDollar  numeric(18, 2)  ,
    @VehicleType  varchar(50)  ,
    @DealerAccessoryCode  varchar(50)  ,
    @AllInventoryAcctDollar  numeric(18, 2)  ,
    @BestPrice  varchar(50)  ,
    @InStock  bigint  ,
    @AccountingMake  varchar(50)  ,
    @GasDiesel  varchar(max)  ,
    @BookValue  varchar(10)  ,
    @FactoryAccessoryDescription  varchar(max)  ,
    @TotalReturn  varchar(10)  ,
    @TotalCost  varchar(10)  ,
    @SS  varchar(max)  ,
    @VehicleBody  varchar(max)  ,
    @StandardEquipment  varchar(max)  ,
    @Account  varchar(max)  ,
    @CalculatedPrice  varchar(10)  ,
    @OriginalCost  varchar(10)  ,
    @AccessoryCore  varchar(10)  ,
    @OtherDollar  varchar(10)  ,
    @PrimaryBookValue  varchar(10)  ,
    @AmountDue  varchar(10)  ,
    @LicenseFee  varchar(10)  ,
    @ICompany  varchar(max)  ,
    @InvenAcct  varchar(max)  ,
    @Field23  varchar(max)  ,
    @Field24  varchar(max)  ,
    @SalesCode  varchar(max)  ,
    @BaseRetail  varchar(10)  ,
    @BaseInvAmt  varchar(10)  ,
    @CommPrice  varchar(10)  ,
    @Price1  varchar(10)  ,
    @Price2  varchar(10)  ,
    @StickerPrice  varchar(10)  ,
    @TotInvAmt  varchar(10)  ,
    @OptRetail  varchar(max)  ,
    @OptInvAmt  varchar(10)  ,
    @OptCost  varchar(10)  ,
    @Options  varchar(max)  ,
    @Category  varchar(max)  ,
    @Description  varchar(max)  ,
    @Engine  varchar(max)  ,
    @ModelType  varchar(max)  ,
    @FTCode  varchar(max)  ,
    @Wholesale  varchar(max)  ,
    @Retail  varchar(max)  ,
    @Draft  varchar(max)  ,
    @Inventoryid int;
    DECLARE Inventory_Cursor CURSOR FOR 
    SELECT * from [dbo].[FLATFILE_INVENTORY];
    OPEN Inventory_Cursor
    FETCH NEXT FROM Inventory_Cursor 
    INTO @FileType   ,
    @ACDealerID     ,
    @ClientDealerID     ,
    @DMSType     ,
    @StockNumber     ,
    @InventoryDate    ,
    @StockType    ,
    @DMSStatus     ,
    @InvoicePrice     ,
    @CostPack     ,
    @SalesCost     ,
    @HoldbackAmount     ,
    @ListPrice     ,
    @MSRP     ,
    @LotLocation     ,
    @TagLine     ,
    @Certification     ,
    @CertificationNumber     ,
    @VehicleVIN     ,
    @VehicleYear     ,
    @VehicleMake     ,
    @VehicleModel     ,
    @VehicleModelCode     ,
    @VehicleTrim     ,
    @VehicleSubTrimLevel     ,
    @Classification     ,
    @TypeCode    ,
    @VehicleMileage     ,
    @EngineCylinderCount     ,
    @TransmissionType     ,
    @VehicleExteriorColor     ,
    @VehicleInteriorColor     ,
    @CreatedDate    ,
    @LastModifiedDate    ,
    @ModifiedFlag     ,
    @InteriorColorCode     ,
    @ExteriorColorCode     ,
    @PackageCode     ,
    @CodedCost     ,
    @Air    ,
    @OrderType     ,
    @AgeDays     ,
    @OutstandingRO     ,
    @DlrAccessoryRetail     ,
    @DlrAccessoryCost     ,
    @DlrAccessoryDesc     ,
    @ModelDesc     ,
    @Memo1 ,
    @Memo2     ,
    @Weight     ,
    @FloorPlan     ,
    @Purchaser     ,
    @PurchasedFrom     ,
    @InternetPrice     ,
    @InventoryAcctDollar     ,
    @VehicleType     ,
    @DealerAccessoryCode     ,
    @AllInventoryAcctDollar     ,
    @BestPrice     ,
    @InStock     ,
    @AccountingMake     ,
    @GasDiesel     ,
    @BookValue     ,
    @FactoryAccessoryDescription     ,
    @TotalReturn     ,
    @TotalCost     ,
    @SS     ,
    @VehicleBody     ,
    @StandardEquipment     ,
    @Account     ,
    @CalculatedPrice     ,
    @OriginalCost     ,
    @AccessoryCore     ,
    @OtherDollar     ,
    @PrimaryBookValue     ,
    @AmountDue     ,
    @LicenseFee     ,
    @ICompany     ,
    @InvenAcct     ,
    @Field23     ,
    @Field24     ,
    @SalesCode     ,
    @BaseRetail     ,
    @BaseInvAmt     ,
    @CommPrice     ,
    @Price1     ,
    @Price2     ,
    @StickerPrice     ,
    @TotInvAmt     ,
    @OptRetail     ,
    @OptInvAmt     ,
    @OptCost     ,
    @Options     ,
    @Category     ,
    @Description     ,
    @Engine     ,
    @ModelType     ,
    @FTCode     ,
    @Wholesale     ,
    @Retail     ,
    @Draft     ;
    WHILE @@FETCH_STATUS = 0
    BEGIN
        PRINT @VehicleVIN    ;
    -- ****************** insert into Inventory Table ***********
    INSERT INTO INVENTORY 
    IconicDealerID,
    StockNumber,
    DMSType,
    InventoryDate
    VALUES (@ClientDealerID,@StockNumber,@DMSType,@InventoryDate);
    set @Inventoryid = scope_identity();
    PRINT @Inventoryid;
    --Insert into Inventory_Details Table
    INSERT INTO [INVENTORY_DETAILS]
    InventoryID,
    StockType,
    DMSStatus,
    LotLocation,
    TagLine,
    Certification,
    CertificationNumber,
    CreatedDate,
    LastModifiedDate,
    ModifiedFlag,
    PackageCode,
    OrderType,
    AgeDays,
    OutstandingRO,
    Memo1,
    Memo2,
    Purchaser,
    PurchasedFrom,
    DealerAccessoryCode,
    InStock,
    AccountingMake,
    SS,
    Account,
    AccessoryCore,
    ICompany,
    InvenAcct,
    Field23,
    Field24,
    SalesCode,
    Draft,
    FTCode
    VALUES (
    @InventoryID,
    @StockType,
    @DMSStatus,
    @LotLocation,
    @TagLine,
    @Certification,
    @CertificationNumber,
    @CreatedDate,
    @LastModifiedDate,
    @ModifiedFlag,
    @PackageCode,
    @OrderType,
    @AgeDays,
    @OutstandingRO,
    @Memo1,
    @Memo2,
    @Purchaser,
    @PurchasedFrom,
    @DealerAccessoryCode,
    @InStock,
    @AccountingMake,
    @SS,
    @Account,
    @AccessoryCore,
    @ICompany,
    @InvenAcct,
    @Field23,
    @Field24,
    @SalesCode,
    @Draft,
    @FTCode
    --Insert into Inventory_Amount Table
    INSERT INTO [dbo].[INVENTORY_AMOUNT]
    InventoryID,
    AllInventoryAcctDollar,
    OtherDollar,
    PrimaryBookValue,
    AmountDue,
    LicenseFee,
    CalculatedPrice,
    OriginalCost,
    BookValue,
    TotalReturn,
    TotalCost,
    DlrAccessoryRetail,
    DlrAccessoryCost,
    DlrAccessoryDesc,
    InternetPrice,
    InventoryAcctDollar,
    BestPrice,
    Weight,
    FloorPlan,
    CodedCost,
    InvoicePrice,
    CostPack,
    SalesCost,
    HoldbackAmount,
    ListPrice,
    MSRP,
    BaseRetail,
    BaseInvAmt,
    CommPrice,
    Price1,
    Price2,
    StickerPrice,
    TotInvAmt,
    OptRetail,
    OptInvAmt,
    OptCost,
    Wholesale,
    Retail
    VALUES (
    @InventoryID,
    @AllInventoryAcctDollar,
    @OtherDollar,
    @PrimaryBookValue,
    @AmountDue,
    @LicenseFee,
    @CalculatedPrice,
    @OriginalCost,
    @BookValue,
    @TotalReturn,
    @TotalCost,
    @DlrAccessoryRetail,
    @DlrAccessoryCost,
    @DlrAccessoryDesc,
    @InternetPrice,
    @InventoryAcctDollar,
    @BestPrice,
    @Weight,
    @FloorPlan,
    @CodedCost,
    @InvoicePrice,
    @CostPack,
    @SalesCost,
    @HoldbackAmount,
    @ListPrice,
    @MSRP,
    @BaseRetail,
    @BaseInvAmt,
    @CommPrice,
    @Price1,
    @Price2,
    @StickerPrice,
    @TotInvAmt,
    @OptRetail,
    @OptInvAmt,
    @OptCost,
    @Wholesale,
    @Retail
    --Insert into Inventory_Vehicle Table
    INSERT INTO [dbo].[INVENTORY_VEHICLE]
    InventoryID,
    InteriorColorCode,
    ExteriorColorCode,
    Air,
    ModelDesc,
    VehicleType,
    VehicleVIN,
    VehicleYear,
    VehicleMake,
    VehicleModel,
    VehicleModelCode,
    VehicleTrim,
    VehicleSubTrimLevel,
    Classification,
    TypeCode,
    VehicleMileage
    VALUES (
    @InventoryID,
    @InteriorColorCode,
    @ExteriorColorCode,
    @Air,
    @ModelDesc,
    @VehicleType,
    @VehicleVIN,
    @VehicleYear,
    @VehicleMake,
    @VehicleModel,
    @VehicleModelCode,
    @VehicleTrim,
    @VehicleSubTrimLevel,
    @Classification,
    @TypeCode,
    @VehicleMileage
    -- Move cursor to Next record 
        FETCH NEXT FROM Inventory_Cursor 
    INTO @FileType   ,
    @ACDealerID     ,
    @ClientDealerID     ,
    @DMSType     ,
    @StockNumber     ,
    @InventoryDate    ,
    @StockType    ,
    @DMSStatus     ,
    @InvoicePrice     ,
    @CostPack     ,
    @SalesCost     ,
    @HoldbackAmount     ,
    @ListPrice     ,
    @MSRP     ,
    @LotLocation     ,
    @TagLine     ,
    @Certification     ,
    @CertificationNumber     ,
    @VehicleVIN     ,
    @VehicleYear     ,
    @VehicleMake     ,
    @VehicleModel     ,
    @VehicleModelCode     ,
    @VehicleTrim     ,
    @VehicleSubTrimLevel     ,
    @Classification     ,
    @TypeCode    ,
    @VehicleMileage     ,
    @EngineCylinderCount     ,
    @TransmissionType     ,
    @VehicleExteriorColor     ,
    @VehicleInteriorColor     ,
    @CreatedDate    ,
    @LastModifiedDate    ,
    @ModifiedFlag     ,
    @InteriorColorCode     ,
    @ExteriorColorCode     ,
    @PackageCode     ,
    @CodedCost     ,
    @Air    ,
    @OrderType     ,
    @AgeDays     ,
    @OutstandingRO     ,
    @DlrAccessoryRetail     ,
    @DlrAccessoryCost     ,
    @DlrAccessoryDesc     ,
    @ModelDesc     ,
    @Memo1 ,
    @Memo2     ,
    @Weight     ,
    @FloorPlan     ,
    @Purchaser     ,
    @PurchasedFrom     ,
    @InternetPrice     ,
    @InventoryAcctDollar     ,
    @VehicleType     ,
    @DealerAccessoryCode     ,
    @AllInventoryAcctDollar     ,
    @BestPrice     ,
    @InStock     ,
    @AccountingMake     ,
    @GasDiesel     ,
    @BookValue     ,
    @FactoryAccessoryDescription     ,
    @TotalReturn     ,
    @TotalCost     ,
    @SS     ,
    @VehicleBody     ,
    @StandardEquipment     ,
    @Account     ,
    @CalculatedPrice     ,
    @OriginalCost     ,
    @AccessoryCore     ,
    @OtherDollar     ,
    @PrimaryBookValue     ,
    @AmountDue     ,
    @LicenseFee     ,
    @ICompany     ,
    @InvenAcct     ,
    @Field23     ,
    @Field24     ,
    @SalesCode     ,
    @BaseRetail     ,
    @BaseInvAmt     ,
    @CommPrice     ,
    @Price1     ,
    @Price2     ,
    @StickerPrice     ,
    @TotInvAmt     ,
    @OptRetail     ,
    @OptInvAmt     ,
    @OptCost     ,
    @Options     ,
    @Category     ,
    @Description     ,
    @Engine     ,
    @ModelType     ,
    @FTCode     ,
    @Wholesale     ,
    @Retail     ,
    @Draft     ;
    END 
    CLOSE Inventory_Cursor;
    DEALLOCATE Inventory_Cursor;
    GO
    SET ANSI_PADDING OFF
    GO
    Arunraj Kumar

  • SQL Server 2012 Management Studio:In the Database, how to print out or export the old 3 dbo Tables that were created manually and they have a relationship for 1 Parent table and 2 Child tables?How to handle this relationship in creating a new XML Schema?

    Hi all,
    Long time ago, I manually created a Database (APGriMMRP) and 3 Tables (dbo.Table_1_XYcoordinates, dbo.Table_2_Soil, and dbo.Table_3_Water) in my SQL Server 2012 Management Studio (SSMS2012). The dbo.Table_1_XYcoordinates has the following columns: file_id,
    Pt_ID, X, Y, Z, sample_id, Boring. The dbo.Table_2_Soil has the following columns: Boring, sample_date, sample_id, Unit, Arsenic, Chromium, Lead. The dbo.Table_3_Water has the following columns: Boring, sample_date, sample_id, Unit, Benzene, Ethylbenzene,
    Pyrene. The dbo.Table_1_XYcoordinates is a Parent Table. The dbo.Table_2_Soil and the dbo.Table_3_Water are 2 Child Tables. The sample_id is key link for the relationship between the Parent Table and the Child Tables.
    Problem #1) How can I print out or export these 3 dbo Tables?
    Problem #2) If I right-click on the dbo Table, I see "Start PowerShell" and click on it. I get the following error messages: Warning: Failed to load the 'SQLAS' extension: An exception occurred in SMO while trying to manage a service. 
    --> Failed to retrieve data for this request. --> Invalid class.  Warning: Could not obtain SQL Server Service information. An attemp to connect to WMI on 'NAB-WK-02657306' failed with the following error: An exception occurred in SMO while trying
    to manage a service. --> Failed to retrieve data for this request. --> Invalid class.  .... PS SQLSERVER:\SQL\NAB-WK-02657306\SQLEXPRESS\Databases\APGriMMRP\Table_1_XYcoordinates>   What causes this set of error messages? How can
    I get this problem fixed in my PC that is an end user of the Windows 7 LAN System? Note: I don't have the regular version of Microsoft Visual Studio 2012 in my PC. I just have the Microsoft 2012 Shell (Integrated) program in my PC.
    Problem #3: I plan to create an XML Schema Collection in the "APGriMMRP" database for the Parent Table and the Child Tables. How can I handle the relationship between the Parent Table and the Child Table in the XML Schema Collection?
    Problem #4: I plan to extract some results/data from the Parent Table and the Child Table by using XQuery. What kind of JOIN (Left or Right JOIN) should I use in the XQuerying?
    Please kindly help, answer my questions, and advise me how to resolve these 4 problems.
    Thanks in advance,
    Scott Chang    

    In the future, I would recommend you to post your questions one by one, and to the appropriate forum. Of your questions it is really only #3 that fits into this forum. (And that is the one I will not answer, because I have worked very little with XSD.)
    1) Not sure what you mean with "print" or "export", but when you right-click a database, you can select Tasks from the context menu and in this submenu you find "Export data".
    2) I don't know why you get that error, but any particular reason you want to run PowerShell?
    4) If you have tables, you query them with SQL, not XQuery. XQuery is when you query XML documents, but left and right joins are SQL things. There are no joins in XQuery.
    As for left/right join, notice that these two are equivalent:
    SELECT ...
    FROM   a LEFT JOIN b ON a.col = b.col
    SELECT ...
    FROM   b RIGHT JOIN a ON a.col = b.col
    But please never use RIGHT JOIN - it gives me a headache!
    There is nothing that says that you should use any of the other. In fact, if you are returning rows from parent and child, I would expect an inner join, unless you want to cater for parents without children.
    Here is an example where you can study the different join types and how they behave:
    CREATE TABLE apple (a int         NOT NULL PRIMARY KEY,
                        b varchar(23) NOT NULL)
    INSERT apple(a, b)
       VALUES(1, 'Granny Smith'),
             (2, 'Gloster'),
             (4, 'Ingrid-Marie'),
             (5, 'Milenga')
    CREATE TABLE orange(c int        NOT NULL PRIMARY KEY,
                        d varchar(23) NOT NULL)
    INSERT orange(c, d)
       VALUES(1, 'Agent'),
             (3, 'Netherlands'),
             (4, 'Revolution')
    SELECT a, b, c, d
    FROM   apple
    CROSS  JOIN orange
    SELECT a, b, c, d
    FROM   apple
    INNER  JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    LEFT   OUTER JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    RIGHT  OUTER JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    FULL OUTER JOIN orange ON apple.a = orange.c
    go
    DROP TABLE apple, orange
    Erland Sommarskog, SQL Server MVP, [email protected]

  • View cluster table child table calling problem!

    Hi All,
    I have created a cluster table with one table as header and one as item...
    Header table : ZRAJ1
    ITEM TABLE : ZRAJ2
    ZRAJ1 :
    ZPRODUCT
    ZPROD_DESC
    ZSTATUS
    ZUSER
    ZRAJ2:
    ZPRODUCT
    ZLABEL
    This clearly shows that zraj2 is depending on ZRAJ1.
    Created a cluster with these two tables.
    Also, created events for ZRAJ1.
    EVENT 05:
    FORM create_entry.
      yraj1-zuser = sy-uname.
    ENDFORM.
    EVENT 02:
    FORM after_save.
      IF yraj1-zstatus = 'L'.
        CALL TRANSACTION 'ZRAJ_VIEW'.
      ENDIF.
    ENDFORM.
    If the Zstatus is "L" in ZRAJ1, a new transaction will be called to maintain the child table zraj2.
    Trasnaction 'ZRAJ_VIEW'.
    REPORT 'ZRAJ_VIEW'.
    INITIALIZATION.
    *declaration:
      DATA : itab LIKE vimsellist OCCURS 0 WITH HEADER LINE.
    START-OF-SELECTION.
    *To call the MAintanence screen directly through the program:
      CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
        EXPORTING
          action                               = 'S'
      CORR_NUMBER                          = ' '
      GENERATE_MAINT_TOOL_IF_MISSING       = ' '
      SHOW_SELECTION_POPUP                 = ' '
          view_name                            = 'YRAJ2'
      NO_WARNING_FOR_CLIENTINDEP           = ' '
      RFC_DESTINATION_FOR_UPGRADE          = ' '
      CLIENT_FOR_UPGRADE                   = ' '
      VARIANT_FOR_SELECTION                = ' '
      COMPLEX_SELCONDS_USED                = ' '
       TABLES
          dba_sellist                          = itab
      EXCL_CUA_FUNCT                       =
    EXCEPTIONS
      CLIENT_REFERENCE                     = 1
      FOREIGN_LOCK                         = 2
      INVALID_ACTION                       = 3
      NO_CLIENTINDEPENDENT_AUTH            = 4
      NO_DATABASE_FUNCTION                 = 5
      NO_EDITOR_FUNCTION                   = 6
      NO_SHOW_AUTH                         = 7
      NO_TVDIR_ENTRY                       = 8
      NO_UPD_AUTH                          = 9
      ONLY_SHOW_ALLOWED                    = 10
      SYSTEM_FAILURE                       = 11
      UNKNOWN_FIELD_IN_DBA_SELLIST         = 12
      VIEW_NOT_FOUND                       = 13
      OTHERS                               = 14
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    it is calling, ok no issues but it is not allowing me to create a new entry in the child table zraj2.
    Error: Table is locked by the user Raj.Checked in SM12 yes there is an lock entry for the table zrst(cluster),  zraj1, zraj2.
    Question :
    By default in the execution of cluster will there be a lock in all the child table as well.
    if so how to create new entries....
    For your information : Standalone it is working fine.That is if i execute ZRAJ1 in SM31 i am able to create new entries..
    Can any one provide some input on this............
    Tahnks,
    raj.

    I don't know any direct transaction for your purpose, but you can use this program RSTXSCRP to download your form into the local file and than you can open it to view.
    Regards,
    Naimesh Patel

  • Insert Record with Parent/Child Tables doesn't work with Oracle - unlike AC

    Hi,
    I just Migrated a MS Access 2010 Database to an Oracle 11g Backend with the SQL Developer Tool.
    The Migration went fine, all the Tables and Views are migrated.
    I'm working with MS Access as Frontend.
    The application has some Datasheets with Subdatasheets with Parent/Child Relationship. (1-n Relationship)
    After changing to Oracle, it's not possible, to Insert a new Record in a Subdatasheet I always get the following Error Message:
    "The Microsoft Access database engine cannot find a record in the table 'xxxx' with key matching field(s) 'zzzzz'"
    It used to work perfect with the MS Access Backend, do I need a trigger which first adds the child Record ?
    Or what should I do?
    Thank you

    Hi Klaus,
    Thanks for your answer. I still haven't solved my problem. The only way would be to use a singel 1:n Relationship, but in fact I need a n:m Relationship.
    I tried the same scenario with a new Access Application, same result.
    To clearify my problem.
    Goal: Parent Form with Parent Records, Linked Child Form with Child Records in a Datasheet View => Insert of a NEW Child Record.
    I have 3 Tables (table1 = Parent tabel, table2 = Child Table, table12 = n:m Tabel with PK and two FK)
    The Recordsource of the Parent Form is Tabel1
    The Recordsource of the Child Form is Table2 joined with Table12.
    In my Old Access Project, Access Triggered the Insert and filled Table12 with the NEW PK of Table2.
    It seems like Access can't do that anymore....
    I'm pretty desperate and I'm sure it is just a litte thing to fix.....

  • Commit Rollback for Parent & Child table

    Hi,
    I need to load data to a parent table and child table (Record by Record), i.e one record will be loaded to the parent table and the related child record will be loaded to child table.
    After first record loaded to child table, the next record will be loaded to the parent table.
    My requirement is, I should not commit the parent table before the child record is transferred (so that i can rollback if my record got failed). So I have set the parent table IKM commit option to NO. Because of this, my child record is not loaded to the correcsponding target table, its failed because the parent record is not commited.
    Do we have any possiblities to overcome this issue.
    Thanks in Advance,
    Ram Mohan T

    Cezar,
    I couldn't make the CKM options to "No Commit". When i did that i am getting the following error at step "16 - Control - CUSTOMER_DET - insert PK errors" ,
    12838 : 72000 : java.sql.SQLException: ORA-12838: cannot read/modify an object after modifying it in parallel.
    This error occurs at the CKM. so i have made all the CKM options to "commit" and IKM, LKM to "No Commit". It seems to be fine.
    Cezar,
    I have some plan for the scenario that i mentioned in the previous update (One dept id and all related employees). Please verify this,
    1) create a procedure which extracts dept_id from source tab and passes it to the scenario(in target tab) of a package.
    2) This package has the variable of dept_id, interface1 which loads data to dept and following that another procedure(2).
    3) This procedure2 will extract the emp_id that corresponds to the value of the variable dept_id. And passes this emp_id to tha scenario in target tab.
    4) This scenario is of a package which has the emp_id variable and interface2 for loading employees.
    While executing this plan, the problem is,
    1) Interface1 which loads Dept_Id is not commited (due to the KMs with commit set to "No Commit"), so that the employee records are getting loaded to the error table.
    2) I have made the interface1 KM commit option to "Default: Yes " (But still the Knowledge modules steps are No commit), but still the child records are getting loaded to error table.
    3) As per the above scenario, all these transforamtions are not taking in the same transaction. Thats the problem i believe.
    Do we have any possiblities to overcome this Cezar?
    Thanks in Advance,
    Ram Mohan T
    Edited by: T. Ram Mohan on Mar 5, 2009 11:43 AM

  • How to check that my table is parent table or child table before trucating

    Hi:
    say i wanted to trucate a table .the table might be a parent table or might be a child table.if its a child table then there wouldnt be any problems in truncating.
    if its a parent table the i believe i would have to diable all the foreign key constraints from the child table referring to the parent table ..my question is
    1. i have a table say ABC. before truncating how do i find out if table ABC is a parent table or not?
    2.lets assume i tried to truncate the table ABC and i got the error saying that disable the foreign keys on the child table referring to the parent table ABC.
    in my schema there are say 50 tables.out of which there might be 10 odd child tables referring to my parent table ABC.
    so my question here would be how do i specifically find out these 10child tables referring to the Parent table ABC so that i can disable the foreign keys on the child tables.
    Thanks 4 ur time in reading this and hopefully i think u wld give me a solution!!

    Hi,
    Try this SQL below:
    select r.owner, r.table_name
    from user_constraints r, user_constraints o
    where r.r_owner = o.owner and r.r_constraint_name = o.constraint_name
    and o.constraint_type in ('P','U') and r.constraint_type = 'R'
    and o.table_name = 'ABC';Cheers

  • Creating relation in child tables

    Hi
    I have two child tables to the master table tblClients as per image below at the end; tblClientUniforms.ClientID<-Client.ID->tblClientRates.ClientID.
    Now I want to restrict tblClientUniforms.Role values for a client to only those values that are in tblClientRates.Role for the same client. What sort of relation do I need between tblClientUniforms.Role and tblClientRates.Role and how do I create
    it? When I try to drag one role field on the other in SQL Server Diagram I get an 'The columns in table 'tblClientUniforms' do not match an existing primary key or UNIQUE constraint' error.
    Thanks
    Regards

    Hi 
    Just to clarify,  all three tables contain a column named Role, now you want that Role value will unique for all three tables? Do you have client id in all tables? You can create an unique constraint on ClientID,RoledID...
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence
    Role in only the two child tables, not in tblClients. Unique would be ClientID+Role in both child tables.

  • Insert data Flatfile table to Parent and child tables

    Hi All,
        I have Flatfile table which is we getting from daily txt files and i want to populate flatfile data to parent as well as child tables. parent table has primary key as ID. This ID is foreign key of child tables. 
    Here i have mentioned our process.
    1. Flatfile duplicates has to remove with condition of daily date.
    2. Before Insert parent table have to check duplicate(we have Unique key of 4 columns in parent) if duplicate is there we have to delete duplicate then Insert into parent table unique records(Primary key is ID).(here why we are delete duplicate record meaning
    we getting daily files so if any records updated in future that record should be insert to parent and child table so only we delete old records and insert new records).
    3.After insert parent we have to populate child tables from Flatfile table as well as we have to insert parent table primary key as foreign key of child tables.
    4. if any truncation error occurs that errors should go to error log table.
    Right now we are using cursor for this concept and cursor has performance issue. so we are trying to optimize other way to populate parent and child table to increase performance to populate.
    Please help us to which way to do this process increase of performance .
    Please  can any one reply.

    Hi RajVasu,
    Since this issue is related to Transact-SQL, I will move this thread to Transact-SQL forum. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
    Thank you for your understanding and support.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to delete a Record in  Masterdata  and its Child Tables

    Hi ,
    i want to delete a  record in masterdata and its childtable .
    I am using generalservices.But it  gets error "Attempt to read or write protected memory"
    If there is another solution to delete records in all child tables.
    Edited by: tharunireddy on Aug 13, 2010 3:08 PM

    Hi,
    There must be something wrong with your code.
    Please post it here so we can determine the problem and present a solution.
    Regards,
    Vítor Vieira

  • Parent table of a child table

    I am using a child table 'CHILD_T' and in this table the column 'CHILD_FK' is the foreign key and it is pointing to some parent table. In my oracle editor I can see only synonyms but not actual tables. Is there any way to find out the parent table for this child table. Why I am asking this is because , I am getting below error while trying to execute the below script.
    Here I think my question is pretty simple but I would like to know how to find a parent table of a child table as I can see only synonyms instead actual tables.
    Script :
    INSERT INTO CHILD_T ( EM_ID, DFLT_COST_CNTR_TXT, ACCT_TYP_ID, DFLT_ORD_TYP_ID ) VALUES ('abcd', 'NA', '1', '1' );
    Error:
    SQL Error: ORA-02291: integrity constraint (AFM.USR_PROF_EM_ID) violated - parent key not found.
    Any one have any idea your help is well appreciated.

    select table_name  from user_constraints where constraint_name  in
        (select r_constraint_name from user_constraints  where constraint_name='YOUR_CONSTARINT_NAME');

  • Child table foregin key contrain violation

    Hi ,
    1-I have a form containing parant and child table component
    child table component becomes visible changes base on drop down present on form
    After typing Id , drop down is change ..on its listener createchildtable row is created progarmmatically.
    the form gets saved.
    2-but after competing all record if i change the first field ID on parent table component and save i get child contrain violation error
    What i had observerd that after 2 step my child table view object get current row becomes null
    please help

    You are deleting "parent" rows.
    I am wondering about the locking of "child" table Message. Especially if your query plan shows spools (as noticed by Kev). Theoretically, it is possible that the spool has collected all information, then releases the locks on Message and starts
    deleting rows from MessageData. If a "first" "child" row is added to Message for an existing MessageData row, then the delete of the corresponding no-longer-orphaned "parent" will fail.
    If this is the case, then you have a choice to make. Which way do you want to resolve the problem? Do you want the insert to be blocked and possibly fail, or are you content with failure of your batch delete?
    If you want the insert to be blocked, you could add locking hints to the Message table in the delete query, such as WITH (UPDLOCK, HOLDLOCK).
    Gert-Jan

Maybe you are looking for

  • Difference in AR Reconciliation Report

    My submitted AR Reconciliation Report has a different of $8,000.00 and the amount was found from a unapplied receipt. How could I trace the root cause of this different amount?? Aging 4-Buckets report?? The amount in bule is the +/- amount from its o

  • How can I make the sort default "by date" in iPhoto?

    On one of my computers, every time I load an event, it goes to the top of the library and I have to go to "sort/by date" to get it to go to the end or bottom of the library...where I want it. On my other computers, the default seems to be "by date" n

  • Black and White conversion

    Has anyone worked on finding greyscale conversion 'slider recipes' that give a similar look to various popular films. Would appreciate if you could share some of these. Cheers Kev.

  • I want some modification in JFileChooser

    In FileChooser i was added two buttons "Preview" and "Remove" [Now the File Chooser default one]. Now i select one image file then click the Preview button means i want to preview the selected image in Accesory panel[Now FileChooser with Accesory ] .

  • Error in page

    hi to all 1. i created a calendar program for start date and end date to compare two days. in my first jsp is for showing the Start date and End date and the popup calendar. there is also an button called Check. this check button is used in second js