Table Comparison to pull back non matching data

Hello,
I have been working on the below for a few days now and cannot figure out how to get the desired results. Was hoping someone could point me in the right direction. I have attached the data below and the queries I have come up with so far. I only need data for MU_ID (3,7,4) and only need SKILL_NM ('THICV','HELPDESK_FOUNDATIONAL','SPANISH','AUTO','HELPDESK_COMPLEX','HOUSE_COMPLEX','BOAT','HOUSE','HELPDESK','HELPDESK_MODERATE') as there are hundreds more in the actual tables. I also have the problem of the skill levels for the foundational, moderate, complex skill names from the IEX table. If SKILL_LEVEL is 0-2 on the GEN table they are listed as _FOUNDATIONAL in the IEX table, 3-7 is _MODERATE, 8-10 is _COMPLEX but only for the SKILL_NM 'HELPDESK' & 'HOUSE'.
CREATE TABLE IEX(
  MU_ID         NUMBER(5),
  AGENT_NM      VARCHAR2(30),
  EXTERNAL_ID   VARCHAR2(8),
  SKILL_NM      VARCHAR2(50))
CREATE TABLE GEN(
  USER_ID       VARCHAR2(8),
  SKILL_NM      VARCHAR2(255),
  SKILL_LEVEL   NUMBER(10))
INSERT INTO IEX(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(3,'ROBERTS,CHRIS','ROBERT1','THICV')
INSERT INTO IEX(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(3,'ROBERTS,CHRIS','ROBERT1','HELPDESK_FOUNDATIONAL')
INSERT INTO IEX(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(7,'SEW,HEATHER','SEW1','SPANISH')
INSERT INTO IEX(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(7,'SEW,HEATHER','SEW1','AUTO')
INSERT INTO IEX(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(4,'PRATT,MIKE','PRATT2','HOUSE_COMPLEX')
INSERT INTO IEX(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(4,'PRATT,MIKE','PRATT2','HELPDESK_MODERATE')
INSERT INTO IEX(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('ROBERT1','THICV',1)
INSERT INTO IEX(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('ROBERT1','HELPDESK',7)
INSERT INTO IEX(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('SEW1','SPANISH',1)
INSERT INTO IEX(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('SEW1','BOAT',1)
INSERT INTO IEX(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('PRATT2','HOUSE',9)
INSERT INTO IEX(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('PRATT2','HELPDESK',2)
DESIRED RESULTS:
MU_ID      AGENT_NM                EXTERNAL_ID      IEX_SKILL_NM                                GEN_SKILL_NM      SKILL_LEVEL
3                ROBERTS,CHRIS      ROBERT1            NULL                                                     HELPDESK                7
3                ROBERTS,CHRIS      ROBERT1            HELPDESK_FOUNDATIONAL      NULL                           NULL
7                SEW,HEATHER           SEW1                      AUTO                                                NULL                           NULL
7                SET,HEATHER           SEW1                      NULL                                                     BOAT                           1
4                PRATT,MIKE                PRATT2                 HELPDESK_MODERATE                     NULL                           NULL
4                PRATT,MIKE                PRATT2                 NULL                                                          HELPDESK                2
I wrote the 2 below queries, the first one is getting some of the data I need, but not all of it. The second one was something I was playing around with to see if it would do that I need, looks kinda like it works but pulling back way more data than I need and I cannot figure out how to have the skill level data in it.
SELECT
A.MU_ID,
A.AGENT_NM,
A.EXTERNAL_ID,
A.SKILL_NM
FROM IEX A
WHERE
  A.mu_id IN
   ('3', '4', '7') AND
  UPPER (A.AGENT_NM) NOT LIKE ('%Temp%') AND
    A.EXTERNAL_ID IS NOT NULL
AND A.SKILL_NM NOT IN
(SELECT B.SKILL_NM
FROM GEN B
WHERE A.EXTERNAL_ID = B.USER_ID
and A.SKILL_NM = B.SKILL_NM)
ORDER BY AGENT_NM ASC
(SELECT
   A.EXTERNAL_ID,
   A.SKILL_NM
FROM
   IEX A
WHERE
   A.MU_ID IN ('3', '4', '7')
MINUS
SELECT
   B.USER_ID,
   B.SKILL_NM
FROM
   GEN B
WHERE
   B.SKILL_NM IN
     ('THICV',
      'HELPDESK_FOUNDATIONAL',
      'SPANISH',
      'AUTO',
      'HELPDESK_COMPLEX',
      'HOUSE_COMPLEX',
      'BOAT',
      'HOUSE',
      'HELPDESK',
      'HELPDESK_MODERATE'))
UNION ALL
(SELECT
   B.USER_ID,
   B.SKILL_NM
FROM
   GEN B
WHERE
   B.SKILL_NM IN
     ('THICV',
      'HELPDESK_FOUNDATIONAL',
      'SPANISH',
      'AUTO',
      'HELPDESK_COMPLEX',
      'HOUSE_COMPLEX',
      'BOAT',
      'HOUSE',
      'HELPDESK',
      'HELPDESK_MODERATE')
MINUS
SELECT
   A.EXTERNAL_ID,
   A.SKILL_NM
FROM
   IEX A
WHERE
   A.MU_ID IN ('3', '4', '7'))

Thanks Frank,
I guess I explained it wrong. What you provided does pull back non matching data but is also pulling back matching data. Below is the exact query I am using and sample data. What is need  to show all skill_nm that do not match each other from both table. There are a handful of skill_nm that I have to use a condition with levels to make them match up based on "complex" "moderate" "foundational" but only these few need to have that condition and everything else is just straight up does skill_nm from a = skill_nm.
My current query:
SELECT
  A.MU_ID,
  A.AGENT_NM,
  B.USER_ID AS EXTERNAL_ID,
  A.SKILL_NM AS IEX_SKILL_NM,
  B.SKILL_NM AS GEN_SKILL_NM,
  B.SKILL_LEVEL
FROM
  LIGHTHOUSE.IEX_AGT_SKILL A
  FULL OUTER JOIN
  LIGHTHOUSE.CFG_PERSON_SKILL_VALUES B
    ON A.EXTERNAL_ID = B.USER_ID AND
       A.SKILL_NM = B.SKILL_NM
     || CASE
            WHEN B.SKILL_NM NOT IN ('THIPayment','THIPL','SPSC') THEN NULL
          WHEN B.SKILL_LEVEL <= 2 THEN '_FOUNDATIONAL'
        WHEN B.SKILL_LEVEL <= 7 THEN '_MODERATE'
      WHEN B.SKILL_LEVEL <= 10 THEN '_COMPLEX'
     END AND
            A.MU_ID IN
         ('3','4','5','6','7','12','14','220','222','410','411','412','413','414','415','480','600','650','717','720','721',
          '722','723','800','801','3008','3010','3012','3100','4200','4201','4202','4203','4400','4401','4402','4404')
Doing this, it is looking at the SKILL_LEVEL for all SKILL_NM and pulling back things that do match, but not on the level. I only need to have skill level match up for:
GENESYS
IEX
SKILL LEVEL
THIPayment
THIPayment_Complex
8 to 9
THIPayment_Foundational
0-1
THIPayment_Moderate
2 to 7
THIPL
THIPL_Complex
8 to 9
THIPL_Foundational
0-1
THIPL_Moderate
2 to 7
SPSC
SPSC_Foundational
0- 1
SPSC_Moderate
2 to 7
PLSCLegacy
PLSCLegacy_Complex
8 to 9
PLSCLegacy_Foundational
0- 1
PLSCLegacy_Moderate
2 to 7
PLSCPCIO
PLSCPCIO_Complex
8 to 9
PLSCPCIO_Foundational
0- 1
PLSCPCIO_Moderate
2 to 7
CREATE TABLE IEX_AGT_SKILL(
  MU_ID         NUMBER(5),
  AGENT_NM      VARCHAR2(30),
  EXTERNAL_ID   VARCHAR2(8),
  SKILL_NM      VARCHAR2(50))
CREATE TABLE CFG_PERSON_SKILL_VALUES(
  USER_ID       VARCHAR2(8),
  SKILL_NM      VARCHAR2(255),
  SKILL_LEVEL   NUMBER(10))
INSERT INTO IEX_AGT_SKILL(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(3,'ROBERTS,CHRIS','ROBERT1','THIPayment_FOUNDATIONAL')
INSERT INTO IEX_AGT_SKILL(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(3,'ROBERTS,CHRIS','ROBERT1','SPSC_FOUNDATIONAL')
INSERT INTO IEX_AGT_SKILL(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(7,'SEW,HEATHER','SEW1','SPSC_MODERATE')
INSERT INTO IEX_AGT_SKILL(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(7,'SEW,HEATHER','SEW1','SPSC_BOAT')
INSERT INTO IEX_AGT_SKILL(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(4,'PRATT,MIKE','PRATT2','THIPayment_COMPLEX')
INSERT INTO IEX_AGT_SKILL(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(4,'PRATT,MIKE','PRATT2','HELPDESK')
INSERT INTO CFG_PERSON_SKILL_VALUES(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('ROBERT1','THIPayment',1)
INSERT INTO CFG_PERSON_SKILL_VALUES(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('ROBERT1','SPSC',7)
INSERT INTO CFG_PERSON_SKILL_VALUES(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('SEW1','SPSC',1)
INSERT INTO CFG_PERSON_SKILL_VALUES(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('SEW1','SPSC_BOAT',1)
INSERT INTO CFG_PERSON_SKILL_VALUES(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('PRATT2','SPANISH',9)
INSERT INTO CFG_PERSON_SKILL_VALUES(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('PRATT2','HELPDESK',2)
DESIRED OUTCOME:
MU_ID AGENT_NM       EXTERNAL_ID    IEX_SKILL_NM                   GEN_SKILL_NM
3     ROBERTS,CHRIS  ROBERT1           SPSC_FOUNDATIONAL
3     ROBERTS,CHRIS  ROBERT1                                                            SPSC_MODERATE
7     SEW,HEATHER      SEW1                     SPSC_MODERATE
7     SEW,HEATHER      SEW1                                                                  SPSC_FOUNDATIONAL
4     PRATT,MIKE            PRATT2                   THIPayment_COMPLEX
4     PRATT,MIKE            PRATT2                                                              SPANISH

Similar Messages

  • Table with bith dynamic and non dynamic data

    Hi all,
    We have a report already developed. Now we need  add some fields from some table which is dynamic in feature to the final report which is already there.
    I need to know how come we can include the dynamic fields into the final internal table.
    I tried declaring fieldsymbols inside the data stmt of the final internal table but it shows some syntax error.
    Please help me.
    Thanks

    Check this sample code..
    REPORT  ztest_dynamic_code.
    DATA: BEGIN OF it_tab OCCURS 0,
           abc(3),
           xyz(3),
           pqr(3),
           item,
         END OF it_tab.
    DATA: it_fieldcatalog  TYPE lvc_t_fcat,
    wa_fieldcat TYPE lvc_s_fcat.
    DATA:  i_dyntab  TYPE REF TO data. " To create dyn.Itab
    DATA:
           w_dref TYPE REF TO data,
           ind(2) TYPE n,
           w_data TYPE REF TO data,
           w_text(5),
           w_grid TYPE REF TO cl_gui_alv_grid.
    DATA: grid TYPE REF TO cl_gui_alv_grid,
          cont TYPE REF TO cl_gui_custom_container.
    FIELD-SYMBOLS: <t_itab> TYPE STANDARD TABLE,
                   <fs_wa> TYPE ANY,<fs> TYPE ANY.
    DATA: in TYPE i.
    *Data population
    it_tab-abc = 'ABC'.
    it_tab-xyz = 'XYZ'.
    it_tab-pqr = 'PQR'.
    DO 9 TIMES.
      in = in + 1.
      it_tab-item = in.
      APPEND it_tab.
    ENDDO.
    *Field cat population.
    wa_fieldcat-fieldname = 'ABC'.
    wa_fieldcat-outputlen = 3.
    wa_fieldcat-coltext = 'abc'.
    APPEND wa_fieldcat TO it_fieldcatalog.
    wa_fieldcat-fieldname = 'XYZ'.
    wa_fieldcat-outputlen = 3.
    wa_fieldcat-coltext = 'XYZ'.
    APPEND wa_fieldcat TO it_fieldcatalog.
    wa_fieldcat-fieldname = 'PQR'.
    wa_fieldcat-outputlen = 3.
    wa_fieldcat-coltext = 'pqr'.
    APPEND wa_fieldcat TO it_fieldcatalog.
    wa_fieldcat-fieldname = 'COLOR'.
    wa_fieldcat-outputlen = 4.
    wa_fieldcat-coltext = 'col'.
    APPEND wa_fieldcat TO it_fieldcatalog.
    ind = 1.
    DO 9 TIMES.
      CONCATENATE 'ITEM' ind INTO wa_fieldcat-fieldname.
      CONCATENATE 'ITEM' ind INTO wa_fieldcat-coltext.
      wa_fieldcat-outputlen = 1.
      APPEND wa_fieldcat TO it_fieldcatalog.
      CLEAR wa_fieldcat .
      ind  = ind + 1.
    ENDDO.
    *-Dynamic Table creation
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = it_fieldcatalog
      IMPORTING
        ep_table        = i_dyntab.
    ASSIGN i_dyntab->* TO <t_itab>.
    CREATE DATA w_data LIKE LINE OF <t_itab>.
    ASSIGN w_data->* TO <fs_wa>.
    SORT it_tab BY abc xyz pqr.
    CLEAR ind.
    ind = 4.
    *-Final Internal table as per Requirement
    do 10 times.
    LOOP AT it_tab.
      ASSIGN COMPONENT 1 OF STRUCTURE <fs_wa> TO <fs>.
      <fs> = it_tab-abc.
      ASSIGN COMPONENT 2 OF STRUCTURE <fs_wa> TO <fs>.
      <fs> = it_tab-xyz.
      UNASSIGN <fs>.
      ASSIGN COMPONENT 3 OF STRUCTURE <fs_wa> TO <fs>.
      <fs> = it_tab-pqr.
      UNASSIGN <fs>.
      ASSIGN COMPONENT 4 OF STRUCTURE <fs_wa> TO <fs>.
    *-You can assign the color conditionally also..
      if sy-index = 4.
      <fs> = 'C400'.
      else.
        <fs> = 'C600'.
      endif.
      UNASSIGN <fs>.
      ASSIGN COMPONENT ind OF STRUCTURE <fs_wa> TO <fs>.
      <fs> = it_tab-item.
      UNASSIGN <fs>.
      ind = ind + 1.
      AT END OF pqr.
        APPEND <fs_wa> TO <t_itab>.
    *    <fs_wa>-color = 'C600'.
        ind = 4.
        CLEAR <fs_wa>.
      ENDAT.
    ENDLOOP.
    enddo.
    *-Display
    CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      DATA: layout TYPE lvc_s_layo.
      CREATE OBJECT cont
         EXPORTING
           container_name              = 'CONT'
         EXCEPTIONS
           cntl_error                  = 1
           cntl_system_error           = 2
           create_error                = 3
           lifetime_error              = 4
           lifetime_dynpro_dynpro_link = 5
           OTHERS                      = 6
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CREATE OBJECT grid
        EXPORTING
          i_parent          = cont
        EXCEPTIONS
          error_cntl_create = 1
          error_cntl_init   = 2
          error_cntl_link   = 3
          error_dp_create   = 4
          OTHERS            = 5
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      layout-INFO_FNAME = 'COLOR'.
      grid->set_table_for_first_display(
         EXPORTING
           is_layout                      =  layout
         CHANGING
           it_outtab                     = <t_itab>
           it_fieldcatalog               = it_fieldcatalog
       EXCEPTIONS
         invalid_parameter_combination = 1
         program_error                 = 2
         too_many_lines                = 3
      IF sy-subrc  NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT

  • Fetching un-matching data

    Hi,
    From the below code snippet, I want to fetch the non-matching data from table "T1".
    DROP TABLE T1;
    DROP TABLE T2;
    CREATE TABLE T1
    F1 INTEGER,
    F2 VARCHAR2(100 BYTE),
    F3 CHAR(1)
    CREATE TABLE T2
    FLD1 INTEGER,
    FLD2 VARCHAR2(100 BYTE)
    begin
         insert into t1
         values(1, 'A1', 'F');
         insert into t1
         values(1, 'A2', 'F');
         insert into t1
         values(1, 'A3', 'T');
         insert into t1
         values(2, 'A1', 'T');
         insert into t1
         values(3, 'A1', 'F');
         insert into t2
         values(1, 'T1');
         insert into t2
         values(2, 'T2');
    end;
    select * from t1;
    select * from t2;
    Query A)
    select t1.*, nvl(t2.fld1, -1), nvl(t2.fld2, 'EMPTY')
    from t1, t2
    where t1.f1 = t2.fld1 (+);
    Query B)
    select t1.*, t2.*
    from t1, t2
    where t1.f3 = 'T' and t1.f1 = t2.fld1;
    Upto this, it is fine, now, I want to fetch the resuts of "Query A" using something like given below,
    without applying outer join, this would look silly, unfortunately cannot avoid it.
    I am just trying to fetch the unmatching data from T1, when F3 field is
    when "F3 = 'T'" then matching data using "t1.f1 = t2.fld1" should be fetched, otherwise
    no join condition be applied.
    I just tried using the below SQL, it gives "ORA-00905: missing keyword" error, I understand it is not correct.
    select t1.*, t2.*
    from t1, t2
    where case when t1.f3 = 'T' then t1.f1 = t2.fld1 else NULL end;
    I cannot use scalar subqueries for this requirement, as it is quite expensive, please give me other alternatives
    for this, that should be helpful to me, thank you.

    I'm kind of confused about your requirements.
    Do you want to return ALL rows from T1 and only the values from T2 where T1.F3 = 'T'?
    Something like this maybe?
    SELECT  T1.*
                    CASE
                            WHEN T1.F3 = 'T'
                            THEN NVL(T2.FLD1,-1)
                    END
            )       AS FLD1
                    CASE
                            WHEN T1.F3 = 'T'
                            THEN NVL(T2.FLD2,'EMPTY')
                    END
            )       AS FLD2
    FROM    T1
    ,       T2
    WHERE   T1.F1 = T2.FLD1(+)Sample Results:
    SQL > /
    F1 F2  F FLD1 FLD2
      1 A3  T    1 T1
      1 A2  F
      1 A1  F
      2 A1  T    2 T2
      3 A1  FCan you please post the expected output as well?
    We all appreciate that you posted sample data and the DDL to go with it can you post the following too?
    1. Oracle version (e.g. 10.2.0.4)
    2. Sample data, and expected output in \ tags (see FAQ for more information).
    Edited by: Centinul on Aug 14, 2009 6:46 AM
    Added query...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to create a sales order having incomplete non-sap data as input start

    We have facing the following problem in our company. We have a non-SAP system where we pull data from. We built a webservice that enables a user to pull data from the non-sap sustem by entering a key value (e.g. project number). Pulling the non-sap data is not a problem. However, once the user have pulled the data via the webservice, this data (e.g. material number, qty and sales unit) needs to be transfered to the va01 screen directly. The user will have to complete the missing master data like sold to party, ship to party, customer PO number etc. Then by hitting enter standard SAP will run and if everything is OK, the user has to save the order and a sales order number will be created. We know there a lot of techniques that can be used like Idoc, BAPI, XML, RFC. We have XI, Adobe and Portal available. Does somebody have an idea for a solid solution to get this to work?
    kind regards
    Angelique Heutinck

    You want to Create Sales Order thru VA01 after puling the data from NonSAP system. Moreover you want that the Incomplete Sales Order will be saved.
    if thats the requirement - I ll suggest
    While doing VA01 - start from Create with reference Sales order. in that case default Sales Orders will be automatically created and using the BDC you can change the items  or Customers you want to change. Once the Order number is created properly  - u r free to change eveything of that Order.
    Otherwise calling BAPI / RFC for creating the sales orders is the most safest way of achieving it. But again if you dont have the complete data - calling RFC  or BAPI does not make much sense. because they will fail to create the Sales Order in case u dont fill up the mandatory fields.

  • How to create custom search box will allow up to 60 alphanumericcharacters & User can input a minimum of 1 character and the system will pull back an exact match on the sequence entered.

    Hi,
    Can anyone please help me in creating the Custom Search box with below mentioned functionality
    "The search box will allow up to 60 alphanumeric characters.User can input a minimum of 1 character and the system will pull back an exact match on the sequence entered"

    Hi Pradeep,
    Find the complete JQuery AutoComplete function with along with different events in it like focus, select, open and close. You can modify this code as per your requirement.
    $("#ddlSearchTextBox").autocomplete({
    source: function (request, response) {
    var getUrl = "<site URL>";
    $.ajax({
    url: getUrl,
    type: "GET",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    data: {
    featureClass: "P",
    style: "full",
    maxRows: 10
    dataFilter: function (data, type) {
    return data.replace(/\\'/g, "'");
    success: function (data) {
    response($.map(data.d, function (result) {
    return {
    label: result.Last_Name + ", " + result.First_Name,
    value: result.id
    focus: function (event, ui) {
    $("#ddlSearchTextBox").val(ui.item.label);
    return false;
    minLength: 1,
    select: function (event, ui) {
    $("#ddlSearchTextBox").val(ui.item.label);
    return false;
    open: function () {
    $("#ddlSearchTextBox").removeClass("ui-corner-all").addClass("ui-corner-top");
    close: function () {
    $("#ddlSearchTextBox").removeClass("ui-corner-top").addClass("ui-corner-all");
    Let us know if you need any further.
    Thanks, Shakir | Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Invoking binding operation from backing bean -- no data displayed in ADF table ?

    Hello experts, I have data control derived from  Web Service proxy client.  In this data control,  I have  multi record list derived from web service call.In my ADF page,  I have bunch of input components with many drop down lists and radio buttons, check boxes etc.
    Finally  I want to transfer user input to   data control.   In my  ADF page,  I  have mapped  the  result set of data conrol to  ADF table.
    When I click submit button,  the   input data from ADF page is passed to data control  operation.   In the bean method,  I am making use of   operationBinding.execute()  and operationBinding.getParamsMap().put().     I see it is fetching data by checking getResult().
    I am invoking partial trigger also on the table.  However, table is not getting populated with the data.
    please help me.     Jdeveloper verion is 11.1.1.6.     I have set "Refresh" attribute to "never"  for  iterator in the bindings tab.    But no luck.  I see that control coming to data control and calling web service and getting the data  and then it comes back to my bean method submit() and I see that getResult() is showing records fetched.   But  why  the table on ADF page is not showing the data ?
    thanks a lot in advance.

    I still not able to get  my table updated with  data.  If  I set   "Refresh"  to  "ifNeeded",  soon after coming out of  submit  method of bean, it again tries to execute the web service call in the  data control  and brings empty result since the search parameters are empty.  I do not know why it goes again to data control method.    So, when I hit submit button,  the bean method calls  operationBidnding.execute() and before this I set the parameters also.    After execute(),  addPartialTarget() gets executed and it comes out of submit.   At this time, it is supposed to go to ADF page.  But I see  that  it tries to execute  method in data control with empty parameters.   This is ridiculous.    It neither works with "never", nor with "ifNeeded". 
    I see many forums on this issue but no solution found...all those forums are not answered.  This looks like it is a bug in ADF table not able to refresh from  managed bean !!!!     
    thanks

  • Non Matched PO receipts

    Hello All,
    I need to develop a query for "Non Matched PO receipts" with the fo;;woing columns
    Supplier Code
    Spplier Name
    quantity received (NOT MATCHED)
    unit price
    currency
    exchange rate
    receiving date
    payment term (assigned to PO)
    so i have wrtiten the following query but it is not returing data is my query correct
    select pv.vendor_type_lookup_code Supplier_code,
    pv.vendor_name Supplier_name,
    rsl.quantity_received,
    aida.unit_price,
    aida.Exchange_rate,
    aia.invoice_currency_code,
    att.name Payment_term
    from AP_Invoices_All aia,
    aP_invoice_distributions_all aida,
    PO_vendors pv,
    AP_TERMS_TL att,
    rcv_transactions rt,
    rcv_shipment_lines rsl
    where aia.vendor_id=pv.vendor_id
    and aia.invoice_id=aida.invoice_id
    and aida.po_distribution_id is null
    and aia.terms_id=att.term_id
    and aida.rcv_transaction_id = rt.transaction_id
    and rt.shipment_line_id = rsl.shipment_line_id
    Thanks,
    Kumar

    Hi,
    Whenever you need help on this forum, post:
    (1) The version of Oracle (and any other relevant software) you're using
    (2) A little sample data (just enough to show what the problem is) from all the relevant tables
    (3) The results you want from that data
    (4) Your best attempt so far
    Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
    If you can present your problem using commonly available tables (for example, tables in scott schema, or views in the data dictionary), then you can omit (2).
    Formatted tabular output is okay for (3). Type &#123;code&#125; before and after the tabular text, to preserve spacing.
    You've already done (4), but it would be better if you could use &#123;code&#125; tags around that, too: it's hard to read without any formatting.

  • Schema Table Comparison

    Hi All,
    I've got 2 schemas with identical tables.
    I want to do a minus on the tables but would like to do this with a procedure that then reports the change into a <table_name>_diff table for each - This table should show records that are in schema1 but not in 2 and records that are in schema 2 but not in 1.
    There are about 40 tables in total so a proc rather than doing it all manually would be superb...
    Any ideas ?

    Hi ,
    I have found somewhere in the net the following code......
    REM
    REM Edit the following three DEFINE statements to customize this script
    REM to suit your needs.
    REM
    REM Tables to be compared:
    DEFINE table_criteria = "table_name = table_name" -- all tables
    REM DEFINE table_criteria = "table_name != 'TEST'"
    REM DEFINE table_criteria = "table_name LIKE 'LOOKUP%' OR table_name LIKE 'C%'"
    REM Columns to be compared:
    DEFINE column_criteria = "column_name = column_name" -- all columns
    REM DEFINE column_criteria = "column_name NOT IN ('CREATED', 'MODIFIED')"
    REM DEFINE column_criteria = "column_name NOT LIKE '%_ID'"
    REM Database link to be used to access the remote schema:
    DEFINE dblink = "remote_db"
    SET SERVEROUTPUT ON SIZE 1000000
    SET VERIFY OFF
    DECLARE
      CURSOR c_tables IS
        SELECT   table_name
        FROM     user_tables
        WHERE    &table_criteria
        ORDER BY table_name;
      CURSOR c_columns (cp_table_name IN VARCHAR2) IS
        SELECT   column_name, data_type
        FROM     user_tab_columns
        WHERE    table_name = cp_table_name
        AND      &column_criteria
        ORDER BY column_id;
      TYPE t_char80array IS TABLE OF VARCHAR2(80) INDEX BY BINARY_INTEGER;
      v_column_list     VARCHAR2(32767);
      v_total_columns   INTEGER;
      v_skipped_columns INTEGER;
      v_count1          INTEGER;
      v_count2          INTEGER;
      v_rows_fetched    INTEGER;
      v_column_pieces   t_char80array;
      v_piece_count     INTEGER;
      v_pos             INTEGER;
      v_length          INTEGER;
      v_next_break      INTEGER;
      v_same_count      INTEGER := 0;
      v_diff_count      INTEGER := 0;
      v_error_count     INTEGER := 0;
      v_warning_count   INTEGER := 0;
      -- Use dbms_sql instead of native dynamic SQL so that Oracle 7 and Oracle 8
      -- folks can use this script.
      v_cursor          INTEGER := dbms_sql.open_cursor;
    BEGIN
      -- Iterate through all tables in the local database that match the
      -- specified table criteria.
      FOR r1 IN c_tables LOOP
        -- Build a list of columns that we will compare (those columns
        -- that match the specified column criteria). We will skip columns
        -- that are of a data type not supported (LOBs and LONGs).
        v_column_list := NULL;
        v_total_columns := 0;
        v_skipped_columns := 0;
        FOR r2 IN c_columns (r1.table_name) LOOP
          v_total_columns := v_total_columns + 1;
          IF r2.data_type IN ('BLOB', 'CLOB', 'NCLOB', 'LONG', 'LONG RAW') THEN
            -- The column's data type is one not supported by this script (a LOB
            -- or a LONG). We'll enclose the column name in comment delimiters in
            -- the column list so that the column is not used in the query.
            v_skipped_columns := v_skipped_columns + 1;
            IF v_column_list LIKE '%,' THEN
              v_column_list := RTRIM (v_column_list, ',') ||
                               ' /*, "' || r2.column_name || '" */,';
            ELSE
              v_column_list := v_column_list || ' /* "' || r2.column_name ||'" */ ';
            END IF;
          ELSE
            -- The column's data type is supported by this script. Add the column
            -- name to the column list for use in the data comparison query.
            v_column_list := v_column_list || '"' || r2.column_name || '",';
          END IF;
        END LOOP;
        -- Compare the data in this table only if it contains at least one column
        -- whose data type is supported by this script.
        IF v_total_columns > v_skipped_columns THEN
          -- Trim off the last comma from the column list.
          v_column_list := RTRIM (v_column_list, ',');
          BEGIN
            -- Get a count of rows in the local table missing from the remote table.
            dbms_sql.parse
            v_cursor,
            'SELECT COUNT(*) FROM (' ||
            'SELECT ' || v_column_list || ' FROM "' || r1.table_name || '"' ||
            ' MINUS ' ||
            'SELECT ' || v_column_list || ' FROM "' || r1.table_name ||'"@&dblink)',
            dbms_sql.native
            dbms_sql.define_column (v_cursor, 1, v_count1);
            v_rows_fetched := dbms_sql.execute_and_fetch (v_cursor);
            IF v_rows_fetched = 0 THEN
              RAISE NO_DATA_FOUND;
            END IF;
            dbms_sql.column_value (v_cursor, 1, v_count1);
            -- Get a count of rows in the remote table missing from the local table.
            dbms_sql.parse
            v_cursor,
            'SELECT COUNT(*) FROM (' ||
            'SELECT ' || v_column_list || ' FROM "' || r1.table_name ||'"@&dblink'||
            ' MINUS ' ||
            'SELECT ' || v_column_list || ' FROM "' || r1.table_name || '")',
            dbms_sql.native
            dbms_sql.define_column (v_cursor, 1, v_count2);
            v_rows_fetched := dbms_sql.execute_and_fetch (v_cursor);
            IF v_rows_fetched = 0 THEN
              RAISE NO_DATA_FOUND;
            END IF;
            dbms_sql.column_value (v_cursor, 1, v_count2);
            -- Display our findings.
            IF v_count1 = 0 AND v_count2 = 0 THEN
              -- No data discrepencies were found. Report the good news.
              dbms_output.put_line
              r1.table_name || ' - Local and remote table contain the same data'
              v_same_count := v_same_count + 1;
              IF v_skipped_columns = 1 THEN
                dbms_output.put_line
                r1.table_name || ' - Warning: 1 LOB or LONG column was omitted ' ||
                'from the comparison'
                v_warning_count := v_warning_count + 1;
              ELSIF v_skipped_columns > 1 THEN
                dbms_output.put_line
                r1.table_name || ' - Warning: ' || TO_CHAR (v_skipped_columns) ||
                ' LOB or LONG columns were omitted from the comparison'
                v_warning_count := v_warning_count + 1;
              END IF;
            ELSE
              -- There is a discrepency between the data in the local table and
              -- the remote table. First, give a count of rows missing from each.
              IF v_count1 > 0 THEN
                dbms_output.put_line
                r1.table_name || ' - ' ||
                LTRIM (TO_CHAR (v_count1, '999,999,990')) ||
                ' rows on local database missing from remote'
              END IF;
              IF v_count2 > 0 THEN
                dbms_output.put_line
                r1.table_name || ' - ' ||
                LTRIM (TO_CHAR (v_count2, '999,999,990')) ||
                ' rows on remote database missing from local'
              END IF;
              IF v_skipped_columns = 1 THEN
                dbms_output.put_line
                r1.table_name || ' - Warning: 1 LOB or LONG column was omitted ' ||
                'from the comparison'
                v_warning_count := v_warning_count + 1;
              ELSIF v_skipped_columns > 1 THEN
                dbms_output.put_line
                r1.table_name || ' - Warning: ' || TO_CHAR (v_skipped_columns) ||
                ' LOB or LONG columns were omitted from the comparison'
                v_warning_count := v_warning_count + 1;
              END IF;
              -- Next give the user a query they could run to see all of the
              -- differing data between the two tables. To prepare the query,
              -- first we'll break the list of columns in the table into smaller
              -- chunks, each short enough to fit on one line of a telnet window
              -- without wrapping.
              v_pos := 1;
              v_piece_count := 0;
              v_length := LENGTH (v_column_list);
              LOOP
                EXIT WHEN v_pos = v_length;
                v_piece_count := v_piece_count + 1;
                IF v_length - v_pos < 72 THEN
                  v_column_pieces(v_piece_count) := SUBSTR (v_column_list, v_pos);
                  v_pos := v_length;
                ELSE
                  v_next_break :=
                    GREATEST (INSTR (SUBSTR (v_column_list, 1, v_pos + 72),
                                     ',"', -1),
                              INSTR (SUBSTR (v_column_list, 1, v_pos + 72),
                                     ',/* "', -1),
                              INSTR (SUBSTR (v_column_list, 1, v_pos + 72),
                                     ' /* "', -1));
                  v_column_pieces(v_piece_count) :=
                    SUBSTR (v_column_list, v_pos, v_next_break - v_pos + 1);
                  v_pos := v_next_break + 1;
                END IF;
              END LOOP;
              dbms_output.put_line ('Use the following query to view the data ' ||
                                    'discrepencies:');
              dbms_output.put_line ('(');
              dbms_output.put_line ('SELECT ''Local'' "LOCATION",');
              FOR i IN 1..v_piece_count LOOP
                dbms_output.put_line (v_column_pieces(i));
              END LOOP;
              dbms_output.put_line ('FROM "' || r1.table_name || '"');
              dbms_output.put_line ('MINUS');
              dbms_output.put_line ('SELECT ''Local'' "LOCATION",');
              FOR i IN 1..v_piece_count LOOP
                dbms_output.put_line (v_column_pieces(i));
              END LOOP;
              dbms_output.put_line ('FROM "' || r1.table_name || '"@&dblink');
              dbms_output.put_line (') UNION ALL (');
              dbms_output.put_line ('SELECT ''Remote'' "LOCATION",');
              FOR i IN 1..v_piece_count LOOP
                dbms_output.put_line (v_column_pieces(i));
              END LOOP;
              dbms_output.put_line ('FROM "' || r1.table_name || '"@&dblink');
              dbms_output.put_line ('MINUS');
              dbms_output.put_line ('SELECT ''Remote'' "LOCATION",');
              FOR i IN 1..v_piece_count LOOP
                dbms_output.put_line (v_column_pieces(i));
              END LOOP;
              dbms_output.put_line ('FROM "' || r1.table_name || '"');
              dbms_output.put_line (');');
              v_diff_count := v_diff_count + 1;
            END IF;
          EXCEPTION
            WHEN OTHERS THEN
              -- An error occurred while processing this table. (Most likely it
              -- doesn't exist or has fewer columns on the remote database.)
              -- Show the error we encountered on the report.
              dbms_output.put_line (r1.table_name || ' - ' || SQLERRM);
              v_error_count := v_error_count + 1;
          END;
        END IF;
      END LOOP;
      -- Print summary information.
      dbms_output.put_line ('-------------------------------------------------');
      dbms_output.put_line
      'Tables examined: ' || TO_CHAR (v_same_count + v_diff_count + v_error_count)
      dbms_output.put_line
      'Tables with data discrepencies: ' || TO_CHAR (v_diff_count)
      IF v_warning_count > 0 THEN
        dbms_output.put_line
        'Tables with warnings: ' || TO_CHAR(v_warning_count)
      END IF;
      IF v_error_count > 0 THEN
        dbms_output.put_line
        'Tables that could not be checked due to errors: ' || TO_CHAR(v_error_count)
      END IF;
      dbms_sql.close_cursor (v_cursor);
    END;I hope , it ' ll help you...!!!!
    Regards,
    Simon

  • Table Comparison Performance

    Anyone has experience with using table comparison transforming for large volume data, e.g. 10M records.
    How is the performance?
    Any experience and suggestions is welcome.

    Performance will depend on a lot of factors, but the two big ones are:
    1. how many columns you are using in your compare (more columns will be slower)
    2. how you do the compare (sorted input is WAY faster than row comparison)
    Without knowing any details about your data or the process you are trying to implement it's difficult to make any additional recommendations.  But keep in mind that there are other options - especially for really big data sets.
    For example, you can always use a two step process that first deletes existing records matching the incoming set of primary keys, and then do a straight insert of the rows.   This will avoid the whole comparison step - and avoid doing updates which are much slower than inserts.
    However, this only works if you are replacing the existing records.  It wouldn't work if your table compare is part of a type 2 dimension load or something that requires you to track history.

  • Select non matching records

    version 10.2.0.2
    Create table A (f1 varachar2(10),f2 varachar2(10),f3 varachar2(10),f4 varachar2(10),update_date sysdate)
    Create table A (f1 varachar2(10),f2 varachar2(10),f3 varachar2(10),f4 varachar2(10),sp_key vrachar2(2),update_date sysdate)
    insert into a values ('a123','fdds','sas','sdss',sysdate)
    insert into a values ('a124','fdsds','fsas','sds',sysdate)
    insert into a values ('a125','pqx','dll','com',sysdate)
    insert into b values ('a124','fdsds','fsas','sds','C',sysdate)
    output table
    Create table A_out (f1 varachar2(10),f2 varachar2(10),f3 varachar2(10),f4 varachar2(10),update_date sysdate)
    output set :
    a123,fdds,sas,sdss,sysdate
    a125,pqx,dll,com,sysdate
    please note joininh will be done on f1...so so i need to select the non matching receords only present in table a.

    Hi,
    Also, test (and, if necessary, correct your CREATE TABLE and INSERT statemnets before you post them.
    1003545 wrote:
    Create table A (f1 varachar2(10),f2 varachar2(10),f3 varachar2(10),f4 varachar2(10),update_date sysdate)Maybe you meant to use the data types VARCHAR2 and DATE.
    ... please note joininh will be done on f1...so so i need to select the non matching receords only present in table a.If you're going to use a join (and a join is one good way to solve this problem) make it an OUTER join.

  • Listing foreign keys with non matching column definitions

    Dear All,
    I seen an entry in DBA weeky activities s that "Listing foreign keys with non matching column definitions" . What is meant by that?. How to pick up that?
    Shiju

    I seen an entry in DBA weeky activities s that
    "Listing foreign keys with non matching column
    definitions" . What is meant by that?. How to pick up
    that?Most probably find columns which are part of foreign keys, but their respective primary key column have different length (AFAIK data type cannot be different).
    Data dictionary can help you in that, I'll give you hints where to look at:
    user/all/dba_constraints - foreign and primary keys
    user/all/dba_cons_columns - columns which are part of constraints
    user/all/dba_tab_columns - column definitions of tables
    However creating query from these data dictionary views could be a nice task for you :)
    Gints Plivna
    http://www.gplivna.eu

  • How I can back up my data from macbook pro that its hard drive seems to die soon?

         I need your help guys from the whole world.
    I am now in Erbil (North Iraq) and there is no apple authorized resellers or anyone who can fix macs, they can destroy them as they try to repair it ( this is what happened      to me recently with My I phone and I pad). So I am left alone to fix it with your global help I hope.
    The issue is, I didn't do back up on my mac book pro for over  a year. I woke up 3 days ago, switched my mac and there was this funny pinc ponc noise coming from the lower right hand side of my mac (between track pad and keyboard), the computer was going slow and I wasnt able to do anything even after few restarts. It is always too slow to perform anything and this noise always start after few seconds of starting and keep going. the computer can still function very well on guest account *(safari only) and I don't hear the noise then nor when I press T. But if I try to log in to all my drive or in safe mode I get this noise and none function computer. when I went to disk utility there was message in red to back up my data immediately and take the hard drive to authorized service center.
    I checked on internet, you tube  and others..and it seems I have faulty hard drive. Since I am here alone and no service center so I think I will replace it myself. But first thing first i need to back up my precious data. I found few ways of doing this and I wonder if you can give me some tips, advise or any other method to do the back up.
    1) Transfer data on target mode:  I havent done this before but I am thinking to connect my faulty macbook pro to another with firewire, pressing T on the faulty Mac and install Super Duper on the other mac. Then I connect external hard drive to the working mac via USB. And the question is     :      can I transfer the files this way to an external bootable hard drive connected to the working mac     , so the working mac will function as bridge between faulty mac and external hard drive. Also can I do this process through my old none intel based power book(which I am using now)  instead of borrowing macbook from friend?
    2) Buy new hard drive, open my mac and replace the faulty one. then put the faulty one in external inclosure, connect to refurbished mac and transfer data back. Can I do this? will I need to install the mac os from the CD associated with it before I do transfer?
    Is there any other way to do this please?

    Jassos wrote:
    Hi PlotinusVeritas
    where do I download the superdoper please?
    http://www.shirt-pocket.com/SuperDuper/superduperdescription.html
    its here:   
    Download the free trial now!
    This simple software is free and very easy to use, yes, it makes a 100% clone of ALL on your HD, everything.
    (assuming its not so dead it wont copy).
    you only need the free trial version to clone your HD.
    can I download it on guest account? this one I can login and seems to function fine.
    Then install same on your guest account, that wouldnt matter, since Superduper clones everything (except the recovery partition which you dont need in your case right now).
    LaCie is Seagate (lacie doesnt make HD) , yes, that would be fine,  clone your HD ASAP and hope it works.
    there is no software fix for HD hardware failure, ......this is why a backup copy of data is so very important all the time, period.

  • Creating a Crystal Report from a non-SAP data base

    I have the following scenario
    server1\myDataBase
    server1\SAP\sapDataBases
    in sapDataBases I have about 30 company databases. I am trying to create a report, that gets informatino from a table/view/SP from server1\myDataBase, when I try to PREVIEW or SAVE such report on SAP Business One, I always get errors as
    I understand that this eerror means taht I can't invoke the data from out of SAP; it needs to be inside SAP (at least the SP, incoking some other data bases and stuff..)
    Some bodies have told me that it is beacuase I can only create a report from a table/view/sp that resides in the running/currently SAP company database. Is this right?
    Also, If this is the case, this means that If I have an SP taht I use for a crystal report, and 30 companies, I have to create such SP in the 30 companies?
    This is my software details:
    SQL Server 2012
    SAP Business One 9 PL 11
    SAP BusinessObjects Crystal Reports 2013 Support Pack 2 version 14.1.2.1121
    What I want to do is to create a non-SAP data base to create all the SPs/Views for reports, to centralize it, and the just create one reporte and do the 30-imports in each company database, without the need of creating such sps/views in each company-database. Is this possible?
    Thanks

    Moved to Integration Kit forum.
    The people in this forum will know more about the data structure than the CR Design forum which typically doesn't know much about the SAP Data sources Structure.
    Don

  • How can I force Time Machine to make a complete backup of my Hard Drive.  I just installed a new external drive for Backup since my previous one failed.  Now when I back up, Time Machine only backs up my data folder and the Users folder.

    How can I force Time Machine to make a complete backup of my Hard Drive.  I just installed a new external drive for Backup since my previous one failed.  Now when I back up, Time Machine only backs up my data folder and the Users folder.
    When I start a backup. Time Machine says "Oldest Backup: None; Latest Backup: None", so it seems like it should do a complete backup, but it only does a partial. 

    Hi I'd like to jump in here. Your app showed me this:
    Time Machine:
              Skip System Files: NO
              Mobile backups: OFF
              Auto backup: YES
              Volumes being backed up:
                        Macintosh HD: Disk size: 749.3 GB Disk used: 453.81 GB
              Destinations:
                        Plastic Wrapper [Local] (Last used)
                        Total size: 999.86 GB
                        Total number of backups: 64
                        Oldest backup: 2013-07-24 23:25:11 +0000
                        Last backup: 2013-11-17 01:40:47 +0000
                        Size of backup disk: Too small
                                  Backup size 999.86 GB < (Disk used 453.81 GB X 3)
              Time Machine details may not be accurate.
              All volumes being backed up may not be listed.
              /sbin excluded from backup!
              /usr excluded from backup!
              /System excluded from backup!
              /bin excluded from backup!
              /private excluded from backup!
              /Library excluded from backup!
              /Applications excluded from backup!
    Aside from the size of my backup drive, which I will increase at some point, I'd really like to have time machine backing up all system folders, especially Applications. How to I reset this hidden exclusions?
    Thanks,
    Darcy

  • AddOnsLocalRegistration.sbo file does not match data in the common datab...

    We are receiving the following error everytime we logon our pc for the first time: Add-On Outlook_Integration: This Add-on cannot be upgraded. AddOnsLocalRegistration.sbo file does not match data in the common database for this add-on. See SAP Note 1323680 for more information.
    A few months ago, SBO Server was moved from one server to a new virtual server, but we had no problems with the addons. The other day, we upgraded from SBO 2007 to 8.8 and now we are having problems with the Outlook Integration.
    I have followed the directions in the message noted above, and did find the AddOnsLocalRegistration.sbo file in some odd places, with a reference to the old server. I cleaned this up, on the server and the client and I can get it running...however, after the user shuts down the pc and logs back in the next day, the problem is back.
    In the process of cleaning this up (un-registering the addon and removing the addon references in the local .sbo file) I noticed at times that we would still receive this error, when there really shouldn't be an reference to it.
    Thanks for any help.

    Hi Vaughn.........
    I guess you need a re installation of Outlook Integration Addon.
    Whatever version addon of OI you installed just uninstall it and Install it freshly from 8.8 setup package......
    Regards,
    Rahul

Maybe you are looking for