Error using minus operator

table a
=========
id (number),name varchar2,dt date
10,'aaa','01-01-2006'
11,'bbb','01-01-2007'
table b
======================
id varchar2,name varchar2,dt varchar2
'10','aaa','01-01-2006'
is it possible to find out which row is not in table b but it is in table a
i have tried out using minus operator but it return error (ora-01790-expression must have same datatype.

ora-01790-expression must have same datatypeAnd what is it precisely is it about that error message which is confsuing you?
SQL> select 1 from dual
  2  minus
  3  select dummy from dual
  4  /
select 1 from dual
ERROR at line 1:
ORA-01790: expression must have same datatype as corresponding expression
SQL> select to_char(1) from dual
  2  minus
  3  select dummy from dual
  4  /
T
1
SQL> Cheers, APC

Similar Messages

  • Error using CS Operator

    Hi all,
    I m generating an report in which i have to display Vendor code and vendor name, against some short description of name entered in selection screen.
    For this i use cs operator , but it is showind an error
    "CS" is not a valid comparison operator.          
    if s_lifnr is not initial .
        select lifnr bukrs  from lfb1
        into table i_lfb1
        where  lifnr in  s_lifnr
        and ( bukrs eq p_bukrs ).
      if i_lfb1[] is not initial.
      select  lifnr name1
      from   lfa1
      into  corresponding fields of table i_lfa1
      for all entries in i_lfb1
      where lifnr =  i_lfb1-lifnr
           and ( name1 cs s_name1 ).
    endif.
    Can anybody tell me where i m wrong.
    Definitely rewards pts.
    Best regards,
    Aastha Gupta

    Thanks Keshu,
    I m stuck up in b/w while generating that report.
    No data is coming in my internal table i_lfb1, if i m giving input only the lifnr.
    if s_name1 is not initial or s_lifnr is not initial or p_bukrs is not
    initial.
    Can u resolve this  1 too.
        select lifnr bukrs  from lfb1
        into table i_lfb1
        where  lifnr in  s_lifnr
        and ( bukrs = p_bukrs ).
      if i_lfb1[] is not initial.
      select  lifnr name1
      from   lfa1
      into  corresponding fields of table i_lfa1
      for all entries in i_lfb1
      where lifnr =  i_lfb1-lifnr.
      loop at i_lfa1.
      check i_lfa1-name1 cs s_name1.
      append i_lfa1.
      endloop.
    endif.
    if i_lfa1[] is not initial.
      select  lifnr ekorg
      from   lfm1
      into  corresponding fields of table i_lfm1
    for all entries in i_lfa1
    where lifnr = i_lfa1-lifnr
          and ( ekorg eq p_ekorg ) .
    endif.
    if i_lfa1[] is not initial.
      select  werks ekorg
      from   t024w
      into  corresponding fields of table i_t024w
    for all entries in i_lfm1
    where  ekorg = i_lfm1-ekorg
         and ( werks eq p_werks ).
    endif.

  • Error using filter operator

    Hi
    I am working in a mapping that has a text file as input and a table as output, and I want to insert a filter between them, so I dragged the filter operator to the screen.
    But when I try to connect the input file to the filter (dragging the file operator group or any field to the INOUTGRP1 filter group) it gives me a "API402 - Invalid character" error message.
    What can be the problem?
    Thanks!
    lc

    Luis,
    I have just tried your scenario in the newest version of Warehouse Builder (9.0.3.35.0) and I can create a mapping like this:
    FILE --- Filter --- TARGETTABLE
    My filter condition is on C1 (C1 = 1) which is used in the WHEN clause
    When generating this is the result:
    PTIONS ( DIRECT=TRUE,PARALLEL=FALSE, ERRORS=50, BINDSIZE=50000, ROWS=200, READSIZE=65536)
    LOAD DATA
    CHARACTERSET WE8MSWIN1252
    INFILE 'c:\XWeek\SourceFiles\Order_status_list.txt'
    READBUFFERS 4
    INTO TABLE "MYTAB"
    APPEND
    REENABLE DISABLED_CONSTRAINTS
    WHEN
    "C1" = 1
    FIELDS
    TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    "C1" POSITION (1) CHAR ,
    "C2" CHAR
    Which version of Warehouse Builder are you using?
    Thanks,
    Jean-Pierre

  • Count number of rows for TWO QUERIES USING MINUS OPERATOR

    I have the following piece of sql, i would like to know how could i programatically using plsql count the number of rows returned by the following statement. I know that %ROWCOUNT returns the rowcount for the last execute INSERT, UPDATE, DELETE and SELECT INTO statement. Any help is much appreciated thanks.
    select *
    from admt1m4.usr@tcprod u
    where u.authoriztion = 'Omf99FullUsage'
    and u.obid in (select right from admt1m4.usrtogrp@TCPROD ug where ug.left in
    (select obid from admt1m4.usrgrp@tcprod g 
    where g.participant not in ('super user grp', 't1_WbsPSAnalystGrp')))
    and u.activeuser = '+'
    MINUS
    select *
    from admt1m4.usr@TCPROD u
    where u.authoriztion = 'Omf99FullUsage'
    and u.obid in (select right from admt1m4.usrtogrp@TCPROD ug
    where ug.usrgrpname in ('super user grp', 't1_WbsPSAnalystGrp'))
    and u.activeuser = '+'

    Hi,
    Have you tried
    SELECT COUNT (1) cnt
      FROM (SELECT *
              FROM admt1m4.usr@tcprod u
             WHERE u.authoriztion = 'Omf99FullUsage'
               AND u.obid IN (
                      SELECT RIGHT
                        FROM admt1m4.usrtogrp@tcprod ug
                       WHERE ug.LEFT IN (
                                SELECT obid
                                  FROM admt1m4.usrgrp@tcprod g
                                 WHERE g.participant NOT IN
                                          ('super user grp', 't1_WbsPSAnalystGrp')))
               AND u.activeuser = '+'
            MINUS
            SELECT *
              FROM admt1m4.usr@tcprod u
             WHERE u.authoriztion = 'Omf99FullUsage'
               AND u.obid IN (
                      SELECT RIGHT
                        FROM admt1m4.usrtogrp@tcprod ug
                       WHERE ug.usrgrpname IN
                                         ('super user grp', 't1_WbsPSAnalystGrp'))
               AND u.activeuser = '+')or your requirement is something else...
    *009*

  • Issue with query using minus operation

    Hello All,
    I have data set of all organization numbers like as below
    Dataset:
    ('528801','528802','536101','536102','100601','536401','536402','530701','536501','536502','540501','599101','133301',
    '531101','143101','536601','536602','534401','535501','535401','536801','536802','531001','537501','537502','540601','540801','528401')
    And i also have a table W_INT_ORG_D where in it has column like ORG_NUM which holds the organization numbers in the database, now i am trying to find out the exclusive organization numbers in the data set that does not exist in W_INT_ORG_D using some oracle sql query.
    Below is the sql i wrote though my query is wrong probably you could able to understand what i am trying to say or achieve, i am not ok with creating another table and filling in the data and later compare both tables, i want to do that without creating any extra table. Please let me know if you have any idea to do this, appreciate your time.
    Query:_
    WITH ABC AS
    ('528801','528802','536101','536102','100601','536401','536402','530701','536501','536502','540501','599101','133301',
    '531101','143101','536601','536602','534401','535501','535401','536801','536802','531001','537501','537502','540601','540801','528401')
    SELECT DISTINCT ORG_NUM
    FROM W_INT_ORG_D, ABC
    WHERE DATASOURCE_NUM_ID='211'
    AND ORG_NUM IN
    ('528801','528802','536101','536102','100601','536401','536402','530701','536501','536502','540501','599101','133301',
    '531101','143101','536601','536602','534401','535501','535401','536801','536802','531001','537501','537502','540601','540801','528401')
    MINUS
    SELECT * FROM ABC
    Thanks,
    Sam

    This wil give a list of organization numbers in dataset that are not present in the view:
    SELECT column_value org_num
       FROM TABLE(sys.odciVarchar2List(
                                       '528801',
                                       '528802',
                                       '536101',
                                       '536102',
                                       '100601',
                                       '536401',
                                       '536402',
                                       '530701',
                                       '536501',
                                       '536502',
                                       '540501',
                                       '599101',
                                       '133301',
                                       '531101',
                                       '143101',
                                       '536601',
                                       '536602',
                                       '534401',
                                       '535501',
                                       '535401',
                                       '536801',
                                       '536802',
                                       '531001',
                                       '537501',
                                       '537502',
                                       '540601',
                                       '540801',
                                       '528401'
    MINUS
    SELECT  DISTINCT ORG_NUM
       FROM  W_INT_ORG_D
       WHERE DATASOURCE_NUM_ID='211'
    /SY.
    Edited by: Solomon Yakobson on Jun 29, 2009 10:49 AM

  • Error while doing MINUS operation

    Hi ,
    i am using MINUS operation.I am getting the error
    *State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 59019] All of the input streams to the Union operator should have an identical number of columns and union compatible data types. (HY000)*
    I used same data type and i checked with rpd also its working fine.Where is the problem .Can any one help me out??
    Thanks,
    Saichand.V

    hi,
    Thanks for u quick response
    Those are from two Different tables.in Fx i didn't used any operations.Just pulled certain columns.one column is prompted in both the reports.

  • MINUS Operator in OBIEE 11g

    Hi all ,
    I have a requirement to use MINUS operator in a column of a report . Since it is available for two separate criteria , Could someone suggest how to perform the same in OBIEE 11g for a column.
    the conditions to be implemented in a column are
    select count(*) from ( 
    select distinct trx.shipment_header_id
    from   
    F_ERP_PO_RECEIPTS_TRX trx
    where   trx.transaction_type = 'RECEIVE'
    MINUS
    select distinct rec.shipment_header_id
    from   
    where   trx.transaction_type = 'DELIVER').
    How can i perform these conditions for a column of a report .
    Reg,
    Niv D

    Hi Niv D,
    I guess this can be done as we have union, union all and minus available.
    once you select the required subject area say SA for the below query,
    select distinct trx.shipment_header_id
    from 
    F_ERP_PO_RECEIPTS_TRX trx
    where   trx.transaction_type = 'RECEIVE'
    on the right side of the criteria you can see a + symbol with venn diagram. once you click on it, it gives you an option to select the next SA for
    select distinct rec.shipment_header_id
    from 
    where   trx.transaction_type = 'DELIVER').
    once you selected that, you can see the criteria changes accordingly.
    there you change to union or minus.
    once you have the conditions for both, make the layout as pivot and apply count on the column. you are there with the result,
    I tried earlier with union but not with minus. but this should work.
    Regards,
    KN
    ebs2obiee.wordpress.com

  • MINUS operator fetches invalid record count

    Hi,
    One of the application team complained that oracle MINUS operator fetches an invalid record count after data load.
    Here are the details of the data load:
    They are using source as PROD and target as UAT.
    They are replicating the data on UAT environment in schema A from fetching the data in PROD from the same schema.
    After load when we query the count of records in UAT it shows more records in target, that is in UAT, than PROD.
    When they use MINUS operator to fetch the extra records in UAT, it shows no rows selected.
    SQL> select 'A' count(1) from A.UAT union all select 'A' count(1) from A.PROD@BISLSPD1;
    A COUNT(1)
    A.UAT 19105022
    A.PROD 19104995
    SQL> select distinct count(*) from (select distinct DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.UAT minus select distinct DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.PROD@BISLSPD1);
    COUNT(*)
    0
    SQL> select distinct DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.UAT minus select distinct DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.PROD@BISLSPD1
    no rows selected
    Please note that both are partitioned tables and they are using Informatica Data Replication 9.5 tool to populate the data from source to target.
    Not sure if this could be a bug or an issue.
    PROD DB Version: 10.2.0.5
    UAT DB Version: 10.2.0.5
    Both are in Linux 2.6
    Please throw some light on this.

    974065 wrote:
    SQL> select 'A' count(1) from A.UAT union all select 'A' count(1) from A.PROD@BISLSPD1;
    A                  COUNT(1)
    A.UAT                     19105022
    A.PROD                   19104995
    SQL> select distinct count(*) from (select distinct  DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.UAT minus select distinct DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.PROD@BISLSPD1);
    COUNT(*)
    0
    SQL> select distinct  DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.UAT minus select distinct DW_DISCOUNT_KEY, DW_DISCOUNT_MODIFIER_KEY from A.PROD@BISLSPD1
    no rows selected
    Given that you've go "distinct" in your query, you're eliminating duplicates from each table (and MINUS implicitly means distinct anyway). Check for duplicates (of dw_discount_key, dw_discount_modifier_key) in both tables.
    If the combination is actually unique, I would check that you actually had the raw results the right way round - MINUS is not symmetrical, and for a complete picture you need to look at (select from uat minus select from prod) union all (select from prod minus select from uat)
    Regards
    Jonathan Lewis

  • Error while using between operator with sql stmts in obiee 11g analytics

    Hi All,
    when I try to use between operator with two select queries in OBIEE 11g analytics, I'm getting the below error:
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Location: saw.views.evc.activate, saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool.socketrpcserver, saw.threads
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 27002] Near <select>: Syntax error [nQSError: 26012] . (HY000)
    can anyone help me out in resolving this issue.

    Hi All,
    Thank u all for ur replies, but I dint the exact solution for what I'm searching for.
    If I use the condition as
    "WHERE "Workforce Budget"."Used Budget Amount" BETWEEN MAX("Workforce Budget"."Total Eligible Salaries") AND MAX("Workforce Budget"."Published Worksheet Budget Amount"",
    all the data will be grouped with the two columns which I'm considering in the condition.
    my actual requirement with this query is to get the required date from a table to generate the report either as daily or weekly or monthly report. If I use repository variables, variables are not getting refreshed until I regenerate the server(which I should not do in my project). Hence I have created a table to hold weekly start and end dates and monthly start and end dates to pass the value to the actual report using between operator.
    please could anyone help me on this, my release date is fast approaching.

  • Error (Error when starting a SWITCH branch) while using container operation

    HI Experts,
    I am using container operation step for moving internal table (ref to sflight) to workarea.The error I found in the log is ' Error when starting a SWITCH branch'.Kindly help me in finding the solution.Below are the steps and code.
    Result Element = lw_sflight             (Element ref to sflight with export and Import)
    Assignment     =    =                     (Assign (contents of table are deleted first)
    Expression      = &FLIGHT&             (Multi line container ref to sflight)
    Operator          = Assignment
    Expression      =                                 (Blank)
    Thanks and Regards,
    Srini

    Hello,
    Maybe you should show more information about the condition step instead of the container operation step.
    A previous poster in SDN said they solved their problem by changing the order of the conditions.
    regards
    Paultje Bakker
    Hanabi Technology

  • Error Handling while using Batch Operation

    Hi Experts,
    I am trying to update document with multiple successful items using batch operation with single changeset and document is updating successfully.
    But when i am trying to update document with multiple unsuccessful items, I am getting error saying " HTTP/1.1 500 Internal Server Error" .
    If it is for a single unsuccessful item,i am able to get the error message as return parameter, but i am not able to get the error messages as return parameter  if it is for multiple(more than one item) unsuccessful items.
    Could you please let me know your thoughts on this.
    Thanks,
    Syam

    Yes: I can.
    Provided someone provides version information
    Provided someone identifies specific API's
    Provided someone defines what conversions they are referring to.
    After you've defined the problem go to metalink or tahiti and look up the answer yourself.

  • Use of double Minus operator....

    Hi ,
    I have a situation where i need to use the minus operator in such a way that:
    <sql_statement_A>
    Minus
    <sql_statement_B>
    Minus
    <sql_statement_C>
    The resulting row set will return rows from sql_statement_A minus rows from sql_statement_B or sql_statement_A minus rows from sql_statement_C... Is the above sql pattern is correct....or , do i need to write two views
    <sql_statement_A>
    Minus
    <sql_statement_B>
    and
    <sql_statement_A>
    Minus
    <sql_statement_C>
    and one third making Union of the two above...????
    many thanks,
    Simon

    If in doubt, use parentheses to make them run the way you want.
    So..
    (<sql_statement_A>
    minus
    <sql_statement_B>)
    minus
    <sql_statement_C>
    Just like OR conditions in the where clause, grouping with parentheses will greatly help those who come later to maintain it. And this looks simpler and more efficient than using two minus operations and combining the result.

  • Using the minus operator

    I am very new to oracle and am working with the minus operator to run a query. I could use some help!
    Here is the query I am working on:
    select suppliername, partname
    from quote
    where partname = 'hammer'
    minus
    select suppliername, partname
    from quote
    where partname = 'hammer';
    HOW DO I GET THE QUERY TO DISPLAY ONLY THE ROWS OF SUPPLIERNAMES THAT SUPPLY ONLY HAMMERS?
    I WOULD GREATLY APPRECIATE SOME CLARIFICATION.

    HOW DO I GET THE QUERY TO DISPLAY ONLY THE ROWS OF SUPPLIERNAMES THAT SUPPLY ONLY HAMMERS?It may, for some data related reason, give you the result you were expecting, but this query does not answer that question because you have included partname in the MINUS.
    E.g.
    WITH quote AS
    (SELECT 'BOB'  suppliername, 'HAMMER' partname FROM DUAL UNION ALL
    SELECT 'BOB'  suppliername, 'SPANNER' partname FROM DUAL UNION ALL
    SELECT 'TIM'  suppliername, 'HAMMER' partname FROM DUAL UNION ALL
    SELECT 'JACK' suppliername, 'HAMMER' partname FROM DUAL)
    SELECT suppliername, partname
    FROM   quote
    MINUS
    SELECT suppliername, partname
    FROM   quote
    WHERE  partname != 'HAMMER';
    SUPPLIERNAME PARTNAME
    BOB          HAMMER  
    JACK         HAMMER  
    TIM          HAMMER   Clearly this is wrong because Bob supplies spanners (aka wrench).
    However:
    WITH quote AS
    (SELECT 'BOB'  suppliername, 'HAMMER' partname FROM DUAL UNION ALL
    SELECT 'BOB'  suppliername, 'SPANNER' partname FROM DUAL UNION ALL
    SELECT 'TIM'  suppliername, 'HAMMER' partname FROM DUAL UNION ALL
    SELECT 'JACK' suppliername, 'HAMMER' partname FROM DUAL)
    SELECT suppliername
    FROM   quote
    MINUS
    SELECT suppliername
    FROM   quote
    WHERE  partname != 'HAMMER';
    SUPPLIERNAME
    JACK        
    TIM          Amongst the many alternatives - NOT EXISTS:
    WITH quote AS
    (SELECT 'BOB'  suppliername, 'HAMMER' partname FROM DUAL UNION ALL
    SELECT 'BOB'  suppliername, 'SPANNER' partname FROM DUAL UNION ALL
    SELECT 'TIM'  suppliername, 'HAMMER' partname FROM DUAL UNION ALL
    SELECT 'JACK' suppliername, 'HAMMER' partname FROM DUAL)
    SELECT *
    FROM   quote q1
    WHERE  NOT EXISTS (SELECT 1
                       FROM   quote q2
                       WHERE  q2.suppliername = q1.suppliername
                       AND    partname != 'HAMMER');
    SUPPLIERNAME PARTNAME
    JACK         HAMMER  
    TIM          HAMMER  

  • InputListOfValue with ViewCriteria using between operator giving error.

    So i am using inputlistofvalues with ViewCriteria.In ViewCriteria i am using between operator for a date(CreDttm) field.
    when i click on search icon,it takes me to search popup and i give range of date and click search it give me result correctly and when i select a row and click ok,it take me to parent page but give error that "Credttm is required"...its Readonly Vo. If i use equal operator on same it works fine.
    Am i doing something wrong?
    Any help will be appreciated!
    Thanks

    its better to say which jdev version you are using..
    what is 'Credttm' atttribute is associated with.. is it the inputComboboxlitof values.. is this happening when you set the autsubmit=false for the inputcombolov? whe exactly are you seeing this error..

  • Error msg This operation requires that Microsoft Professional 2013 is installed when using Sharepoint 2013

    Hi,
    I've recently installed Microsoft Project Professional 2013 and was successful at updating a SharePoint task list from within Project. However if I click on the Task list in SharePoint 2013 I get the error message; "This operation requires that Microsoft
    Project Professional 2013 is installed." Of course I have Project Pro installed and I've even tried repairing the installation but the problem remains. Has anyone seen this problem before? Any ideas on how to fix it?
    Thanks in Advance,
    Mark E.
    SharePoint 2013 Online (Office 365)
    Microsoft Project Professional 2013
    Windows 7 Home
    Learning SharePoint

    Same here with SharePoint Online under an E3 license.
    I tried reinstalling MS Projects Pro, I get the same message... it does work if I use Google Chrome so the problem is likely with IE (I am using the latest version with updates applied)... seems to be related to some IE handler behind the scenes... any idea
    how to correct this?
    Note that this worked fine for a year until a couple of days ago (there must have been an update that messed up things)...
    MS, please help...
    Thank you,
    Paul A.

Maybe you are looking for

  • How do I print or export only selected cells in Numbers?

    Does anyone know how to do this in Numbers? I have been trying to do this for well over an hour...... I have looked at other posters' questions first, all the way back to 2008 in fact. The closest I have seen to an answer (and it is a workaround, not

  • External Hard drive Died - Best way to restore library

    The External Hard drive where I stored all my iTunes files has died and I am unable to retrieve any files. Every thing is on my iPod whats the best way of geting the library & playlists back into iTunes?

  • Group Sort on formula field

    I am using CR Professional 11.5 on Windows XP/Progress platform. I have a formula field that calculates the GM% on the Employee Group Footer level and want to sort the employees in descending order by GM%.  I have gone in circles trying to calculate

  • Hp mini 110-1115nr

    is there a way to upgrade the mini 110-1115NR Broadcom 802.11B/G to 802.11B/G/N

  • Regarding excel file download from webdynpro table element

    Hi All,         I want steps to do excel download from webdynpro table element. Thanks in advance. Regards, Muneesh Gitta.