• RELEVANCY SCORE 3.42

    DB:3.42:Comparing Substr Values Of Two Columns 8s




    Say you have a table with 3 columns:
    *Unique random-generated id,
    *First name
    *Mailing name

    I need to find all the rows where the mailing name does not contain the value of the first name column.

    The "like" operator (only used with where clause) doesn't seem to work because what you want to do is:
    select * from table
    where [first_name is *not* found in *part of* (it will never be exact match) the mailing_name]

    What's the correct where clause?

    Any help is appreciated. Thanks

    DB:3.42:Comparing Substr Values Of Two Columns 8s

    How about
    select * from table1 where col3 not like '%'#0124; #0124;col2#0124; #0124;'%'

    Of course you can switch to use the minus operator instead of not like if performance becomes an issue.

  • RELEVANCY SCORE 3.22

    DB:3.22:Re: Populating Two Emtpy Columns With Values From One Column(All In Same Table) az




    update accounts set prefix,suffix= substr(acctnum, 1, instr(acctnum,'-')-1) , substr(acctnum, instr(acctnum, '-')+1)

    DB:3.22:Re: Populating Two Emtpy Columns With Values From One Column(All In Same Table) az

    Solomon Yakobson wrote:

    Why not simply:

    UPDATE accounts a
    SET prefix = Substr(acctnum, 1, Instr(acctnum, '-') - 1),
    suffix = Substr(acctnum, Instr(acctnum, '-') + 1)
    /And, in fact, your query is not just inefficient - it will fail if AcctNum is not unique.

    SY.This is a better code.

    My error was making the prefix and suffix commands SELECT statements.

  • RELEVANCY SCORE 3.14

    DB:3.14:... Comparing Two Tables 1a




    Dear All
    I have a table A which contain around 180 columns.
    Table B has the similar structure to A with similar number of records( same primary key values).

    Now i want ot compare these two tables so that i know for which rows, how many columns have different values.

    Suppose primarykey/ record 2 of both table for column Number_of_teachers
    may differ.

    How can we compare. Do we need to write a Procedure for that and if yes , if anybody can give us a clue as to how we compare it in loop.

    Thanks alot for your kind responses

    Regards

    DB:3.14:... Comparing Two Tables 1a

    http://www.oracle.com/technology/oramag/code/tips2003/122103.html

  • RELEVANCY SCORE 3.08

    DB:3.08:Sql Query 83


    hi,
    I am using two tables named GL_OB (For Opening balance) and GL_Transaction (For every Transaction details)
    TABLE
    GL_OB(
    GL_DATE DATE NOT NULL,
    ACCOUNTNO VARCHAR2(14) NOT NULL,
    OPENING_BAL NUMBER(15,2) DEFAULT 0,
    GEN_DT DATE NOT NULL,
    CONSTRAINT PK_GLOB PRIMARY KEY (ACCOUNTNO,GL_DATE,GEN_DT)

    TABLE
    GL_CLUB(
    GL_DATE DATE,
    VOUCHER_NO VARCHAR2(5),
    ACCOUNTNO VARCHAR2(14) NOT NULL,
    BR_BANK VARCHAR2(4),
    DESCRIPTION VARCHAR2(35),
    EMP_CODE VARCHAR2(6),
    CR_AMT NUMBER(15,2),
    DR_AMT NUMBER(15,2))

    Chart of Account code with 14 character and 9 character

    Chart of account-(14 characters w/o any space in between) 800 15 44 12 40 221

    First 3 character represents -ContraCode(800)
    4th 5th Character Represents-Division code(15)
    6th 7th Characters Represents-section code(44)
    8th 9th characters represents- Activity code(12)
    10th 11th characters represents -station code(40)
    12th to 14 th character represents Account code(221)

    * 14 character chart of account will always start either with '7','8' or '9' character only

    9 character chart of account(W/O ANY SPACE IN BETWEEN)- 205 30 15 45

    First three characters represents -Account code(205)
    4rd 5th character represents -Division code(30)
    6th 7th character represents -section code(15)
    8th 9th character represents -station code(45)

    In 9 character chart of account Account is in First three character where as in 14 character chart of accounts account code is in 12th to 14 th characters.

    In 9 character chart of account station is at 8th 9th position
    where as in 14 character chart of accounts it is at 10th 11th position.

    I need a query which gives all detail records based on opening Balance which is against either account code and (division code or station code)
    I have written query which is not giving me all records, i am having problem with accountno starting with other than '7','8','9' where the opening balance is against accountcode and (division or station code)

    1)For example 3rd record in GL_OB has opening balance against '205' accountcode and '55' division' rest of the characters are 'zero' , now against this accountcode and division i need all the details data from GL_CLUB with same acount code ie '205' and division '55' rest of the characters can be anything it can have any section or station but i need to get the detail records based on account code and division from GL_CLUB. ie 1st record from GL_CLUB as given below

    2)Now taking 2nd record in GL_OB ie 205000000 accountno In this case I need all the records based on account code '205' ie i need to get 2nd ,3rd, 4th record from GL_Club
    3)Now taking 5th record of GL_OB ie 340000020 which has opening balance of 50000 against account code '340' and station as '20', In this case i need only the 5th record of GL_CLUB

    GL_OB Table Data (sample)
    gl_date gen_dt accountno opening_bal
    -------------------------------------------------------------------------------------
    02/06/2005 01/04/2005 000000000 200000
    23/07/2005 01/04/2005 205000000 600000
    22/06/2005 01/04/2005 205550000 400000
    30/07/2005 01/04/2005 340000000 300000
    23/07/2005 01/04/2005 340000020 500000
    03/05/2005 01/04/2005 70000000000000 100000
    12/05/2005 01/04/2005 70000000000346 200000
    04/05/2005 01/04/2005 77000000000112 300000
    20/04/2005 01/04/2005 80000000000000 500000
    03/04/2005 01/04/2005 80000000000210 200000
    22/05/2005 01/04/2005 87000000000345 400000
    30/05/2005 01/04/2005 90000000000245 700000
    02/05/2005 01/04/2005 90044000000000 800000

    GL_CLUB DATA (Sample)
    gl_date gen_dt accountno cramt dramt
    ------------------------------------------------------------------------------------------
    07/06/2005 01/04/2005 205551200 20000
    08/06/2005 01/04/2005 205662300 3000
    09/06/2005 01/04/2005 205771700 10000
    12/06/2005 01/04/2005 205000020 40000
    22/07/2005 01/04/2005 340000020 50000
    23/07/2005 01/04/2005 340221700 40000
    11/07/2005 01/04/2005 340001230 50000
    12/08/2005 01/04/2005 77022330020112 4000
    20/08/2005 01/04/2005 70032120030346 20000
    30/06/2005 01/04/2005 70043540020231 20000

    I have written query which is not retriveing all records
    (select
    go.gen_dt,gc.gl_date,
    gc.accountno,
    substr(go.accountno,4,2) div,
    substr(go.accountno,6,2) sec ,
    substr(go.accountno,4,2)||'/'||substr(go.accountno,6,2) divsec ,
    case when substr(go.accountno,1,1) in ('7','8')then
    substr(go.accountno,10,2) else
    substr(go.accountno,8,2) end stn,
    ( case when substr(go.accountno,1,1) in ('7','8') then
    substr(go.accountno,1,3) ||'/'||substr(go.accountno,4,4)||'/'||
    substr(go.accountno,12,3)
    else
    substr(go.accountno,1,3)||'/'||substr(go.accountno,4,4)||'/'||
    substr(go.accountno,8,2) end ) accno,
    (go.opening_bal) ,
    gc.voucher_no,
    gc.tr_code,
    ltrim(gc.sh_desc)shdesc,
    nvl(gc.cr_amt,0) CRAMT,
    nvl(gc.dr_amt,0) DRAMT,
    gc.emp_code_or_csrvno
    from
    gl_ob go,glclub gc

    WHERE

    (to_date(gc.gen_dt,'dd/mm/rrrr') between
    to_date('01/04/2005','dd/mm/rrrr') and
    to_date('31/03/2006','dd/mm/rrrr'))
    and
    (to_date(go.gen_dt,'dd/mm/rrrr') between
    to_date('01/04/2005','dd/mm/rrrr') and
    to_date('31/03/2006','dd/mm/rrrr'))

    and

    ( case when substr(go.accountno,1,1) in ('7','8') then
    substr(go.accountno,1,3)||substr(go.accountno,12,3)
    else
    substr(go.accountno,1,3)
    end
    )
    =
    ( case when substr(gc.accountno,1,1) in ('7','8') then

    substr(gc.accountno,1,3)||substr(rpad(gc.accountno,14,0),12,3)
    else
    substr(gc.accountno,1,3)
    end
    )

    and
    ( case when substr(go.accountno,1,1) in ('7','8') then
    substr(rpad(go.accountno,14,0),12,3)
    when substr(go.accountno,1,1) in ('9')then
    ( case when substr(go.accountno,8,2) not in ('00') then
    substr(go.accountno,8,2)
    else
    ( case when substr(go.accountno,1,3) not in ( select
    substr(accountno,1,3) from v_gl_ob group by substr(accountno,1,3) having count(*) 1) then (substr(go.accountno,1,3)||00000000000)
    else
    ( case when substr(rpad(go.accountno,14,0),8,2) '00' then substr(rpad(go.accountno,14,0),8,2) else
    (substr(go.accountno,1,3)||substr(go.accountno,8,2)) end ) end ) end )
    else
    ( case when substr(go.accountno,4,2) not in ('00') then
    substr(rpad(go.accountno,14,0),4,2)
    when substr(go.accountno,8,2) not in ('00') then
    substr(rpad(go.accountno,14,0),8,2)
    else
    ( case when substr(go.accountno,1,3) not in ( select
    substr(accountno,1,3) from v_gl_ob group by substr(accountno,1,3) having
    count(*) 1) then (substr(go.accountno,1,3)||00000000000)
    else
    ( case when substr(go.accountno,4,2) '00' then
    substr(rpad(go.accountno,14,0),4,2) when substr(rpad(go.accountno,14,0),8,2) '00' then
    substr(rpad(go.accountno,14,0),8,2) else (substr(go.accountno,1,5)||substr(go.accountno,8,2)) end ) end ) end )
    end)
    = (case when substr(go.accountno,1,1) in ('7','8')then
    substr(rpad(gc.accountno,14,0),12,3)
    when substr(go.accountno,1,1) in ('9')then
    ( case when substr(rpad(go.accountno,14,0),8,2) not in ('00') then
    substr(rpad(gc.accountno,14,0),8,2) else ( case when substr(go.accountno,1,3) not in ( select substr(accountno,1,3) from v_gl_ob group by substr(accountno,1,3) having count(*) 1)
    then (substr(gc.accountno,1,3)||00000000000)else
    ( case when
    substr(rpad(go.accountno,14,0),8,2) '00' then substr(rpad (gc.accountno,14,0),8,2) else
    (substr(gc.accountno,1,3)||substr(gc.accountno,8,2)) end ) end ) end )
    else
    (case when substr(rpad(go.accountno,14,0),4,2) not in
    ('00') then substr(rpad(gc.accountno,14,0),4,2) when substr(rpad(go.accountno,14,0),8,2) not in ('00') then
    substr(rpad(gc.accountno,14,0),8,2) else ( case when substr(go.accountno,1,3) not in ( select
    substr(accountno,1,3) from v_gl_ob group by substr(accountno,1,3) having
    count(*) 1) then
    (substr(gc.accountno,1,3)||00000000000) else ( case when
    substr(rpad(go.accountno,14,0),4,2) '00' then substr(rpad(gc.accountno,14,0),4,2) when substr(rpad(go.accountno,14,0),8,2) '00' then substr(rpad(gc.accountno,14,0),8,2)else
    (substr(gc.accountno,1,5)||substr(gc.accountno,8,2)) end )end ) end )end ))
    order by 8,
    gc.tr_code,go.gen_dt,gc.gl_date;

    In the above query i am having problem when the accountno starts with other than '7','8','9' and when the opening balance is against accountcode ie first three characters rest all are 'zero' In this case if i am making comparasion with first three characters in club then it includes the accountno with divisionno also which i shouldn't get.
    Do not concentrate on select columns just go through where clause, i need to refine my case so that it includes all records.
    If you have any further doubts do reply to this.

    Thanks
    Ram

    DB:3.08:Sql Query 83

    maybe you can try this

    rachmat
    --

    select
    go.gen_dt,gc.gl_date,
    go.accountno,
    gc.accountno,
    substr(go.accountno,4,2) div,
    substr(go.accountno,6,2) sec ,
    substr(go.accountno,4,2)||'/'||substr(go.accountno,6,2
    ) divsec ,
    case when substr(go.accountno,1,1) in ('7','8')then
    substr(go.accountno,10,2) else
    substr(go.accountno,8,2) end stn,
    ( case when substr(go.accountno,1,1) in ('7','8')
    then
    substr(go.accountno,1,3)
    ||'/'||substr(go.accountno,4,4)||'/'||
    substr(go.accountno,12,3)
    else
    substr(go.accountno,1,3)||'/'||substr(go.accountno,4,4
    )||'/'||
    substr(go.accountno,8,2) end ) accno,
    (go.opening_bal) ,
    gc.voucher_no,
    nvl(gc.cr_amt,0) CRAMT,
    nvl(gc.dr_amt,0) DRAMT
    from
    gl_ob go, gl_club gc
    WHERE
    --------- not in ('7','8','9')
    (
    case when substr(go.accountno,1,1) not in
    ('7','8','9')
    and substr(go.accountno,4,6) = '000000' then
    substr(go.accountno,1,3)
    end
    =
    substr(gc.accountno,1,3)
    )
    OR
    (
    case when substr(go.accountno,1,1) not in
    ('7','8','9')
    and substr(go.accountno,6,4) = '0000' then
    substr(go.accountno,1,5)
    end
    =
    substr(gc.accountno,1,5)
    )
    OR
    (
    case when substr(go.accountno,1,1) not in
    ('7','8','9')
    and substr(go.accountno,8,2) = '00' then
    substr(go.accountno,1,7)
    end
    =
    substr(gc.accountno,1,7)
    )
    OR
    (
    case when substr(go.accountno,1,1) not in
    ('7','8','9')
    then substr(go.accountno,1,9)
    end
    =
    substr(gc.accountno,1,9)
    )
    --------- in ('7','8','9')
    OR
    (
    case when substr(go.accountno,1,1) in ('7','8','9')
    and substr(go.accountno,4,11) = '00000000000' then
    substr(go.accountno,1,3)
    end
    =
    substr(gc.accountno,1,3)
    )
    OR
    (
    case when substr(go.accountno,1,1) in ('7','8','9')
    and substr(go.accountno,6,9) = '000000000' then
    substr(go.accountno,1,5)
    end
    =
    substr(gc.accountno,1,5)
    )
    OR
    (
    case when substr(go.accountno,1,1) in ('7','8','9')
    and substr(go.accountno,8,7) = '0000000' then
    substr(go.accountno,1,7)
    end
    =
    substr(gc.accountno,1,7)
    )
    OR
    (
    case when substr(go.accountno,1,1) in ('7','8','9')
    and substr(go.accountno,10,5) = '00000' then
    substr(go.accountno,1,9)
    end
    =
    substr(gc.accountno,1,9)
    )
    OR
    (
    case when substr(go.accountno,1,1) in ('7','8','9')
    and substr(go.accountno,12,3) = '000' then
    substr(go.accountno,1,11)
    end
    =
    substr(gc.accountno,1,11)
    )
    OR
    (
    case when substr(go.accountno,1,1) in ('7','8','9')
    then go.accountno
    end
    =
    gc.accountno
    )
    order by go.accountno
    /hi,

    Thank you Rachet for the solution you provided. It didn't solve my problem completely. When i executed your query it gave me more number of records.
    As i said earlier i am having problem with Chartof Accounts starting with Other than '7','8','9'.series
    The opening balance is given against either ( account code divisionno )
    or (account code station code). It will be any one of them it can't have opening balance against 3 (account code,station code divisionno)
    so my problem is if the opening balance is against division no then against that i can get the Transaction Records from GL_CLUB similarlly if the opening balance is against station code i can get the Transaction records from GL_CLUB. But when opening balance is against "Account code only" rest all characters are 'zero'
    for example
    202-00-00-00-00000
    202-33-00-00-00000
    202-00-00-42-00000

    based on 2nd record above i can get the detail records from detail tables by selecting Account code '202' and division no '33' rest of the character can be anything in detail table.
    Similarly i can get detail records for 3 rd record above ie '202' account code and '42' station code.
    but when i go for first record since there is only account code ie '202' so if i write my query as substr(go.accountno,1,3)=substr(gc.accountno,1,3)
    its including the records with station code '42' and division no ''33'
    actually i should get only those records with account code '202' and any record other than station code '41' and division no '33' .
    if i write substr(go.accountno,1,5)=substr(gc.accountno,1,5) then i get wrong answer because in some case the opening balance might not be against divisionno
    (4th 5th character stand for division no),so the detail records with opening balance against station code won't be retreived.similarlly vice-versa

    The opening balance can be giiven only against (account code and division no) or (account code and station code) In '200' series if the opening balance is against 'station code' in other series may be '500' series it can be against 'division no'
    I have written query for the above in series not starting with "7','8','9'
    I really appreciate i you can help me out.

    Thanks
    Ram

  • RELEVANCY SCORE 3.05

    DB:3.05:Instr And Substr Uses cp


    I have the following table created:

    create table wekaRules_productmgr (
    RuleIDnumber,
    WekaRule varchar2(500),
    confidence number,
    lift number,
    leverage number,
    conviction number
    );

    The table contains the following data with insert statements:

    INSERT INTO wekaRules_productmgr (RuleID, WekaRule)
    VALUES (1, 'PM_PRICE_REDUCTION_TYPE =None 9828 == PM_COUPON_TYPE =None 9828 conf:(1) lift:(1.06) lev:(0.05) [576] conv:(576.86)');

    INSERT INTO wekaRules_productmgr (RuleID, WekaRule)
    VALUES (2, 'PM_AD_TYPE=None 9684 == PM_PRICE_REDUCTION_TYPE =None 9684 conf:(1) lift:(1.12) lev:(0.1) [1063] conv:(1063.13)');

    INSERT INTO wekaRules_productmgr (RuleID, WekaRule)
    VALUES (3, 'PM_AD_TYPE =None 9684 == PM_COUPON_TYPE =None 9684 conf:(1) lift:(1.06) lev:(0.05) [568] conv:(568.41)');

    The values for the final four columns in the wekaRules_productmgr table are contained in the string values in each statement. For example, in record # 1, the values are (left to right):
    Conviction = 576.86
    Leverage = 0.05
    Lift = 1.06
    Confidence = 1

    I need to find a way to parse the values in each record and place it in the appropriate table columns. So for record # 1, I need to update the columns with the values listed above, such that the record would look like:

    RuleID WekaRule confidence lift leverage conviction
    1 PM_PRICE_REDUCTION_TYPE =None 9828 == PM_COUPON_TYPE =None 9828 1 1.06 0.05 576.86
    conf:(1) lift:(1.06) lev:(0.05) [576] conv:(576.86)

    I've attempted this solution, but it only returns the beginning of the text:

    SELECT

    SUBSTR(wekarule,1,(INSTR(wekarule,' ',1,1)-1)) "conf"
    FROM
    wekaRules_productmgr;

    Does anyone have any suggestions? Any assistance is much appreciated. Thanks!

    DB:3.05:Instr And Substr Uses cp

    Thanks so much! One additional question. Can I use the same idea to extract two more columns from the string so that the record will read:

    Antecedent Consequent
    PM_PRICE_REDUCTION_TYPE =None PM_COUPON_TYPE =None

  • RELEVANCY SCORE 2.99

    DB:2.99:Use Of Case Statement In Query 3a


    I have written the query as follows :

    ((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU)/IU_MAX_LOOSE_1)* TO_NUMBER(SUBSTR(ITEM_CODE,-3,3))STOCK,

    DECODE(SUBSTR(LCS_ITEM_CODE, 11, 3),'000',((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU)/IU_MAX_LOOSE_1)) LOOSE_STK,

    The above two statements gives me results in two separate columns namely STOCK and LOOSE_STK. How can i display the result in same column suppose STK using case statement ?

    I have stock in loose as well as packed which i can identify by the item code's last 3 digits.

    Yogesh

    DB:2.99:Use Of Case Statement In Query 3a

    You don't need CASE here:

    ((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU)/IU_MAX_LOOSE_1)* TO_NUMBER(SUBSTR(ITEM_CODE,-3,3)) ||
    DECODE(SUBSTR(LCS_ITEM_CODE, 11, 3),'000',((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU)/IU_MAX_LOOSE_1)) STK,

  • RELEVANCY SCORE 2.92

    DB:2.92:Linq Datasource Edit And Database Defaults jm


     
    As we know, LINQ to SQL does not really support columns with database defaults very well. One solution to this I have used is the OnCreated method, which can set values to initial values. This works okay as loading an object then overwrites these values with the database ones, and if inserting ensures they are set.
     
    However, I've found that when an instance is edited through a bound form using LINQ datasource, the values can be overwritten - presumably LINQ datasource is creating an empty version of the object, setting the properties and then comparing the two instances (database and edited one) to identify changes.
     
    This means that properties set in OnCreated appear as though updated and are modified when they should not be .. can anyone confirm this?

    DB:2.92:Linq Datasource Edit And Database Defaults jm

    Yes I do have v3.5 SP1 installed.. sorry yes it should have been LINQdataSource
     
    I think I will follow you suggestion of using the Insertentity handler - a minor irritation since I have two versions of the datacontext (one implements security) so I will have to copy paste the code.

  • RELEVANCY SCORE 2.91

    DB:2.91:Converting Date Format In Groovy cd


    Hi

    I have two fields (TravelDate and DepartureDate)
    TravelDate data type - TimeStamp (yyyy-mm-dd hh:mm:ss)
    Departure data type - TimeStamp (dd/mm/yyyy)

    We have a requirement of comparing TravelDate and DepartureDate.
    We are trying to compare the dates using groovy. Since groovy we are unable to pass to_date(substr ('2012-03-27 12:00:00',1,10),'dd/MM/yyyy') . It doesn't convert and instead it says substr name not found

    Can anyone help to convert yyyy-mm-dd hh:mm:ss to dd/mm/yyyy in groovy ?

    Thanks in Advance,
    KR

    DB:2.91:Converting Date Format In Groovy cd

    Hi John
    I resolved the problem.
    First of all, I am very thankful to my colleagues Arun, kamal and LNP because they are the ones helped me in getting solution for this problem.

    I created a transient attribute(TravelDate_Temp) at the View Object which is of type String and changed the format in bundle properties to the date format i want. In the select query, i obtained values as to_char(column_name,'date format') then in the bind variable i gave a try catch groovy TravelDate_Temp.substring(0,10); and changed the type of departure_date to String.
    Then i compared in the view criteria using equals operator.

    I really appreciate your response John :) and thanks to Frank for sharing the info :)

    Regards,
    KR

  • RELEVANCY SCORE 2.91

    DB:2.91:Case In A Proc px


    Hi all,

    I've a case statement in a select..

    select c.lang, c.supply, CASE
    WHEN (substr(c.supply,1,5) between '0000' and '0900' ) THEN
    (
    case when ( substr(c.supply,2,2) between '200000' and '390000' ) then
    (
    substr(c.supply,1,1) | '-' |
    substr(c.supply,2,2) || '-' ||
    substr(c.supply,4,6) || '-' ||
    substr(c.supply,10,1)
    )
    when ( substr(c.supply,2,2) between '600000' and '890000' ) then
    (
    substr(c.supply,1,1) || '-' ||
    substr(c.supply,2,3) || '-' ||
    substr(c.supply,5,5) || '-' ||
    substr(c.supply,10,1)
    )
    when..
    else (
    ' '
    )
    end
    )
    when (...) then
    (case when (...) then
    (...
    when..
    else (
    ' '
    )
    end
    when..
    ..
    ...
    end "S-U-P-P-L-Y"
    from clr_level cBasically the select is checking for the values clr_level.supply and adding # to the values according to the 'case'. I need to implement this in a stored procedure, but instead of using a select statement, I'm getting clr_level.supply as IN parameter and I need to use the same 'case' logic in the stored procedure. I tried the below, but is it possible to use the case logic and assign it to a OUT variable?

    create or replace procedure test (in_supply in varchar2, out_supply out varchar2)
    is
    begin

    in_supply := CASE
    WHEN (substr(c.supply,1,5) between '0000' and '0900' ) THEN
    (
    case when ( substr(c.supply,2,2) between '200000' and '390000' ) then
    (
    substr(c.supply,1,1) | '#' |
    substr(c.supply,2,2) || '#' ||
    substr(c.supply,4,6) || '#' ||
    substr(c.supply,10,1)
    )
    when ( substr(c.supply,2,2) between '600000' and '890000' ) then
    (
    substr(c.supply,1,1) || '#' ||
    substr(c.supply,2,3) || '#' ||
    substr(c.supply,5,5) || '#' ||
    substr(c.supply,10,1)
    )
    when..
    else (
    ' '
    )
    end
    )
    when (...) then
    (case when (...) then
    (...
    when..
    else (
    ' '
    )
    end
    when..
    ..
    ...
    end ;

    dbms_output.put_line (out_supply);

    end;
    /Procedure compiles fine. But when I execute it, it doesnt return any value..

    Thanks

    DB:2.91:Case In A Proc px

    Hi,

    It doesn't look like you're ever assigning a value to out_supply.

    I'll guess that you meant to assign out_supply, not in_supply, at the beginning of the outer CASE:
    out_supply := CASE
    WHEN (substr(c.supply,1,5) between '0000' and '0900' ) THEN
    ...and that you meant to use in_supply somewhere else, perhaps in getting the value for c.supply.

    By the way, in PL/SQL, a lot of folks find it easier to use IF ... THEN ... ELSE rather than big, nested CASE expressions.

  • RELEVANCY SCORE 2.89

    DB:2.89:Lov Holds Substr(Instr(Column,' ') And Substr(Instr(Column,' ',1,2) mj


    db and dev 10g rel2 ,
    hi all,
    i've a column ename holds these values for instance :
    matt jack neck
    mathew black new
    maw batrick solivan

    i want to create a lov holds the values :
    matt
    maw
    mathew
    matt jack
    mathew black
    maw batrick

    how could i write this query ? , i can write it in sqlplus but the result is shown in two columns ,
    and i want it in the lov one column .?

    thanks in advance

    DB:2.89:Lov Holds Substr(Instr(Column,' ') And Substr(Instr(Column,' ',1,2) mj

    - what is "set feedback on" , what should it does ?i've tested this query and i think it worked :-- i think because it font color=reddoes not show the number of rows/font , and it seems there is a space under records . i do not know if it is normal or not .SET FEEDBACK ON is a SQL Plus command that shows you the number of rows.

    (Maybe you should do a little Google searching when you don't understand some of these things)

    if you could do it with the column name(ename) and the table name(test2)Why don't YOU try it?

    preSelect substr(font color=redename/font,1,instr(font color=redename/font,' ')) from font color=redtest2/font
    union all
    Select substr(font color=redename/font,1,instr(font color=redename/font,' ',1,2)) from font color=redtest2/font;/pre

  • RELEVANCY SCORE 2.89

    DB:2.89:Why '200801' Showing As '20081' In Interactive Report? ms


    I have a view, on top of a table.
    The table's field values look like '2008-01' '2008-23' '2008-43' (a Year-Wk column).
    So, I discovered that to have greater than or equal to, I had to convert this to a number.

    SO ... in the view I have these two columns ...

    to_number((substr(BEGYRWK,1,4)||substr(BEGYRWK,6,2))),
    to_number((substr(ENDYRWK,1,4)||substr(ENDYRWK,6,2))),

    ... and when I look at the view in SQLplus or via SQL Developer, there's my data, as a 6 digit number.

    Okay, so I want an interactive report on top of this view ...

    When I look at the data via the IR, I've suddenly got a 5 digit field (it does see it as a number, it does allow the lovely and signs, etc.

    Why is this??

    Also, I find for date fields, I can select where a date is = or equal to something, but NOT where it is NOT equal to something.

    Also, I looked in the APEX App Builder manual (PDF version) for a definition of the phrase "standard report column" as used on the column attrib specs for an IR ... and the phrase cannot be found. So I was also hoping to be pointed to a definition / meaning / expected behavior if a field is so defined.

    Thanks for your time.

    DB:2.89:Why '200801' Showing As '20081' In Interactive Report? ms

    And what happens if you use TO_NUMBER( REPL(BEGYRWK,'-',''))? (Should just remove the dash and convert it to number) Or use the CAST..as NUMBER for the column definition.

  • RELEVANCY SCORE 2.88

    DB:2.88:How To Loop Through This Code 38


    Hi, I am taking reading two user values into temp,temp1 and comparing it with co-ordinates of battle ship,

    DB:2.88:How To Loop Through This Code 38

    Hi,
    you could do a while-loop until the user hits the correct coordinates:

    Console.WriteLine(Cordinate X:);
    var temp = Convert.ToInt32(Console.ReadLine());
    Console.WriteLine(Cordinate Y:);
    var temp1 = Convert.ToInt32(Console.ReadLine());

    while (grid[temp, temp1] != BattleShip)
    {
    Console.WriteLine(Miss);

    Console.WriteLine(Cordinate X:);
    temp = Convert.ToInt32(Console.ReadLine());
    Console.WriteLine(Cordinate Y:);
    temp1 = Convert.ToInt32(Console.ReadLine());
    }

    Console.WriteLine(Hit);
    Console.ReadLine();

  • RELEVANCY SCORE 2.87

    DB:2.87:Comparing Two Schemas Having Different Sid xd


    hi gems...

    I want to compare two schemas but they have different SID. the database server are different for both of them. One is in 11gR1 and other one is in 11gR2.

    Suppose the credentials of them are as below...

    schema1/pass1@sid1
    schema2/pass2@sid2

    I want the to compare them to extract the extra new tables and extra new columns in the existing tables as well as the datatypes, default values and comments for the new columns..

    please help...

    DB:2.87:Comparing Two Schemas Having Different Sid xd

    If it were me doing this and I couldn't get what I wanted through a database link I would run this SQL on each schema and send the results to a file:

    select a.table_name, a.column_name, a.data_type, a.data_default, b.comments
    from user_tab_cols a, user_col_comments b
    order by a.table_name, a.column_nameThen I would use a file comparison utility to compare the two. I happen to use Beyond Compare, but I am sure there are many other equally good ones.

  • RELEVANCY SCORE 2.86

    DB:2.86:Comparing Oracle Parameters 7c


    hello

    I need to write a script that compares oracle settings with the recommended values.

    most of the parameters are from v$parameter.

    What is the best way to handle this? Is it through creating a temp table and comparing strings between the 2 columns: Recomended and Existing?

    thanks.

    DB:2.86:Comparing Oracle Parameters 7c

    You have been asked to reinvent the wheel: Oracle has already done it for you.
    SELECT name, value, isdefault, ismodified, isadjusted
    FROM gv$parameterDo not use v$parameter unless you only care about the currently connected instance and will never, ever, be on a RAC cluster.

  • RELEVANCY SCORE 2.83

    DB:2.83:Can It Be Possbile Thru Constraints ? xk


    Hi,

    I am having following details

    drop table t;
    create table t ( a varchar2(255));
    insert into t values ('parag patankar');
    insert into t values ('thomas cole');
    commit;

    Now if I try to insert substr of existing strings in a table it should not allow
    to insert for e.g.

    If i try to insert 'arag' (substr of parag), or 'tank' (substr of patankar) or
    'omas' (substr of thomas ) or 'co' ( substr of cole ) then it should get
    aborted.

    Is it possible to put such a business rule thru constraints ? If yes kindly
    guide me.

    thanks regards
    pjp

    DB:2.83:Can It Be Possbile Thru Constraints ? xk

    You can use materialized view to simulate on commit.

    It uses a trigger on materialized view which is set to refresh on commit.

    I have run some test using multiple sessions and seems to work..

    create table test_name (a varchar2(10));

    create materialized view log on test_name with rowid (a)
    including new values;

    create materialized view test_name_mv
    refresh fast on commit
    with rowid
    as
    select count(*) from test_name;

    create or replace trigger test_name_mv_trg
    before delete or insert or update on test_name_mv
    for each row
    declare
    overlap_exception exception;
    i number;
    begin

    select distinct 1 into i from test_name a where
    exists (select null from test_name b where a.a like b.a||'%'
    and a.rowid != b.rowid);

    raise overlap_exception;
    exception
    when no_data_found then
    null;
    end;
    /

  • RELEVANCY SCORE 2.83

    DB:2.83:Comparing Array Values Of Laserscanner And Selecting Two Desired Index 1s



    Hello all,

    I have an array of 1080 indexes of Laser scanner values, now I can detect an object distence using Min array fcn. Now I am stuck onto finding the edge point of the object by comparing the value differences from the minimum index.I need to find two points, which would be the edge point of the object. Can anyone please help me out? I am feeling helpless! :-( ...eagerly looking for a reply. and thanks in advance...










    Attachments:







    seeking edge point.PNG ‏35 KB

    DB:2.83:Comparing Array Values Of Laserscanner And Selecting Two Desired Index 1s


    Hey Guys...

    Thanks for all your support..I have solved my problem and it was simple. Your inspiration is really appreciated.

    Regards,

    Jun

  • RELEVANCY SCORE 2.83

    DB:2.83:Query Advice For Comparing Data x3



    Looking for advice on how to create query that compares two period (Date Range of sale totals)

    Total sales for year 2007 and 2008 in two separate columns.

    DB:2.83:Query Advice For Comparing Data x3


    You may try this one:

    SELECT T0.CardCode, T0.CardName,
    (SELECT SUM(DocTotal) FROM OINV WHERE CardCode = T0.CardCode
    AND YEAR(DocDate) = '2007') - (SELECT SUM(DocTotal) FROM ORIN
    WHERE CardCode = T0.CardCode
    AND YEAR(DocDate) = '2007') AS [Sales 2007],
    (SELECT SUM(DocTotal) FROM OINV WHERE CardCode = T0.CardCode
    AND YEAR(DocDate) = '2008') - (SELECT SUM(DocTotal) FROM ORIN
    WHERE CardCode = T0.CardCode
    AND YEAR(DocDate) = '2008') AS [Sales 2008]
    FROM [dbo].[OCRD] T0 LEFT JOIN [dbo].[OINV] T1 ON T1.CardCode = T0.CardCode
    WHERE T0.CardType = 'C'
    GROUP BY T0.CardCode, T0.CardName

  • RELEVANCY SCORE 2.81

    DB:2.81:Comparing 2 Rows Of Data 18


    I have a table with about 900 columns and need to compare 2 rows in PL/SQL to find which columns are different between the 2 rows.

    Is there a generic way to this by iterating over the columns without naming them explicitly perhaps by referring to the column number?

    for example:

    foreach col in columns
    if row1.col != row2.col then write column names and values to table

    DB:2.81:Comparing 2 Rows Of Data 18

    You can use data dictionary to easy build up your script or at least the most troublesome part of it.

    So start with user_tab_columns, find out its columns. For generation you can use either simple select that gives you desired info, or if you feel better with cursors and pl/sql then you can use dbms_ouput.put_line to generate each of your comparison lines.
    Just be inventive and remeber that knowing data dictionary can be a real strength! :)

    Gints Plivna
    http://www.gplivna.eu

  • RELEVANCY SCORE 2.80

    DB:2.80:Comparing Strings c3


    Hi,

    I am trying to compare two varchar2 columns in two tables and return the similar match:

    CREATE TABLE AAG
    (agreement varchar2(20))

    INSERT INTO AAG VALUES('10277');
    INSERT INTO AAG VALUES('11049');
    insert into AAG values('10381');

    CREATE TABLE RECEIVABLES(
    (agreement varchar2(20))

    INSERT INTO RECEIVABLES VALUES('0000010277');
    INSERT INTO RECEIVABLES VALUES('011049');
    INSERT INTO RECEIVABLES VALUES('010381');

    query:

    SELECT a.agreement, f.agreement
    FROM RECEIVABLES F, AAG A
    WHERE LENGTH(F.AGREEMENT) = 5
    AND trim(f.AGREEMENT) LIKE trim(A.AGREEMENT)

    The above query returns the same agreements but I am trying to match the agreements:

    e.g. AAG('10277') = RECEIVABLES('0000010277')

    Can anyone help?

    Thanks

    DB:2.80:Comparing Strings c3

    It works with your sample-Data:

    -- Yourdata:
    WITH
    aag as
    (
    select '10277' agreement from dual union all
    select '11049' from dual union all
    select '10381' from dual
    ),
    receivables as
    (
    select '0000010277' agreement from dual union all
    select '011049' from dual union all
    select '010381' from dual
    )
    -- Query:
    SELECT a.agreement, f.agreement
    FROM RECEIVABLES F, AAG A
    WHERE LENGTH(ltrim(F.AGREEMENT,'0')) = 5 -- I assume you wont need the length-check
    AND ltrim(f.AGREEMENT,'0') LIKE ltrim(A.AGREEMENT,'0');

  • RELEVANCY SCORE 2.80

    DB:2.80:Get The Values Using Substr ms


    Hi All,

    i am a comma seperated values into a variable. below are the values.
    "1234567,3,124567,3,14"

    the length of the values can vary. eg the output can also be
    "123,3,124567,443,1224"

    I need to get each value and store it a separate variable. is it possible using substr..?
    Please help me out...

    DB:2.80:Get The Values Using Substr ms

    Hi,

    Here's how you can split a delimited list into parts in Oracle 9:
    WITHgot_part_cntAS
    (
    SELECTpk
    ,csv
    ,1 + LENGTH (csv)
    - LENGTH (REPLACE (csv, ','))AS part_cnt
    FROMtable_x
    )
    ,cntrAS
    (
    SELECTLEVELAS n
    FROM( SELECT MAX (part_cnt)AS max_part_cnt
    FROM got_part_cnt
    )
    CONNECT BYLEVEL = max_part_cnt
    )
    ,got_posAS
    (
    SELECTp.pk
    ,p.csv
    ,c.n
    ,INSTR ( ',' || p.csv
    , ','
    , 1
    , c.n
    )AS start_pos
    ,INSTR ( p.csv || ','
    , ','
    , 1
    , c.n
    ) AS end_pos
    FROM got_part_cntp
    JOINcntrcONc.n= p.part_cnt
    )
    SELECT pk
    , csv
    , n
    , SUBSTR ( csv
    , start_pos
    , end_pos - start_pos
    )AS item
    FROM got_pos
    ORDER BY pk
    , n
    ;Pk is the primary key of table_x. If you don't need it, you can omit it.

    Of course, this will work in versions later than 9, but you wouldn't want to if you could use REGEXP_SUBSTR.

  • RELEVANCY SCORE 2.79

    DB:2.79:Re: How To Obtain The Updated Column Name In A Trigger? d9


    You could have 1 updated column or 20 updated columns - you'll have to check them individually, but you can use:

    if updating('column_name') theninstead of comparing old and new values - which can be tricky with nulls.

  • RELEVANCY SCORE 2.79

    DB:2.79:Wrapping zj


    Hello, everyone!I have two problems, both of them related to wrapping.1) I want to adjust width of columns in ALV. I set property of table which allows me to change width. But setting it I lose wraping. Text is displayes as a single line... When width was automatically managed all was ok.2) I have OVS with long texts inside the list of values. I need to setup wrapping for this table, but wondering whether it's possible...3) The last question is actually for Thomas. Is there a tool for comparing two WD4A application? If no, Is it planned? Because, It's really nightmare going to all views, actions and comparing them

    DB:2.79:Wrapping zj

    Hi,1. When the width of the column increases(Exceeds) , wrapping doesnot work. Have you tried the wrapping with Fixed layout property in ALV.2. There is no wrapping available for Columns/Textfields at OVS output table level. there are no methods to set the wrapping.Regards,Lekha.

  • RELEVANCY SCORE 2.79

    DB:2.79:Error Trigger.... f9


    hi,
    I've 2 columns SITE_ID and COD_CONV (default '____--_______' varchar2(15)).
    When I update SITE_ID I must insert automatically into col COD_CONV this value progressive:
    _000
    _001
    _002
    ....
    _A00
    _A01
    ....
    _ZZZ

    after I must fill up a table with max value update.

    I tried with this two trigger:

    create or replace TRIGGER ON_SITE_ID
    BEFORE INSERT OR UPDATE OF
    SITE_ID
    ON BL
    REFERENCING
    NEW AS NEW
    OLD AS OLD
    FOR EACH ROW
    DECLARE COD_SITO VARCHAR2(4);
    COD1 CHAR(1);
    COD2 CHAR(1);
    COD3 CHAR(1);

    Begin
    SELECT COD_CONV INTO COD_SITO FROM MAX_VAL;
    COD1 := SUBSTR(COD_SITO,4,1);
    COD2 := SUBSTR(COD_SITO,3,1);
    COD3 := SUBSTR(COD_SITO,2,1);
    IF COD3='_' THEN COD3:= '0';
    END IF;
    IF COD2='_' THEN COD2:= '0';
    END IF;
    IF COD1='_' THEN COD1:= '0';
    END IF;
    IF COD1='Z' THEN
    COD1 := '0';
    COD2 := SUBSTR('0123456789ABCDEFGHIJKLMNOPQRSTUVWYXZ0',INSTR('0123456789ABCDEFGHIJKLMNO PQRSTUVWYXZ0',SUBSTR(COD_SITO,2,1)) 1,1);
    IF COD2 = 'Z' THEN
    COD2 := '0';
    COD3 := SUBSTR('0123456789ABCDEFGHIJKLMNOPQRSTUVWYXZ0',INSTR('0123456789ABCDEFGHIJKLMNO PQRSTUVWYXZ0',SUBSTR(COD_SITO,3,1)) 1,1);
    ELSE
    COD2 := SUBSTR('0123456789ABCDEFGHIJKLMNOPQRSTUVWYXZ0',INSTR('0123456789ABCDEFGHIJKLMNO PQRSTUVWYXZ0',SUBSTR(COD_SITO,2,1)) 1,1);
    END IF;
    ELSE
    COD1 := SUBSTR('0123456789ABCDEFGHIJKLMNOPQRSTUVWYXZ0',INSTR('0123456789ABCDEFGHIJKLMNO PQRSTUVWYXZ0',SUBSTR(COD_SITO,1,1)) 1,1);
    END IF;
    SELECT '_'||COD3||COD2||COD1||'-' INTO :NEW.COD_CONV FROM DUAL;
    End;

    create or replace TRIGGER POST_COD_CONV
    AFTER INSERT OR UPDATE OF
    COD_CONV
    ON BL
    FOR EACH ROW
    Begin
    UPDATE MAX_VAL
    SET COD_CONV = :NEW.COD_CONV;

    End;

    but when I update SITE_ID, I see only _000 in COD_CONV
    What I wrong???
    Thanks
    Raf

    DB:2.79:Error Trigger.... f9

    Raf
    can you please post the data movement ie
    for INSERT
    what is the data before and what should be the data after .
    similarly for UPDATE too.

    That will give a chance for others to put their opinions quickly. may be we may get a simple and efficient solution also.

    thanks
    prakash

  • RELEVANCY SCORE 2.78

    DB:2.78:Comparing String Strange zp


    Dears,

    I have two tables:

    T_WS_CURWAKEUP - TASK_ID VARCHAR2(40) this is the PK
    T_134SERVICE_FOR_SPECIFIC - ID VARCHAR2(40) NO PK and INDEXES.

    I those dates into the tables:

    T_WS_CURWAKEUP
    ID=55146 another columns

    T_134SERVICE_FOR_SPECIFIC
    ID= 55146 and another columns

    This sql execution:
    SELECT /*+ FULL(S) */ T.ID, T.PROGRAMMED_NUMBER num, T.PERSONAL_MESSAGE path, T.WAKEUP_INIT_DATE ws_time
    FROM WAKEUP134.T_WS_CURWAKEUP S, WAKEUP134.T_134SERVICE_FOR_SPECIFIC T
    WHERE S.TASK_ID T.ID;

    Return the ID=55146 and its columns values if i change it to operator =, the same occurs.
    WHY?

    I tried TRIM before each clause, but the result is the same. Any suggestion, my dump is the same.

    Cheers,

    DB:2.78:Comparing String Strange zp

    It's possible that your indexes are corrupt in some way (unusual, but I have come across an issue like this once) - try rebuilding the indexes on both tables.

  • RELEVANCY SCORE 2.78

    DB:2.78:Comparing Data In Columns Using Substr aa


    I have a column with a case number(VARCHAR2) and a column with a year(NUMBER) consisting of data similiar to:

    CASENUMBER-----------------------------YEAR
    199713029----------------------------------97
    199713678----------------------------------97
    199713691----------------------------------97
    199713709----------------------------------97
    199713844----------------------------------97
    199714141----------------------------------97
    2001002718--------------------------------01
    2001002725--------------------------------01
    2001002894--------------------------------01
    95 U 9998-----------------------------------95
    95 U 9999-----------------------------------95
    96 A 0019-----------------------------------96
    96 A 0058-----------------------------------96
    96 A 0067-----------------------------------96

    When i run this query:
    SELECT SUBSTR(LOCCASENUM,1,4) as FIRST_FOUR,SUBSTR(YEAR,1,2)as "test"
    FROM DATA_TABLE
    where SUBSTR(LOCCASENUM,1,4) != SUBSTR(YEAR,1,2)I get this result:

    FIRSTFOUR------ test_
    1997----------------- 97
    1997----------------- 97
    1997----------------- 97
    1997----------------- 97
    1997----------------- 94
    1997----------------- 97
    2001------------------ 1
    2001------------------ 1
    2001------------------ 4
    95 U----------------- 95
    95 U----------------- 95
    96 A----------------- 96
    96 A----------------- 96
    96 A----------------- 93

    What i am wanting to do is compare these two columns and display the only ones that do not match. I am not sure if i need to do an LPAD on the year column or what. Can someone help? Thanks

    Deanna

    DB:2.78:Comparing Data In Columns Using Substr aa

    oh crud...when i ran this from the command line it worked fine but when i put when trying to put it within a procedure using a cursor, im not sure how to compare the case number column to the year column in this situation. Are you able to help with this one or do i need to submit another task?

    create or replace procedure "test"
    is
    Cursor data_cursor
    IS
    Select *
    from data_table;
    cr data_cursor%ROWTYPE;

    BEGIN
    OPEN data_cursor;

    LOOP
    FETCH data_cursor INTO cr;
    EXIT WHEN data_cursor%NOTFOUND;

    --FIND BAD MATCHES FOR CASE NUMBER AND YEAR

    case length(substr(regexp_substr(cr.loccasenum, '[0-9]+'),1,4))
    when 2
    then
    cr.loccasenum :=substr(regexp_substr(cr.loccasenum, '[0-9]+'),1,4);
    else
    cr.loccasenum :=substr(regexp_substr(cr.loccasenum, '[0-9]+'),3,2);
    end case;

  • RELEVANCY SCORE 2.78

    DB:2.78:Count Unique Values And Unique Text Comparing Two Columns pj


    I have two colums, one is an ID and the other is a Name. I want to count only the Unique ID and Unique Name, without counting Multiple IDs of the same Name

    Example...

    Column
    A B
    ID Name
    1111 Test
    1111 Test 1
    1111 Data
    1112 Data 1
    1112 Data 1
    1112 Test
    1113 Test
    1113 Test
    1113 Test
    ...

    Count should be 6.... Dont want to count multiple Names or blanks of the same ID

    Thanks so much in advance!!

    DB:2.78:Count Unique Values And Unique Text Comparing Two Columns pj

    Hi,

    May I request you to post your question in the Comments section of this link -

    http://www.ashishmathur.com/count-uniques-with-conditions/#comments

    Thank you.

  • RELEVANCY SCORE 2.77

    DB:2.77:Comparing Values 8x


    I am still working on my project and I was wondering how to compare values of two different strings. Can anyone help me with this one?

    DB:2.77:Comparing Values 8x

    we need a little more infowhat value are you comparing if the strings match letter for letter - if so, does it need to be case senstitive if the strings match word for word if the string lengths are the same etcso, what do you want to compare between the 2?

  • RELEVANCY SCORE 2.76

    DB:2.76:Select With Alltrim Bug??? 79


    Please try this...

    CREATE TABLE C:\FOX\TEST (STRNG C(5))

    INSERT INTO TEST (STRNG) VALUES ('A  ')
    INSERT INTO TEST (STRNG) VALUES ('AAA')
    INSERT INTO TEST (STRNG) VALUES ('AA ')
    INSERT INTO TEST (STRNG) VALUES (' AA')
    INSERT INTO TEST (STRNG) VALUES ('B  ')
    INSERT INTO TEST (STRNG) VALUES ('AB ')
    INSERT INTO TEST (STRNG) VALUES ('ABB')
    INSERT INTO TEST (STRNG) VALUES (' AB')
    INSERT INTO TEST (STRNG) VALUES ('C  ')
    INSERT INTO TEST (STRNG) VALUES ('AC ')
    INSERT INTO TEST (STRNG) VALUES ('ACC')
    INSERT INTO TEST (STRNG) VALUES (' AC')

    SELE * FROM TEST WHERE SUBSTR(ALLTRIM(STRNG),2,1)='C'
    brow for SUBSTR(ALLTRIM(STRNG),2,1)='C'
    ** returns two Diffrent data sets!!

    SELE * FROM TEST WHERE isnull(SUBSTR(ALLTRIM(STRNG),2,1))
    *** nothing returned
    ** SUBSTR(ALLTRIM(STRNG),2,1) dose not return null

    SELE * FROM TEST WHERE SUBSTR(ALLTRIM(STRNG),2,1)=' '
    ** only len=1 returned
    ** SUBSTR(ALLTRIM(STRNG),2,1) returns a space!!
     
    SELE * FROM TEST WHERE SUBSTR(ALLTRIM(STRNG),2,1)=' ' and SUBSTR(ALLTRIM(STRNG),2,1)='C' and !isnull(SUBSTR(ALLTRIM(STRNG),2,1))
    ** return same as above!!!!!
     
    Whats Going on???

    Dave

    DB:2.76:Select With Alltrim Bug??? 79

    I'm not sure how that accounts for fox returning records with data of A and B for command:
    SELE * FROM TEST WHERE SUBSTR(ALLTRIM(STRNG),2,1)='C'
    returns same with exact on or off
    it looks like it's just saying, if there is no second character then the statement is true.

    Correct. What's happening here is that when Strng is one-character, SUBSTR(ALLTRIM(Strng),2,1) returns the empty string.

    SET EXACT is irrelevant here. SQL is controlled by SET ANSI and no doubt it's OFF, so 'C' equals the empty string.

    Tamar

  • RELEVANCY SCORE 2.74

    DB:2.74:Help To With Checksum pj


    i have been using checksum to compare any change in column values.
    i am comparing the checksum value for 3 columns.
    I am getting lot of duplicates.
    can i use hashbytes to compare column values. If not what are the alternative. Please suggest

    DB:2.74:Help To With Checksum pj

    Hi reddy335,

    If you are using SSIS, please take a look at the similar thread about this topic: Unique Row ID based on all columns - HashByte or Checksum?
    Hope this helps.
    Best Regards,
    Stephanie Lv

  • RELEVANCY SCORE 2.74

    DB:2.74:Comparing Data In Two Columns 38


    Column A - Smith, Toni
    Column B - Smith, Tony
    Column C - need a formula that will result showing there is adiscrepancy when comparing these two columns.

    DB:2.74:Comparing Data In Two Columns 38

    =index(sheet2!$A$2:$A$1000,match(A2,sheet2!$A$2:$A$1000,0))

  • RELEVANCY SCORE 2.74

    DB:2.74:Ora-00979 Not A Group By Expression (Within A Join) dj


    Hi all. I've put together the follwing query which works as I expect:

    select substr(msgtext, 2, 12), count(substr(msgtext, 2, 12))
    from archive.kiwi_test, pcs.pix_syslog_id
    WHERE substr(MSGTEXT, 2, 12) = "PIX_SYSLOG_ID"."PIXIDN" (+)
    and to_date(msgdatetime, 'YYYY-MM-DD HH24:MI:SS') SYSDATE - 3600/86400
    group by substr(msgtext, 2, 12)

    The output looks like this:

    Substr(Msgtext,2,12) Count(Substr(Msgtext,2,12))
    PIX-1-105009 225
    PIX-4-400012 25

    The problem I have is when I attempt to introduce the column pix_syslog_id.info to the select statement which contain information about each of the pix_syslog_id.pixidn. The query I attempt looks like this:

    select substr(msgtext, 2, 12), count(substr(msgtext, 2, 12)), info
    from archive.kiwi_test, pcs.pix_syslog_id
    WHERE substr(MSGTEXT, 2, 12) = "PIX_SYSLOG_ID"."PIXIDN" (+)
    and to_date(msgdatetime, 'YYYY-MM-DD HH24:MI:SS') SYSDATE - 3600/86400
    group by substr(msgtext, 2, 12)

    When I try the query I get:

    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00979: not a GROUP BY expression

    Essentially, I want the same output as previously displayed with the description of what each PIX... error code is according to the unique entries (that is, each PIX error code and description is only listed once) in the pix_syslog_id table. It seems like this would be a simple join between two tables so would someone please point out where I'm going wrong?

    Thanks! Len

  • RELEVANCY SCORE 2.74

    DB:2.74:Excel Formula For Comparing Two Columns Of Information mx


    What's a formula for comparing, row by row, two columns of information and indicating aNOT match in a third?

    ex. a1 = b1? if yes, c1 Y if not, c1 N
    a2 = b2? if yes, c1 Y if not, c1 N
    Thanks very much.

  • RELEVANCY SCORE 2.74

    DB:2.74:Comparing Two Internal Tables 3d



    Hi All!

    I have two int tables as below with the same columns and field names and values below..

    buItem/u/b ubquan/b/u

    mfg03 50

    mfg04 100

    mfg05 20.

    second IT have the same item numbers but different values.Now my requirement is to add the quantities into 3rd IT item wise.I can use collect statement to do this but confused how to apply on two Internal tables.Please advise.

    Regards

    Pavan

    DB:2.74:Comparing Two Internal Tables 3d


    Hi Kumar,

    Take 3rd internal table. Add the first two internal tables to 3rd intetnal table and use COLLECT statement on 3rd internal table.

    DATA ITAB3 TYPE ITAB OCCURS 0 WITH HEADERLINE.

    DATA V_LINES TYPE I.

    bINSERT LINES OF ITAB1 INTO ITAB3.

    DESCRIBE TABLE ITAB1 LINES V_LINES.

    INSERT LINES OF ITAB2 INTO ITAB3 INDEX V_LINES.

    LOOP AT ITAB3.

    COLLECT ITAB3.

    ENDLOOP./b

    Thanks,

    Vinay

  • RELEVANCY SCORE 2.74

    DB:2.74:How Can I Show Groupped Columns Inisde Diadem Report ? md


    Hi,I am trying to show some values inside a Diadem report. I must show then in a similar way as "groupped columns" inside Excel, comparing different values in columns, just one columns next to the other one, but I do not know how I can manage it inside Diadem. With "bar" and outlined bars, all the columns are located at the same X point, so it is not the same as in Excel. How could I compare values of differet columns?Thanks for your collaboration

    DB:2.74:How Can I Show Groupped Columns Inisde Diadem Report ? md


    Hi Ruben,

    It helps us stay organized if we keep each forum thread specifically related to an invidual topic. Therefore, instead of Replying to several different forum threads asking your question, we would appreciate it if you create a new forum topic so that we can keep that new topic thread concentrated on your challenge.




    Derrick S.Product ManagerNI DIAdemNational Instruments

  • RELEVANCY SCORE 2.74

    DB:2.74:Conditional Display f7


    Hi all,

    I am having a region Region 1 for this i mentioned condtional display

    Value of item in exp1 is contained in colon delimited list of exp 2.

    So here comparing a item with two different values. Instead of this i want to compare two different items with some values.

    Ex:
    Like,
    p1_item1=1 and p1_item2=2

    DB:2.74:Conditional Display f7

    Your question is not very clear, but I think you just need to use 'sql expression' for your conditional display. You can then enter values in the same way as you would in the 'Where' clause of a sql statement e.g.

    :p1_item1=1 and :p1_item2=2

    Shunt

  • RELEVANCY SCORE 2.73

    DB:2.73:Reg-Logic For Query! 79


    Hi All,
    In my application, there is an requirement for generating Autogen Sequence in two ways.
    First Way: Using Autogen button.
    For Ex: If the old symbol: ABCDEF00, the next Autogen sequence should be i.e, new symbol: ABCDEG00 .
    Similarly if the symbol has old symbol:zzzzz00 new symbol should be AAAAA00.
    As of now my logic is working perfectly accordingly to the above scenario.

    Note: We will be changing only first 5 characters and last two digits I am appending as 00.

    Second Way: Manually there can enter the symbol.
    The problem I am facing in second method, since there can enter/ create a symbol using Alphanumeric.
    For Ex: old Symbol: ABCD100, the next will be ABCD200 and soon till ABCD900.. Once the symbol ends with 9 then next sequence is replacing with some special characters as ABCD:00

    Note: Symbol should not accept any special characters. If the symbol ABCD900 then next should be ABCD000. 9 should be replaced with 0 and soon. My logic will not work for alphanumeric.

    Can anyone help me out my logic should accept both characters as well as numerics.

    Following is the logic which currently i am using

    DECLARE

    v_symb_code VARCHAR2(7);
    new_sym_code VARCHAR2(7);
    v_count NUMBER;
    v_auto_count NUMBER;
    symb_code_new VARCHAR2(7);

    BEGIN

    SELECT COUNT(*) INTO v_auto_count FROM T_AUTOGEN_SYMBOL;
    IF v_auto_count=0 THEN
    SELECT symb_code INTO v_symb_code FROM t_symbol WHERE SYMB_MODIFIED_DATE=(SELECT MAX(SYMB_MODIFIED_DATE) FROM t_symbol) AND ROWNUM=1;
    ELSE
    SELECT ATGS_SYMB_CODE INTO v_symb_code FROM T_AUTOGEN_SYMBOL;
    END IF;

    LOOP
    SELECT
    -- 1st digit of new value
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),5,1),'Z',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),4,1),'Z',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),3,1),'Z',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),2,1),'Z',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),1,1),'Z','A',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),1,1),'A','B','B','C','C','D','D','E','E','F','F','G','G','H','H','I','I','J','J','K','K','L','L','M','M','N','N','O','O','P','P','Q','Q','R','R','S','S','T','T','U','U','V','V','W','W','X','X','Y','Y','Z',
    CHR(ASCII(SUBSTR(SUBSTR (v_symb_code, 1, 5),1,1))+1))),
    SUBSTR(SUBSTR (v_symb_code, 1, 5),1,1)),
    SUBSTR(SUBSTR (v_symb_code, 1, 5),1,1)),
    SUBSTR(SUBSTR (v_symb_code, 1, 5),1,1)),
    SUBSTR(SUBSTR (v_symb_code, 1, 5),1,1))
    ||
    -- 2nd digit of new value
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),5,1),'Z',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),4,1),'Z',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),3,1),'Z',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),2,1),'Z','A',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),2,1),'A','B','B','C','C','D','D','E','E','F','F','G','G','H','H','I','I','J','J','K','K','L','L','M','M','N','N','O','O','P','P','Q','Q','R','R','S','S','T','T','U','U','V','V','W','W','X','X','Y','Y','Z',
    CHR(ASCII(SUBSTR(SUBSTR (v_symb_code, 1, 5),2,1))+1))),
    SUBSTR(SUBSTR (v_symb_code, 1, 5),2,1)),
    SUBSTR(SUBSTR (v_symb_code, 1, 5),2,1)),
    SUBSTR(SUBSTR (v_symb_code, 1, 5),2,1))
    ||
    -- 3rd digit of new value
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),5,1),'Z',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),4,1),'Z',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),3,1),'Z','A',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),3,1),'A','B','B','C','C','D','D','E','E','F','F','G','G','H','H','I','I','J','J','K','K','L','L','M','M','N','N','O','O','P','P','Q','Q','R','R','S','S','T','T','U','U','V','V','W','W','X','X','Y','Y','Z',
    CHR(ASCII(SUBSTR(SUBSTR (v_symb_code, 1, 5),3,1))+1))),
    SUBSTR(SUBSTR (v_symb_code, 1, 5),3,1)),
    SUBSTR(SUBSTR (v_symb_code, 1, 5),3,1))
    ||
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),5,1),'Z',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),4,1),'Z','A',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),4,1),'A','B','B','C','C','D','D','E','E','F','F','G','G','H','H','I','I','J','J','K','K','L','L','M','M','N','N','O','O','P','P','Q','Q','R','R','S','S','T','T','U','U','V','V','W','W','X','X','Y','Y','Z',
    CHR(ASCII(SUBSTR(SUBSTR (v_symb_code, 1, 5),4,1))+1))),
    SUBSTR(SUBSTR (v_symb_code, 1, 5),4,1))
    ||
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),5,1),'Z','A',
    DECODE(SUBSTR(SUBSTR (v_symb_code, 1, 5),5,1),'A','B','B','C','C','D','D','E','E','F','F','G','G','H','H','I','I','J','J','K','K','L','L','M','M','N','N','O','O','P','P','Q','Q','R','R','S','S','T','T','U','U','V','V','W','W','X','X','Y','Y','Z',
    CHR(ASCII(SUBSTR(SUBSTR (v_symb_code, 1, 5),5,1))+1)))||'00' INTO new_sym_code
    FROM dual;
    symb_code_new := UPPER(new_sym_code);

    SELECT COUNT(*) INTO v_count FROM t_symbol WHERE symb_code=symb_code_new AND ROWNUM2;
    /*IF v_count1 THEN
    SELECT COUNT(*) INTO v_count FROM t_symbol_wip WHERE symb_code=symb_code_new AND ROWNUM2;
    END IF;
    DELETE FROM T_AUTOGEN_SYMBOL;
    INSERT INTO T_AUTOGEN_SYMBOL(ATGS_SYMB_CODE,ATGS_MODIFIED_BY,ATGS_MODIFIED_DATE) VALUES(symb_code_new,v('APP_USER'),SYSDATE); */
    EXIT WHEN v_count 1;
    v_symb_code:=symb_code_new;
    DBMS_OUTPUT.PUT_LINE(v_symb_code);
    END LOOP;
    :P39_SYMBOL := symb_code_new;

    END;

    DB:2.73:Reg-Logic For Query! 79

    I'd use a slightly different approach with the same end result: use and store numbers instead of this "Autogen sequence". When you use a number, you can easily add 1 or subtract 1. You probably only need that string for display. So use a function like below:

    SQL create function number2weirdstring (p_num in number) return varchar2
    2 as
    3 --
    4 -- The string looks like this AAAAA00.
    5 -- Define for each A what the acceptable characters can be
    6 -- For instance I'm defining them to accept [a-z] and [A-Z]
    7 -- And they are mapped to [0-25] and [26-51]. This leads to
    8 -- 52^5 possible combinations.
    9 --
    10 l_character1 varchar2(1);
    11 l_character2 varchar2(1);
    12 l_character3 varchar2(1);
    13 l_character4 varchar2(1);
    14 l_character5 varchar2(1);
    15 begin
    16 l_character5 := chr( case when mod(p_num,52) 26 then 97 else 39 end + mod(p_num,52) );
    17 l_character4 := chr( case when mod(trunc(p_num/52),52) 26 then 97 else 39 end + mod(trunc(p_num/52),52) );
    18 l_character3 := chr( case when mod(trunc(p_num/52/52),52) 26 then 97 else 39 end + mod(trunc(p_num/52/52),52) );
    19 l_character2 := chr( case when mod(trunc(p_num/52/52/52),52) 26 then 97 else 39 end + mod(trunc(p_num/52/52/52),52) );
    20 l_character1 := chr( case when mod(trunc(p_num/52/52/52/52),52) 26 then 97 else 39 end + mod(trunc(p_num/52/52/52/52),52) );
    21 return l_character1 || l_character2 || l_character3 || l_character4 || l_character5 || '00';
    22 end number2weirdstring;
    23 /

    Functie is aangemaakt.And to show how the function works:

    SQL select number2weirdstring(0)
    2 , number2weirdstring(25)
    3 , number2weirdstring(26)
    4 , number2weirdstring(51)
    5 , number2weirdstring(52)
    6 , number2weirdstring(52*52-1)
    7 , number2weirdstring(52*52)
    8 , number2weirdstring(12893571)
    9 from dual
    10 /

    NUMBER2WEIRDSTRING(0)
    --------------------------------------------------------------------------------------------------------------------------------------
    NUMBER2WEIRDSTRING(25)
    --------------------------------------------------------------------------------------------------------------------------------------
    NUMBER2WEIRDSTRING(26)
    --------------------------------------------------------------------------------------------------------------------------------------
    NUMBER2WEIRDSTRING(51)
    --------------------------------------------------------------------------------------------------------------------------------------
    NUMBER2WEIRDSTRING(52)
    --------------------------------------------------------------------------------------------------------------------------------------
    NUMBER2WEIRDSTRING(52*52-1)
    --------------------------------------------------------------------------------------------------------------------------------------
    NUMBER2WEIRDSTRING(52*52)
    --------------------------------------------------------------------------------------------------------------------------------------
    NUMBER2WEIRDSTRING(12893571)
    --------------------------------------------------------------------------------------------------------------------------------------
    aaaaa00
    aaaaz00
    aaaaA00
    aaaaZ00
    aaaba00
    aaaZZ00
    aabaa00
    bNKrp00

    1 rij is geselecteerd.You only need to modify the function to accept the characters you want. But hopefully this example will get you started.

    Regards,
    Rob.

  • RELEVANCY SCORE 2.73

    DB:2.73:Missing Columns In A Ir After Re-Build The Region Source 7x


    Hello guys,

    I added two new fields in a Region Source (query) of an IR, but they are not showing, if i go to the button "Actions" - "Select Columns" then on hide side there is the columns, but i need they appear as a default setting, the configuration of all fields are the same.

    Here is the code before:

    SELECT PESS.ID,
    NVL(PESS.NOME_FANTASIA, PESS.DESCRICAO) DESCRICAO,
    CIDA.DESCRICAO||' - '||UFED.SIGLA CIDADE,
    DECODE(PESS.CNPJ, NULL, NULL, SUBSTR(TO_CHAR(PESS.CNPJ, 'FM00000000000000'), 1, 2)
    || '.'
    ||SUBSTR(TO_CHAR(PESS.CNPJ, 'FM00000000000000'), 3, 3)
    || '.'
    ||SUBSTR(TO_CHAR(PESS.CNPJ, 'FM00000000000000'), 6, 3)
    || '/'
    ||SUBSTR(TO_CHAR(PESS.CNPJ, 'FM00000000000000'), 9, 4)
    || '-'
    ||SUBSTR(TO_CHAR(PESS.CNPJ, 'FM00000000000000'), 13, 2)) AS CNPJ
    FROM (table)
    (JOIN's here)
    WHERE (conditions) Then changed to:

    SELECT PESS.ID,
    PESS.NRO_FONE TELEFONE,
    PESS.EMAIL EMAIL,
    NVL(PESS.NOME_FANTASIA, PESS.DESCRICAO) DESCRICAO,
    CIDA.DESCRICAO||' - '||UFED.SIGLA CIDADE,
    DECODE(PESS.CNPJ, NULL, NULL, SUBSTR(TO_CHAR(PESS.CNPJ, 'FM00000000000000'), 1, 2)
    || '.'
    ||SUBSTR(TO_CHAR(PESS.CNPJ, 'FM00000000000000'), 3, 3)
    || '.'
    ||SUBSTR(TO_CHAR(PESS.CNPJ, 'FM00000000000000'), 6, 3)
    || '/'
    ||SUBSTR(TO_CHAR(PESS.CNPJ, 'FM00000000000000'), 9, 4)
    || '-'
    ||SUBSTR(TO_CHAR(PESS.CNPJ, 'FM00000000000000'), 13, 2)) AS CNPJ
    FROM (table pess)
    (JOIN's here)
    WHERE (conditions)What should i change??

    Thanks,
    Alan.

  • RELEVANCY SCORE 2.72

    DB:2.72:Required Help In Pl/Sql Code For Data Masking f1


    Hi ExpertsI have a requirement to depersonlise production data before handing it over to the vendor. I am keen to use REMAP_DATA feature of data pump export/import and hence need help in writing up a package and function to achieve this - wondering if anyone can help?I have created this small package/function but its working on one column. I have a requirement to mask more than one column and also they could be from number of tables.Below code is working and masking data from acct_name column...I need to have more columns added to it from different table and one more column from the same tablecreate package pkg_testasfunction f_test (acct_name in varchar) return varchar;end;/create package body pkg_test as function f_test (acct_name in varchar) return varchar as act_nme varchar2(255); begin act_nme:=SUBSTR (acct_name, 1, 2) || '*********'; return act_nme; end; end; /Can anyone please help in writting up this code?I need these columns to be maskedUPDATE g_payment_order_dep SET sort_code = SUBSTR (sort_code, 1, 2) || '*******', acct_name = SUBSTR (acct_name, 1, 2) || '*******', description = SUBSTR (description, 1, 2) || '*******', payee_street = SUBSTR (payee_street, 1, 2) || '*******', payee_apartment = SUBSTR (payee_apartment, 1, 2) || '*******', payee_town = SUBSTR (payee_town, 1, 2) || '*******', payee_city = SUBSTR (payee_city, 1, 2) || '*******', payee_county = SUBSTR (payee_county, 1, 2) || '*******', payee_country = SUBSTR (payee_country, 1, 2) || '*******', payee_postal_code = SUBSTR (payee_postal_code, 1, 2) || '*******', payee_name = SUBSTR (payee_name, 1, 2) || '*******', payee_house_name = SUBSTR (payee_house_name, 1, 2) || '*******'UPDATE m_client_address SET street = SUBSTR (street, 1, 2) || '*********', town = SUBSTR (town, 1, 2) || '*********', postal_code = SUBSTR (postal_code, 1, 2) || '*********', reference_line_1 = SUBSTR (reference_line_1, 1, 2) || '*********', reference_line_2 = SUBSTR (reference_line_2, 1, 2) || '*********'/UPDATE c_direct_debit SET acct_name = SUBSTR (acct_name, 1, 2) || '*********', --sort_code = 570000, bank_acct = 00000019/

    DB:2.72:Required Help In Pl/Sql Code For Data Masking f1

    For a client I created a scramble script that shifted data and leaving the identifiers intact (presuming the person number didn't have any logic to it), that way I didn't have issues with for instance SSN checks.To achieve this, I first analyzed what tables were impacted, and then created a new temporary table containing the keys of the table to be scrambled, the columns to be shifted and a sequence number.Overall logic then is to grab a random person number using the sequence and updating the column with the new value (making sure it isn't the same person number).Hope this helps.Keep in mind that some data needs to be more rigorously anonymized, since they might still contain sensitive information.

  • RELEVANCY SCORE 2.72

    DB:2.72:Problem With Storing Large String In Procedure mz


    i m having a proc in which i m having a cursor for getting column names and table name is the parameter and after that i want to execute merge statement for which i have to join two tables for update clause .but in that update the two tables are having many columns n hence to constuct a string a.col1and b.col2 and .......
    i m not able to store that stiring ina varchar2(4000).plz suggest some idea.

    CURSOR C_MERGE
    IS
    SELECT 'A.'||TRIM(COLUMN_NAME) COL1,
    'B.'||TRIM(COLUMN_NAME) COL2,
    TRIM(COLUMN_NAME) COL3
    FROM ALL_CONSTRAINTS A,
    ALL_CONS_COLUMNS B
    WHERE A.CONSTRAINT_NAME=B.CONSTRAINT_NAME
    AND A.CONSTRAINT_TYPE 'P'
    AND A.TABLE_NAME=P_TABLENAME1;
    FOR I IN C_MERGE

    LOOP

    V_SEL_TAB1 := V_SEL_TAB1 ||I.COL1||',';
    V_SEL_TAB2 := V_SEL_TAB2 ||I.COL2||',';
    V_SEL := V_SEL || I.COL3||',';

    BEGIN

    V_JOIN_UPDATE :=V_JOIN_UPDATE || I.COL2|| '=' ||I.COL1|| ' AND ';

    END LOOP;
    V_SEL_TAB1:=SUBSTR(V_SEL_TAB1,1,LENGTH(V_SEL_TAB1)-1);
    V_SEL_TAB2:=SUBSTR(V_SEL_TAB2,1,LENGTH(V_SEL_TAB2)-1);
    V_SEL :=SUBSTR(V_SEL,1,LENGTH(V_SEL)-1);

    V_MERGE :='MERGE INTO ' ||P_TABLENAME1 ||' B ';
    V_SELECT :=' USING (SELECT '|| V_SEL;
    V_WHERE1 :=' FROM '||P_TABLENAME2||' WHERE SUBSTR(ADDUIDTIME,1,8)='||V_ADDUID||
    ' AND (SUBSTR(EDITUIDTIME,1,8)='||V_ADDUID||' OR EDITUIDTIME IS NULL)' ||
    ' AND ( '||
    '( ' ||
    'TO_NUMBER(SUBSTR(ADDUIDTIME,1,14)) '||V_LASTDATE;

    V_WHERE2 :=' AND TO_NUMBER(SUBSTR(ADDUIDTIME,1,14))= '||V_SYSDATE||
    ')'||
    ' OR' ||
    '(' ||
    ' TO_NUMBER(SUBSTR(EDITUIDTIME,1,14)) '||V_LASTDATE||
    ' AND TO_NUMBER(SUBSTR(EDITUIDTIME,1,14))='||V_SYSDATE||
    ')'||
    ') ) A ' ;
    V_ON :=' ON ( ' || V_JOIN||' )';
    V_MATCH :=' WHEN MATCHED THEN UPDATE SET ';
    V_UNMTCHD:=' WHEN NOT MATCHED THEN ' ;
    V_INSERT := 'INSERT ('||V_SEL_TAB2||')';
    V_VALUES := ' VALUES ('|| V_SEL_TAB1||')';

    /*DBMS_OUTPUT.PUT_LINE(V_MERGE);
    DBMS_OUTPUT.PUT_LINE(V_SELECT);
    DBMS_OUTPUT.PUT_LINE(V_WHERE1);
    DBMS_OUTPUT.PUT_LINE(V_WHERE2);
    DBMS_OUTPUT.PUT_LINE(V_ON);
    DBMS_OUTPUT.PUT_LINE(V_MATCH);
    DBMS_OUTPUT.PUT_LINE(V_UNMTCHD)
    */
    DBMS_OUTPUT.PUT_LINE(V_INSERT);
    DBMS_OUTPUT.PUT_LINE(V_VALUES);
    DBMS_OUTPUT.NEW_LINE;

    EXECUTE IMMEDIATE V_MERGE||V_SELECT||V_WHERE1||V_WHERE2||V_ON||V_MATCH||V_JOIN_UPDATE||V_UNMTCHD||V_INSERT||V_VALUES;


    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERROR IN MERGE CONDN '||SQLERRM);



    END MERGE_STMNT;
    i m getting an error for the variable v_join_update as it does not store the entire join condn.
    Plz suggest a solution for the same.

    Thanks in advance

    DB:2.72:Problem With Storing Large String In Procedure mz

    I know, but it must always have the same number of
    inputs, which is not a limitation using DBMS_SQL.
    There may be a fixed number of inputs in the posted
    code but it is too ugly and unmaintainable for me to
    bother trying to work out whether that is the case
    here.Oh yes I was missing that one.

    Ironically maintainability is often the reason given
    for creating these dynamic, generic monstrosities in
    the first place. Give me a bunch of plain static SQL
    to maintain any day.Anyway dynamic sql if generated with a common logic can be optimized in the same way as static sql, but this is not the case I'm talking about.

    Bye

  • RELEVANCY SCORE 2.71

    DB:2.71:Want To Capture Differed Column(Old And New Column Values ) By Comparing Two Rows In The Logs Table. 7f


    Hi All, I have a table online_hlep_archive which is a logs table data inserted into this table while trigger fired on a main table online_hlep_task on inser/update. One record inserted in logs table through trigger while inserting into the main table. Then that record is updated in the main table again that inserted into the logs table as main table having trigger on insert and update. Now i want to compare these two records which inserted in logs table(ie. inserted record and updated record) and want to capture only updated columns old and new values. This logs table contains total 88 columns user can update any number of columns at a time or many times.1. if insert follows update then comparing these two records want to capture old and new column values of only differed columns .2. if update follows update then comparing these two updated records want to capture old and new column values of only differed columns. Thanks In Advance.@

    DB:2.71:Want To Capture Differed Column(Old And New Column Values ) By Comparing Two Rows In The Logs Table. 7f

    Hi rp0428 As i said , every insert and update of main table will store into logs table, Requirement as follows In the activity logs tab , we have a field like prep_id ( ie. record_id) when ever clicked on prep_id, logs should generate like only updated columns OLD as well as NEW values for that prep_id.Hope you got information. i m reading LogMiner concept which u suggested, i have a doubt using V_$LOGMNR_CONTENTS we can get sql_redo and sql_udo thats fine, how i get only updated columns (fields) old value and new values.My first requirement is :- i want to extract which column is updated 2nd is : - what are the old and new values of that column , for suppose 5 columns updated then i should get that columns old and new values.Help me....Thanks In Advance

  • RELEVANCY SCORE 2.71

    DB:2.71:How To Validate For A Unique Constraint? f7


    Hi all,

    Below is my stored procedure that updates the well name from the VIEW_TABLE1 into the WELL_HEADER_TABLE after comparing the apinumbers present in both the tables .

    I need to put a condition in which the apinumber should be checked and validated to be a unique value in my first comparision .Only the well names corresponding to the unique values of api_number should be updated .

    so can any one suggest me what chages do i need to implement in my code to perform this vaidation.pls help me in resolving this issue....

    Thanks and Regards
    Debashis

    [\n]

    CREATE or REPLACE PROCEDURE WORKFLOW.MERGE AS
    BEGIN

    merge into WORKFLOW.Well_Header_Table
    using WORKFLOW.VIEW_TABLE1
    on (SUBSTR(WORKFLOW.VIEW_TABLE1.API_NUMBER,0,10) = SUBSTR(WORKFLOW.Well_Header_Table.API_NUMBER,0,10) )

    WHEN MATCHED THEN UPDATE SET
    WORKFLOW.Well_Header_Table.WELL_NAME = WORKFLOW.VIEW_TABLE1.WELL_NAME

    WHEN NOT MATCHED THEN INSERT (WORKFLOW.Well_Header_Table.API_NUMBER,WORKFLOW.Well_Header_Table.WELL_NAME,WORKFLOW.Well_Header_Table.SECTION,WORKFLOW.Well_Header_Table.TOWNSHIP,WORKFLOW.Well_Header_Table.RANGE,WORKFLOW.Well_Header_Table.WELL_METER_NUMBER,WORKFLOW.Well_Header_Table.COUNTY_NAME,WORKFLOW.Well_Header_Table.OPERATOR_NAME,WORKFLOW.Well_Header_Table.PRODUCTION_FORMATION,WORKFLOW.Well_Header_Table.STATE_NAME,WORKFLOW.Well_Header_Table.FIELD_NAME,WORKFLOW.Well_Header_Table.WELL_FLAC_NUMBER,WORKFLOW.Well_Header_Table.WELL_LEASE_FLAC,WORKFLOW.Well_Header_Table.WELL_TYPE,WORKFLOW.Well_Header_Table.WELLBORE_PROFILE,WORKFLOW.Well_Header_Table.STATUS)
    values (WORKFLOW.VIEW_TABLE1.API_NUMBER,WORKFLOW.VIEW_TABLE1.WELL_NAME,WORKFLOW.VIEW_TABLE1.SECTION,WORKFLOW.VIEW_TABLE1.TOWNSHIP,WORKFLOW.VIEW_TABLE1.RANGE,WORKFLOW.VIEW_TABLE1.WELL_METER_NUMBER,WORKFLOW.VIEW_TABLE1.COUNTY_NAME,WORKFLOW.VIEW_TABLE1.OPERATOR_NAME,WORKFLOW.VIEW_TABLE1.PRODUCTION_FORMATION,WORKFLOW.VIEW_TABLE1.STATE_NAME,WORKFLOW.VIEW_TABLE1.FIELD_NAME,WORKFLOW.VIEW_TABLE1.WELL_FLAC_NUMBER,WORKFLOW.VIEW_TABLE1.WELL_LEASE_FLAC,WORKFLOW.VIEW_TABLE1.WELL_TYPE,WORKFLOW.VIEW_TABLE1.WELLBORE_PROFILE,null);

    merge into WORKFLOW.Well_Header_Table
    using WORKFLOW.HUG_MASTER_TABLE
    on (SUBSTR(WORKFLOW.HUG_MASTER_TABLE.PARENT1_ATTR_VALUE,0,10) = SUBSTR(WORKFLOW.Well_Header_Table.API_NUMBER,0,10) )

    WHEN MATCHED THEN UPDATE SET
    WORKFLOW.Well_Header_Table.WELL_NAME = WORKFLOW.HUG_MASTER_TABLE.PARENT2_ATTR_VALUE;

    END;

    [n]

    DB:2.71:How To Validate For A Unique Constraint? f7

    Hi Sam /Dan ,

    But in my requirement i need to compare the first 10 digits of the api number so i have made use of substring .No problem Dan seems to be prettybit angry on the way my code looks :-) .....

    Well this unique key is no more a problem .Its resolved as no duplicate values will be present in the apinumber.Now the only challenge infront of me is that i need to validate api number .In case the apiNumber of the view table is greater or less than 10 the well names needs to be updated and rows needs to be inserted into the well header table.

    I have done this part but something is going wrong and its not working .i mean even api number less than 10 are getting inserted and updated .so can u suggest me what changes i need to make

    [\n]

    on (SUBSTR(WORKFLOW.VIEW_TABLE1.API_NUMBER,0,10) = SUBSTR(WORKFLOW.Well_Header_Table.API_NUMBER,0,10) AND count(WORKFLOW.VIEW_TABLE1.API_NUMBER = 10) )

    [n]

    Just check whether this condition will work...

    regards
    Debashis

    Message was edited by:
    debashis-in the wonderland

  • RELEVANCY SCORE 2.71

    DB:2.71:External Table Definition. Can You Use Substr( ) ? cz


    We have an unconvential input file. It looks something like the following, with 3 columns

    123456 This is a description STATIC
    123457 This is a different description DYNAMIC
    123457 And even another description BOTHThe problem lies in the fact that spaces separate the columns, as well as exist in the 'description'.

    Now, it's easy enough to just pull in the data as one column in an EXTERNAL TABLE, and then run a SUBSTR( ) against the data to pull everything apart, but that means either a VIEW, or some PL/SQL.

    Is there anyway to add something like the following into the EXTERNAL TABLE def'n itself?

    COL1 = SUBSTR(row, 1, first space)
    COL2 = SUBSTR(row, first space + 1, position of last space - position of first space - 1)
    COL3 = SUBSTR(row, last space + 1)

    I can write this pseudocode as proper SQL, but I don't know how to add it to the table def'n. Alll the examples I've seen so far format incoming date data, like

    ...
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY EDS_DATA_DIR
    ACCESS PARAMETERS
    ( records delimited by newline
    nobadfile nologfile nodiscardfile
    fields terminated by '|'
    missing field values are null
    reject rows with all null fields
    (
    TK,
    CIT_NO,
    CONTEST_DT DATE "YYYY/MM/DD"
    NULLIF ( CONTEST_DT = BLANKS ),
    ...but nothing resembles what I need.

    Thanks,
    --=Chuck

    DB:2.71:External Table Definition. Can You Use Substr( ) ? cz

    Expand my comfort zone? Preposterous! :)

    It looks like the EXTERNAL TABLE + VIEW is the easiest way to go. We mount our database server to a portion of the LAN where our systems analysts can deposit files. Then, we point directory objects there in order to read in data via EXTERNAL TABLES. These same systems analysts also tinker with the EXTERNAL TABLE def'ns, so I wanted to keep things accessible to them (plus it was easier for me to assist them along). So, the DDL that ended up solving the problem:

    CREATE TABLE SCHEMA.TABLE
    (
    LINE VARCHAR2(150 BYTE)
    )
    ORGANIZATION EXTERNAL
    (
    type oracle_loader
    default directory DIR_OBJ
    access parameters
    ( records delimited by newline
    fields terminated BY '|'
    ( line )
    ) LOCATION ( DIR_OBJ:'INPUT_FILE' )
    )
    REJECT LIMIT UNLIMITED;

    CREATE OR REPLACE VIEW SCHEMA.VIEW
    (ID, DESC, STATUS)
    AS
    SELECT SUBSTR(load.line,1,6) AS ID,
    SUBSTR(load.line, instr(load.line,' ')+1, instr(load.line,' ',-1,2)-instr(load.line,' ')-1) AS DESC,
    SUBSTR(load.line, instr(load.line,' ',-1, 2)+1) AS STATUS
    FROM schema.table load;--=cf

  • RELEVANCY SCORE 2.70

    DB:2.70:Compare List Item With .Csv File jp


    Hi,
    Here is my requirement...The concept is pretty complex ,i hope.I need to compare the list which is there in the sharepoint and i need to update the list by comparing the CSV file which is there in the Documents.There are more than
    10 columns and one or two columns primary key .Some of the details already updated .i need to update the same row by comparing with CSV file ..because someof the details missed out in the sharepoint list(like some field values) by comparing with.CSV
    file i will update the entire list which is present in the sharepoint list.
    Thanks,
    karthiii!..

    DB:2.70:Compare List Item With .Csv File jp

    You can create a custom web part or an event receiver to perform you operation. If you are reading the file from the file system you need to create a farm solution or if it is residing in a SharePoint library a sandbox solution should work for you.
    1. First
    read the CSV file into a datatable for convenience
    2. Read the list items from the list one by one and compare the values in the fields
    3. If the data is missing in the list you can read it from the table and update the item
    Let me know if you have any other doubts.NLV - MCTS - Blog -
    Twitter - In

  • RELEVANCY SCORE 2.70

    DB:2.70:Comparing Values Using Linq To Sql And Visual C# mf


    i have done this,,,and i want to compare values from sql server database
    UsaAMSDBDataContext usaamms = new UsaAMSDBDataContext(); var login = from admin in usaamms.Admin_Logins select admin;
    i have two text boxes txtusername and txtpassword,
    and database table consist of two columns Name and Passsword...
    Plzz tell me what will condition i can apply for comparing database value to txtusername and txtpassword,,...
    --- i am making a Login Page..

    DB:2.70:Comparing Values Using Linq To Sql And Visual C# mf

    You should strongly consider using the SqlMembershipProvider, http://msdn.microsoft.com/en-us/library/ms998347.aspx. You can add the tables directly to your database and even create relationships with your tables.Mike Huguet

    http://www.geekswithblogs.com/mikehuguet

    http://twitter.com/mhuguet

  • RELEVANCY SCORE 2.70

    DB:2.70:Comparing Two Fpga Design 3a



    What is more practical to use in comparing two design?no. of occupied slices from the map report or the actual ratio from synthesis report

    DB:2.70:Comparing Two Fpga Design 3a


    You are measuring complexity by the number of elements a design uses. The difficulty with that is in an FPGA there different type of elements: registers, LUTs, DSPs, memory, serdes etc. So complexity should be a weighted function of the number of all these elements. It is your responsibility to come up with the proper weights. I would suggest start with this:C = 1*SREG + 1 * LUT + 3*IO + 20 * RAM36 + 3*DSP48 + 3*MMCM. If you disagree with any of the multipliers, you are welcome to change them as you like :-)




    ---------------------------------------------------------------------------------------------Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.Give Kudos to a post which you think is helpful and reply oriented.---------------------------------------------------------------------------------------------

  • RELEVANCY SCORE 2.69

    DB:2.69:Two Release Strategies c8



    Hi Experts

    1. How release steategy is determined? By comparing the characterstic values to PO item values? if so, what is the influence of release group in determination of release strategy?

    2. If i define similar strategies (with same characteristic values), what is the impact? which strategy will be determined?

    Warm regards

    ramSiva

    DB:2.69:Two Release Strategies c8


    Dear Marias

    Release strategy is determined by the values assigned in the characteristics attached to a class. E.g Two characteristics are attached. Purchasing Group and Plant. System will compare its values in the PO to that of values assigned in the release strategy, if one of them is different in the PO, release strategy will not be triggered.

    Release group will have the same release levels and strategy. There will be two release groups needed if the approval interval values are different between two departments. If there were a third department that had the same approval interval values, it could share a release group and the release strategy would be for more than one department.

    If you define similar strategies, the impact on the system is not much different. System will allow you to create similar strategies and release will only be triggered if the characteristic values are matched. Both the strategies will be similar so only one of them will be triggered (as values are same).

    Regards,

    Ahmad Farhan Khalid

  • RELEVANCY SCORE 2.69

    DB:2.69:Comparing Values In Quickview 7a



    Dear all,

    can we compare the values of one particular which is in two tables and then i want the data in quickview

    while executing the quickview report(i have taken two tables).now i have to compare one particular field which is available in two tables

    after comparing if the value of the that field is same in two tables;

    similarity of that field in two tables data i require.

    Please help me out in doing it.

    Is there any facility in infoset query to compare.?

    DB:2.69:Comparing Values In Quickview 7a


    Do an ordinary join in Quickviewer. Export the list to Excel. Excel offers far more options to analyse the data.

  • RELEVANCY SCORE 2.69

    DB:2.69:Comparing Data In Cells Of Two Columns j1


    https://skydrive.live.com/redir?resid=849E1B00B33DEEFD!218

    DB:2.69:Comparing Data In Cells Of Two Columns j1

    Hi,

    Try this

    1. Select A2:A478, press the Ctrl key and then select B2:B2579
    2. Go to Home Conditional formatting New Rule Format only Unique or Duplicate Values Duplicates
    3. Click on Format and choose any Fill colour
    4. Click on OK/Apply

    You may now filter on either column on colour Red.

    Hope this helps.

  • RELEVANCY SCORE 2.69

    DB:2.69:Comparing Object And String c9


    I have a method called getKey() which returns and Object and I want to use it to retrieve the Key of a and then compare it with a string called names[0].

    The code I have tried to use is:

    if (a.getKey() != names[0])However I know this is wrong as it doesn't work and it is comparing two different types, How would I convert the Object to a string to compare the two values?

    DB:2.69:Comparing Object And String c9

    String str = a.getKey().toString();
    if( str.equals(name[0]) )
    {
    ..........
    ...
    }no need for toString. doesn't matter if the String is hidden behind an Object reference, it's still a String

    java.lang.Object.equals takes Objects, no matter what classes are involved

  • RELEVANCY SCORE 2.69

    DB:2.69:Lexical Parameters kp


    Hi,
    I am using lexical reference in the report. I am dynamically
    building the text for the columns (to use in select statement)
    in the before report trigger.

    Question is: The query works fine, but the output contains the
    string I have build in the trigger, not actually pulling any
    data from the database.

    For ex:

    select
    column1 COL1,
    beg_bal beg_balance (lexical)
    from
    gl.gl_balances
    where
    .....

    In the beforereport trigger, I am building the string for
    beg_bal and assigning it to a placeholder column.
    beg_bal := substr('5600',period_net_dr) --Just an example
    syntax not correct

    The output contains this :

    COL1 beg_bal

    1 substr('5600',period_net_dr)
    2 substr('5600',period_net_dr)

    I need values to be pulled from the database.

    I hope somebody had come across this kind of problem.

    Thanks in advance.

    BV

    DB:2.69:Lexical Parameters kp

    Hi,
    I am using lexical reference in the report. I am dynamically
    building the text for the columns (to use in select statement)
    in the before report trigger.

    Question is: The query works fine, but the output contains the
    string I have build in the trigger, not actually pulling any
    data from the database.

    For ex:

    select
    column1 COL1,
    beg_bal beg_balance (lexical)
    from
    gl.gl_balances
    where
    .....

    In the beforereport trigger, I am building the string for
    beg_bal and assigning it to a placeholder column.
    beg_bal := substr('5600',period_net_dr) --Just an example
    syntax not correct

    The output contains this :

    COL1 beg_bal

    1 substr('5600',period_net_dr)
    2 substr('5600',period_net_dr)

    I need values to be pulled from the database.

    I hope somebody had come across this kind of problem.

    Thanks in advance.

    BV

  • RELEVANCY SCORE 2.69

    DB:2.69:Comparing Data Values aj


    Hi all

    I wonder if anyone could point be in the right direction as to what techniques I can use to evaluate 2 values in a relation. What I want to do is compare rows in two columns and when the two column values are say 1, 3 and match with another row in the same columns, which are also 1, 3 then raise an error or message. All i am really concentrating on just now is what to use to compare the rows in the columns. The main sticking point is how to combine the two row values, evaluate them as one and compare. I have written a small cursor that evaluates them seperately and to my novice knowledge I am not sure if you can somehow concat the values and evaluate as one?

    Could anyone be so kind as to suggest possible way(s) of doing this; i'm really looking for pointers because like to try and figure it out myself if possible.

    Novice

    DB:2.69:Comparing Data Values aj

    This could be what I'm looking for. Data is from one table so will try and get a solution from your final statement.

    Thanks

    Novice

  • RELEVANCY SCORE 2.69

    DB:2.69:Problem In Insert a8


    Hi All,

    I have a query mentioned below.

    I am taking values from XML for some fields.The problem is while inserting some of the columns(XML) are null and only the last column(XML) has values. But when I execute the select statement alone, all the columns(XML) has values.

    I created another table with just three columns and tried to insert values from XML all the fields are having values.

    Kindly suggest me on this issue.

    Structure of the table
    ----------------------
    IB_BR_ID NUMBER(20)
    IB_BR_MITTENTE VARCHAR2(50)
    IB_BR_RICEVENTE VARCHAR2(50)
    IB_BR_IMPORTO VARCHAR2(25)
    IB_BR_DATA_VALUTA DATE
    IB_BR_DATA_VALUTA_D DATE
    IB_BR_DATA_REGIME DATE
    IB_BR_DATA_ORDINE DATE
    IB_BR_DATA_CONTABILE DATE
    IB_BR_CRO VARCHAR2(20)
    IB_BR_O_ANAG VARCHAR2(50)
    IB_BR_O_COD VARCHAR2(30)
    IB_BR_D_ANAG VARCHAR2(50)
    IB_BR_D_COD VARCHAR2(30)
    IB_BR_D_IND VARCHAR2(4000)
    IB_BR_D_LOC VARCHAR2(35)
    IB_BR_CAUSALE VARCHAR2(50)
    IB_BR_DIVISA VARCHAR2(5)
    IB_BR_CAUSALE_SIA VARCHAR2(20)

    INSERT INTO /*+ append */ IBG_MA_BONIFICI_RETE (
    IB_BR_MITTENTE, --1
    IB_BR_RICEVENTE, --2
    IB_BR_IMPORTO,--3
    IB_BR_DATA_VALUTA,--4
    IB_BR_DATA_VALUTA_D,--5
    IB_BR_DATA_REGIME, 6
    IB_BR_DATA_ORDINE,--7
    IB_BR_DATA_CONTABILE,--8
    IB_BR_CRO,--9
    IB_BR_O_ANAG,--10
    IB_BR_O_COD, --11
    IB_BR_D_ANAG, --12
    IB_BR_D_COD,--13
    IB_BR_D_IND, --14
    IB_BR_D_LOC, --15
    IB_BR_CAUSALE, --16
    IB_BR_DIVISA, --17
    IB_BR_CAUSALE_SIA--18
    )
    SELECT DS_ABI_BANCA_PROP,
    DS_ABI_BANCA_DESTINATARIA,
    LTRIM( TO_CHAR(DS_IMPORTO, '9999999999999999990D90', 'NLS_NUMERIC_CHARACTERS='',.''')) || '/C' as x,
    TRUNC(DS_DATA_VALUTA_ADDEBITO) as y,
    TRUNC(DS_DATA_VALUTA_BENEF_CLIENTE) as z,
    --NULL,
    TRUNC(DS_DATA_ESECUZIONE) as xx,
    TRUNC(DS_DATA_INIZIO_STATO) as yy,
    SUBSTR(DS_RIF_UNIVOCO,1,20) as one,
    SUBSTR(XMLTYPE(DS_DETTAGLI_XML).EXTRACT('/DISPOSIZIONE_PC_DETAILS/@DENOMINAZIONE_ORDINANTE').getStringVal(),1,50) as two,
    SUBSTR(XMLTYPE(DS_DETTAGLI_XML).EXTRACT('/DISPOSIZIONE_PC_DETAILS/@CODICE_FISCALE_ORDINANTE').getStringVal(),1,30) as three,
    SUBSTR(XMLTYPE(DS_DETTAGLI_XML).EXTRACT('/DISPOSIZIONE_PC_DETAILS/@DESCRIZIONE_DESTINATARIO').getStringVal(),1,50) as four,
    SUBSTR(DS_CONTO_DESTINATARIO, 5, 8) as five, --13
    SUBSTR(to_char(XMLTYPE(DS_DETTAGLI_XML).EXTRACT('/DISPOSIZIONE_PC_DETAILS/@INDIRIZZO_DESTINATARIO').getStringVal()),1,20) as six,
    SUBSTR(DS_LOCALITA_BENEF,1,35) as seven, --15
    SUBSTR(XMLTYPE(DS_DETTAGLI_XML).EXTRACT('/DISPOSIZIONE_PC_DETAILS/@DESCRIZIONE_RIFERIMENTO_OPERAZIONE').getStringVal(),1,50),
    DS_ISO_DIVISA_ADDEBITO, --17
    SUBSTR(DS_CAUSALE,1,20)
    FROM PRG_TR_DISPOSIZIONE
    WHERE DS_ABI_BANCA_PROP = '03268'
    AND DS_STATO = 'ESAUR'
    AND DS_TIPO_INTERNO IN ('BSI','BAII')
    AND TRUNC(DS_data_inizio_stato) between trunc(to_date('01-01-2006','dd/mm/yyyy'))
    and trunc(to_date('02-01-2006','dd/mm/yyyy')) and rownum 2;

    Thanks in advance,
    Jaggy

    DB:2.69:Problem In Insert a8

    Hi Sanjeev,

    I am not going to insert the XML as it is. I am using substr to limit the value to the length of the field.

    Casting to varchar2 - Yes this is there in the query. Pls correct me if I am wrong

    Thank You
    Jaggy

  • RELEVANCY SCORE 2.69

    DB:2.69:Comparing 2 Spreadsheet fx


    Hi,

    I am trying to compare 2 spreadsheet together and check if the values are matching.
    Both the spreasheet contains morethan 10 columns.
    for example
    Sheet 1"
    12123 Apple US ca 201030 45
    12123 Apple US ca 201031 800
    24234 Pine UK LN 201030 700

    Sheet 2:
    12123 Apple US ca 201030 45
    12123 Apple US ca 201031 800
    24234 Pine UK LN 201030 700
    24234 Pine UK LN 201030 90

    I need to compare 2 sheets and check if the combination of the values are not matching.

    DB:2.69:Comparing 2 Spreadsheet fx

    I would insert two helper columns (new columns A and B) in both sheets.
    I'd put a formula like this in A1:
    =c1"|"d1"|"e1"|"f1"|"g1"|"h1
    Then drag down as required.
    Put this formula in column A of both sheets.
    This means that there is a single column in both sheets that can be compared,
    instead of looking at all 5 individual columns.
    Then in B1 of sheet1, I'd use this formula:
    =isnumber(match(a1,'sheet2'!a:a,0))
    and drag down.
    And in B1 of Sheet2, I'd use the "opposite" formula:
    =isnumber(match(a1,'sheet1'!a:a,0))
    and drag down
    Each of these formulas will returen true or false. True means that the value in
    A1 oppears in column A of the other sheet. False means that it doesn't.
    Next, I'd add header rows and apply data|filter|autofilter (in xl2003 menus).
    Then I could filter to show the matches or mis-matches.
    ranmukhe wrote:

    Hi,

    I am trying to compare 2 spreadsheet together and check if the values are matching.

    Both the spreasheet contains morethan 10 columns.

    for example

    Sheet 1"

    12123 Apple US ca 201030 45

    12123 Apple US ca 201031 800

    24234 Pine UK LN 201030 700

    Sheet 2:

    12123 Apple US ca 201030 45

    12123 Apple US ca 201031 800

    24234 Pine UK LN 201030 700

    24234 Pine UK LN 201030 90

    I need to compare 2 sheets and check if the combination of the values are not matching.

    --
    Dave Peterson

  • RELEVANCY SCORE 2.69

    DB:2.69:Comparing Column Values ka


    Hi, I have 3 tables each of them with 2 columns and multiple rows.

    Column 1 stores "Key"
    Column 2 stores "Effective_date"

    Using SQL or PL/SQL, I am trying to join the 3 tables and get the Maximum Effective_date value by comparing Column2 in each of the 3 tables.

    Can someone please help.

    DB:2.69:Comparing Column Values ka

    Hi,

    You can do the same using MAX function and group by column 1 - "Key" if there is not greatest function.

    Jakub

  • RELEVANCY SCORE 2.69

    DB:2.69:Comparing 2 Columns ck


    Hi All,
    Is there a way to see if columnA values are in columnB values, and if they are leave it blank if not change the cell to red (or just put the letter x or something)
    Thanks,
    rodchar

    DB:2.69:Comparing 2 Columns ck


    To apply some Conditional Formatting to highlight the matching cells, select all of column A by clicking on the header label. From the Home tab's Styles group, click Conditional Formatting and select New Rule
    from the menu.
    Select Use a formula to determine which cells to format from the Select a Rule Type list. Put this formula into the Format values where this formula is true: box,
    =IF(COUNTIF(B:B,A1)0,TRUE,FALSE)

    That can be reduced to:
    =COUNTIF(B:B,A1)
    If the formula returns any number other than 0, Excel will evaluate that as being TRUE and apply the formatting.
    When the formula returns 0 Excel will evaluate that as being FALSE and no format will be applied.
    --
    Biff
    Microsoft Excel MVP

  • RELEVANCY SCORE 2.68

    DB:2.68:Utl_File String To Individual Columns For An Insert To Table p8


    Hi All,

    Could anyone help in trying to find a method in extracting a string from using utl file to get the indiviual values inserted in to a table.

    I have the following method so far.

    F1 := UTL_FILE.FOPEN('DIRSANGHA',filename2,'R');
    UTL_FILE.GET_LINE(F1,V1);
    ln_count := 0; -- counts instr and substr functions
    ln_instra := 2; -- counts instr and substr functions
    ln_instrb := 3; -- counts instr and substr functions
    UTL_FILE.GET_LINE(F1,V1);
    --obtina values for first 2 columns
    dbms_output.PUt_line (substr(v1,1,instr(v1,',',1)-1));
    dbms_output.PUt_line ( substr(v1,instr(v1,',',1)+1,instr(v1,',',2)));

    LOOP
    --obtain values for remaining columns
    EXIT WHEN ln_count = 2;

    dbms_output.PUt_line ( substr(v1, instr(v1,',',1,ln_instra)+1, (instr(v1,',',1,ln_instrb)) - (instr(v1,',',1,ln_instra)) -1 ));
    ln_count := ln_count + 1;
    ln_instra := ln_instra + 1;
    ln_instrb := ln_instrb + 1;

    END LOOP;

    I am hard coding the number of loops to match what will be the number of columns in the table, although i am considering using user_tab_cols to make it dynamic.

    This gives me individual values from the strings obtained by utl_file

    What i'm stuck on is a sufficient method to get the values returned from the substr(instr functions assigned to variable (or maybe not) and use them to insert into a table.

    Hope this makes sense,

    Thanks in advance.

    G

    DB:2.68:Utl_File String To Individual Columns For An Insert To Table p8

    12th Monkey wrote:
    Hi Centinal,

    thanks for the advice, posting on here was a last resort for information so will take your advice on board and move to looking into the other two options.

    GIt is perfectly easy to split a comma seperated string into it's component data using programatic methods, but as others have said, I would use External tables in the first instance as these will just do it all for you. SQL*Loader will cause you to require uploading the data from outside of the database and using UTL_FILE, whilst inside the database, will just be more hard work and liable to bugs in the code.

  • RELEVANCY SCORE 2.68

    DB:2.68:File Data Transformation pd


    Hello,

    Looking for some advise...

    We have text file as a source and one of the column "Period" has data in Q1FY10 format. And in the ODI interface this text source file column needs to be parsed to map two columns in the target (Time Year)

    Ex: Q1 - Time
    FY10 - FY10

    How do we parse/transform the source column "period"? to map to two different columns in target?

    If the source was a relational table, we could have used substr(column period,1,2) - Time substr(column period,3) - Year.

    Thanks in advance for your help.

    DB:2.68:File Data Transformation pd

    Well, it worked this time. not sure what i did on the first try i feel i did the same. I guess its all John's magic???

    Any way thank you guys.

  • RELEVANCY SCORE 2.67

    DB:2.67:Encypted Technique.... sx


    Hi Experts,

    I want some encrypt techniques to use in on of my application.

    basic requirement is external table authentication. I am having a table name HR_user, in this table i am having two columns username and pawwdord.

    here my goal is when i am inserting records into table it password should store in encrypted format........can any one suggest this?

    next requirement is when comparing the password the user enterd password also encrypted and compare with table values.
    Like this Select password from hr_user where password=encryptmethod(:password)
    here encryptmethhod is any DB function.

    Thanks,
    KSS.

    DB:2.67:Encypted Technique.... sx

    I have as well used and would suggest DBMS_CRYPTO package.

    You may take a look here for an example:
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_crypto.htm

  • RELEVANCY SCORE 2.67

    DB:2.67:T-Sql: Nvarchar Columns , Comparison Issue pm


    Dear friends,
    i have two columns Column_a with nvarchar(510) and column_b with nvarchar(510). now i am comparing these columns. even if the values are totally different i am not getting any result here .
    Example
    SELECT *
    FROM Table
    WHERE column_a column_b
    NO result.

    Could you please provide any solution on this.

    Thanks in advance
    Parixit

    DB:2.67:T-Sql: Nvarchar Columns , Comparison Issue pm

    The BINARY_CHECKSUM check really came through for me. I was comparing what I thought to be two identical values, and receiving a false match. Using BINARY_CHECKSUM revealed that I was comparing an NVARCHAR(80) typed variable against an NVARCHAR(60)
    typed variable. No workie workie!
    Thanks Ganesh!

  • RELEVANCY SCORE 2.66

    DB:2.66:Re: Comparing Time ds


    Hi,

    I want to compare the time of a file with the current time in a drawing and
    display how long ago it was changed.

    I've written this code wich almost works;

    (if ( (setq tyd (- (getvar "cdate") (cdar (dos_filedate
    filename)))) 2)
    (if (null (vl-string-search "." (setq tyd (rtos tyd 2 2))))
    (setq tyd (strcat tyd " dagen geleden"))
    (if (= (substr tyd (+ (vl-string-search "." tyd) 2) 1) "0")
    (setq tyd (strcat (substr tyd 1 (vl-string-search "."
    tyd)) " dagen en " (substr tyd (+ (vl-string-search "." tyd) 3) 1) " our
    ago"))
    (setq tyd (strcat (substr tyd 1 (vl-string-search "."
    tyd)) " dagen en " (substr tyd (+ (vl-string-search "." tyd) 2) 2) " ours
    ago"))
    ) )
    (if ( tyd 1)
    (if (null (vl-string-search "." (setq tyd (rtos tyd 2 2))))
    (setq tyd (strcat tyd " dag geleden"))
    (if (= (substr tyd (+ (vl-string-search "." tyd) 2) 1)
    "0")
    (setq tyd (strcat (substr tyd 1 (vl-string-search "."
    tyd)) " dag en " (substr tyd (+ (vl-string-search "." tyd) 3) 1) " our
    ago"))
    (setq tyd (strcat (substr tyd 1 (vl-string-search "."
    tyd)) " dag en " (substr tyd (+ (vl-string-search "." tyd) 2) 2) " ours
    ago"))
    ) )
    (if (null (vl-string-search "." (setq tyd (rtos tyd 2 2))))
    (setq tyd (strcat "pas"))
    (if (= (substr tyd (+ (vl-string-search "." tyd) 2) 1)
    "0")
    (setq tyd (strcat (substr tyd (+ (vl-string-search "."
    tyd) 3) 1) " our ago"))
    (setq tyd (strcat (substr tyd (+ (vl-string-search "."
    tyd) 2) 2) " ours ago"))
    ) )
    ) )

    Maby someone can halp me beceause it does not always seem te work.

    I think this has to do with the result of the time not being always the same
    strlen.

    M

    DB:2.66:Re: Comparing Time ds

    Thanx, but I liked Don's comment better.

    You can see my comment at his reply.

    M

    schreef in bericht news:5000056@discussion.autodesk.com...
    It seems to me that somehow you've got your console returning the date in
    scientific notation. that could be a problem. the only thing you can do
    about this date comparison is convert the whole crazy thing into days.
    using first the difference between the months ie... 200511 - 200508 = 3 * 30
    would give you circa 90 days. subtract the date of the initial month. ie the
    17th or whatever from 90. and add the number of days into the most recent
    month. ie the first so +1. to hell with the hours you are on your own
    there.. the first part of the date seems to be the same. so you should be
    able to use one of the string functions to get it figured out. when you get
    the cdate from autolisp make sure that you use fix otherwise it returns it
    in the scientific method which is just retarded imo. If you reall wanted to
    get it right though you could get the date out use a cond to figure out the
    number of days in a given month and plug it into your formula there. good
    luck with leap years though.

    hth

    J

    Note:

    returns from console

    Command: (getvar "cdate")
    2.00511e+007
    Command: (fix(getvar "cdate"))
    20051101

    Message was edited by: evillispmonkey

  • RELEVANCY SCORE 2.66

    DB:2.66:Data Types Field Lengths dp



    hi,

    we can compare values of fields using where condition,if condition etc.,

    but is there a chance of comparing data types field lengths of two fields.

    DB:2.66:Data Types Field Lengths dp


    Hi Sari,

    sure you can. Use the DESCRIBE FIELD statement or Run Time Type Identification.

    Look at http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb3145358411d1829f0000e829fbfe/frameset.htm

    Cheers

    Graham Robbo

  • RELEVANCY SCORE 2.65

    DB:2.65:Want To Be Geek Here....Not Sure What Formula To Use. Help Is Much Appreciated 7c


    What I am trying to achieve: A total countof all students with a value of 1 in either
    or both of columns "M" and "T". (not duplicated counts)

    I'm comparing two columns of values. Each rowin column "M" and "T" contain a value of "0" or "1". If either one of the columns (M or T) contains a value of "1" return the value of "1" in column "U".

    I've attempted the formula below but it will not return the value on column "T":

    =IF(M16=1,1,0)*OR(T16=1,1,0)

  • RELEVANCY SCORE 2.65

    DB:2.65:Analyze Why Aud$ Table Making More Io? a1


    Analyze why aud$ table making more IO. Looking for urgent helpWORKLOAD REPOSITORY report for DB NameDB IdInstanceInst numReleaseRACHostGLODIST964540828glodist110.2.0.4.0NOxsj-psdbgen01Snap IdSnap TimeSessionsCursors/SessionBegin Snap:3799524-Mar-14 08:00:59528.2End Snap:3800524-Mar-14 18:00:18628.3Elapsed: 599.32 (mins) DB Time: 529.35 (mins) Report SummaryCache Sizes BeginEndBuffer Cache:224M224MStd Block Size:8KShared Pool Size:300M300MLog Buffer:2,112KLoad ProfilePer SecondPer TransactionRedo size:37,208.4237,830.37Logical reads:3,540.413,599.59Block changes:196.65199.93Physical reads:2,222.122,259.26Physical writes:8.108.24User calls:22.1822.55Parses:2.822.87Hard parses:0.040.04Sorts:4.234.30Logons:0.040.04Executes:24.6125.02Transactions:0.98 % Blocks changed per Read:5.55Recursive Call %:83.54Rollback per transaction %:0.03Rows per Sort:71.66Instance Efficiency Percentages (Target 100%) Buffer Nowait %:100.00Redo NoWait %:99.99Buffer Hit %:37.40In-memory Sort %:100.00Library Hit %:99.54Soft Parse %:98.46Execute to Parse %:88.53Latch Hit %:100.00Parse CPU to Parse Elapsd %:70.72% Non-Parse CPU:99.79Shared Pool Statistics BeginEndMemory Usage %:75.4889.20% SQL with executions1:90.3794.14% Memory for SQL w/exec1:86.8588.94Top 5 Timed Events EventWaitsTime(s)Avg Wait(ms)% Total Call TimeWait ClassPX Deq Credit: send blkd40,80615,62938349.2OtherCPU time 10,294 32.4 db file scattered read2,703,0845,088216.0User I/Odb file sequential read1,024,3381,82125.7User I/Olog file parallel write42,965415101.3System I/OMain Report Report Summary Wait Events Statistics SQL Statistics Instance Activity Statistics IO Stats Buffer Pool Statistics Advisory Statistics Wait Statistics Undo Statistics Latch Statistics Segment Statistics Dictionary Cache Statistics Library Cache Statistics Memory Statistics Streams Statistics Resource Limit Statistics init.ora Parameters Back to Top Wait Events Statistics Time Model Statistics Wait Class Wait Events Background Wait Events Operating System Statistics Service Statistics Service Wait Class Stats Back to Top Time Model StatisticsTotal time in database user-calls (DB Time): 31761.3s Statistics including the word "background" measure background process time, and so do not contribute to the DB time statistic Ordered by % or DB time desc, Statistic name Statistic NameTime (s)% of DB Timesql execute elapsed time31,377.5598.79DB CPU10,293.5932.41connection management call elapsed time86.790.27parse time elapsed31.390.10hard parse elapsed time17.610.06PL/SQL execution elapsed time14.610.05sequence load elapsed time9.100.03PL/SQL compilation elapsed time3.390.01repeated bind elapsed time0.180.00hard parse (bind mismatch) elapsed time0.090.00hard parse (sharing criteria) elapsed time0.090.00failed parse elapsed time0.040.00DB time31,761.28 background elapsed time1,189.05 background cpu time421.22 Back to Wait Events Statistics Back to Top Wait Classs - second cs - centisecond - 100th of a second ms - millisecond - 1000th of a second us - microsecond - 1000000th of a second ordered by wait time desc, waits desc Wait ClassWaits%Time -outsTotal Wait Time (s)Avg wait (ms)Waits /txnOther42,73419.1515,6323661.21User I/O3,755,0980.007,0082106.17System I/O140,2210.0080563.96Commit15,7087.68246160.44Scheduler4,5270.0075170.13Network915,0740.0038025.87Configuration41764.2722520.01Concurrency4180.0014330.01Administrative300.00113670.00Application160.001400.00 Back to Wait Events Statistics Back to Top Wait Eventss - second cs - centisecond - 100th of a second ms - millisecond - 1000th of a second us - microsecond - 1000000th of a second ordered by wait time desc, waits desc (idle events last) EventWaits%Time -outsTotal Wait Time (s)Avg wait (ms)Waits /txnPX Deq Credit: send blkd40,80618.9515,6293831.15db file scattered read2,703,0840.005,088276.43db file sequential read1,024,3380.001,821228.96log file parallel write42,9650.00415101.21log file sync15,7087.68246160.44control file parallel write15,7740.00187120.45db file parallel write29,1550.0015750.82resmgr:cpu quantum4,5270.0075170.13direct path read7,7040.004150.22log file sequential read1,8150.0033180.05direct path write temp4,0560.002770.11db file parallel read8,5560.002430.24SQL*Net more data to client127,4680.002303.60log file switch completion15710.83221370.00os thread startup690.00121770.00switch logfile command300.00113670.00SQL*Net more data from dblink1180.008640.00SQL*Net message to client783,7450.007022.16Log archive I/O1,4130.00640.04control file sequential read48,8630.00501.38direct path read temp4,0360.00410.11direct path write3,2290.00310.09latch free870.002250.00latch: cache buffers chains1740.00180.00log file single write2360.00130.01enq: PR - contention20.0013620.00read by other session950.00170.00SQL*Net break/reset to client100.001640.00SQL*Net more data from client3,5160.00100.10rdbms ipc reply3630.00010.01buffer busy waits1200.00020.00log file switch (private strand flush incomplete)40.000420.00LGWR wait for redo copy5940.17000.02latch: shared pool110.00040.00PX Deq: Signal ACK492.04010.00latch: session allocation340.00010.00latch: In memory undo latch330.00010.00PX qref latch76558.95000.02latch: object queue header operation130.00010.00enq: KO - fast object checkpoint60.00010.00SQL*Net message to dblink2260.00000.01undo segment extension25698.05000.01latch: library cache110.00000.00reliable message80.00000.00latch: redo allocation40.00010.00latch: cache buffers lru chain70.00000.00enq: PS - contention20.00000.00SQL*Net more data to dblink10.00000.00SQL*Net message from client783,7350.00842,558107522.16PX Idle Wait144,84999.99282,77219524.10Streams AQ: waiting for messages in the queue7,184100.0035,05748800.20Streams AQ: qmn slave idle wait1,2800.0034,983273300.04Streams AQ: qmn coordinator idle wait2,60050.8834,983134550.07PX Deq: Execution Msg10,48286.2317,85017030.30Streams AQ: waiting for time management or cleanup tasks8100.008,65010812410.00PX Deq Credit: need buffer6,43113.191,6672590.18PX Deq: Table Q Normal82,3550.0351862.33SQL*Net message from dblink2260.0021930.01PX Deq: Execute Reply7020.7115210.02single-task message110.0011360.00PX Deq: Msg Fragment740.001110.00class slave wait210.00070.00PX Deq: Parse Reply210.00030.00PX Deq: Join ACK570.00010.00 Back to Wait Events Statistics Back to Top Background Wait Eventsordered by wait time desc, waits desc (idle events last) EventWaits%Time -outsTotal Wait Time (s)Avg wait (ms)Waits /txnlog file parallel write42,9640.00415101.21control file parallel write15,7740.00187120.45db file parallel write29,1550.0015750.82log file sequential read1,8150.0033180.05db file sequential read6,6560.00810.19Log archive I/O1,4130.00640.04db file scattered read6300.00580.02control file sequential read31,7950.00400.90os thread startup210.0031590.00direct path write3,2100.00310.09log file single write2360.00130.01events in waitclass Other9810.10110.03direct path read4,2160.00000.12buffer busy waits210.00000.00latch: cache buffers chains30.00000.00rdbms ipc message166,55376.47411,66024724.71pmon timer11,975100.0035,05129270.34Streams AQ: qmn slave idle wait1,2800.0034,983273300.04Streams AQ: qmn coordinator idle wait2,60050.8834,983134550.07smon timer2906.9034,5471191280.01Streams AQ: waiting for time management or cleanup tasks8100.008,65010812410.00Back to Wait Events Statistics Back to TopOperating System StatisticsStatisticTotalAVG_BUSY_TIME3,225,705AVG_IDLE_TIME367,471AVG_IOWAIT_TIME0AVG_SYS_TIME405,795AVG_USER_TIME2,818,869BUSY_TIME25,814,038IDLE_TIME2,947,890IOWAIT_TIME0SYS_TIME3,254,672USER_TIME22,559,366LOAD7OS_CPU_WAIT_TIME6,716,800RSRC_MGR_CPU_WAIT_TIME7,333VM_IN_BYTES4,978,737,152VM_OUT_BYTES0PHYSICAL_MEMORY_BYTES46,324,703,232NUM_CPUS8Back to Wait Events Statistics Back to TopService Statisticsordered by DB Time Service NameDB Time (s)DB CPU (s)Physical ReadsLogical ReadsSYS$USERS28,520.807,364.5043,945,07090,464,286glodist3,246.302,931.3035,932,66336,447,697SYS$BACKGROUND0.000.0033,845405,030 Back to Wait Events Statistics Back to Top Service Wait Class StatsWait Class info for services in the Service Statistics section. Total Waits and Time Waited displayed for the following wait classes: User I/O, Concurrency, Administrative, Network Time Waited (Wt Time) in centisecond (100th of a second) Service NameUser I/O Total WtsUser I/O Wt TimeConcurcy Total WtsConcurcy Wt TimeAdmin Total WtsAdmin Wt TimeNetwork Total WtsNetwork Wt TimeSYS$USERS224225359852633210513011019060433742glodist1488152965773920032828SYS$BACKGROUND247185750453350000 Back to Wait Events Statistics Back to Top SQL Statistics SQL ordered by Elapsed Time SQL ordered by CPU Time SQL ordered by Gets SQL ordered by Reads SQL ordered by Executions SQL ordered by Parse Calls SQL ordered by Sharable Memory SQL ordered by Version Count Complete List of SQL Text Back to Top SQL ordered by Elapsed TimeResources reported for PL/SQL code includes the resources used by all SQL statements called by the code. % Total DB Time is the Elapsed Time of the SQL statement divided into the Total Database Time multiplied by 100 Elapsed Time (s)CPU Time (s)Executions Elap per Exec (s) % Total DB TimeSQL IdSQL ModuleSQL Text8,4322318432.2426.55czbcbbrs9m00boracle@lilo (TNS V1-V3) SELECT "A1"."PART_NUMBER", "A1...4,3374922168.4913.658bu6baap1snwyoracle@lilo (TNS V1-V3) SELECT "A1"."PART_NUMBER", "A1...3,2252,9133,2550.9910.15376u7a6frhp20JDBC Thin Client select * from dba_audit_trail ...3,1201913119.849.82868n3yds47cg4oracle@lilo (TNS V1-V3) SELECT "A1"."PART_NUMBER", "A1...1,2517342062.553.943qfdsumvk7yt5SQL*Plus DECLARE v_msg VARCHAR2(200); ...5801801579.811.8304384fcb6137joracle@lilo (TNS V1-V3) SELECT "A1"."GD_CUST_ID", "A1"...5693212028.461.794yc06ra33csvzSQL*Plus DECLARE v_print1 varchar2(2000...5613181929.521.77fhgft51ugknqdSQL*Plus SELECT DISTINCT C.GD_CUST_ID, ...5092171926.811.607g3wv47q7aa40SQL*Plus SELECT * FROM XXSUB_QUOTE X WH...5011231050.151.584mx0ubtp5b8dsSQL*Plus DECLARE /* $Id: gd_insert_mis...5011231050.121.582y41msd1654mrSQL*Plus SELECT DISTINCT POS_PART_NO , ...478193548.861.516gcd7yy7jjw0uSQL*Plus DECLARE v_print1 varchar2(2000...4463241453.071.405md9mz2rrs0jcSQL*Plus SELECT COUNT(*) FROM GD_MKTG_Q...4301771043.041.367tr0031mjpkscSQL*Plus begin publish_to_pos(FALSE); e...4291761042.891.35gdvvuza0axnhbSQL*Plus UPDATE GD_EDI_POS_ITEMS SET TP...4171711416.521.313r45tkag2xj15SQL*Plus DECLARE v_msg VARCHAR2(200); ...396253579.261.2520hjqfdkcm6umSQL*Plus SELECT DISTINCT c.disti...375280575.061.18dnzbcmgb9h0phSQL*Plus SELECT DISTINCT c.disti...3362012001.681.06928mhrahfhkpdJDBC Connect Client SELECT a.processed_records, b... Back to SQL Statistics Back to Top SQL ordered by CPU TimeResources reported for PL/SQL code includes the resources used by all SQL statements called by the code. % Total DB Time is the Elapsed Time of the SQL statement divided into the Total Database Time multiplied by 100 CPU Time (s)Elapsed Time (s)Executions CPU per Exec (s)% Total DB TimeSQL IdSQL ModuleSQL Text2,9133,2253,2550.8910.15376u7a6frhp20JDBC Thin Client select * from dba_audit_trail ...7341,2512036.683.943qfdsumvk7yt5SQL*Plus DECLARE v_msg VARCHAR2(200); ...3244461452.231.405md9mz2rrs0jcSQL*Plus SELECT COUNT(*) FROM GD_MKTG_Q...3215692016.041.794yc06ra33csvzSQL*Plus DECLARE v_print1 varchar2(2000...3185611916.751.77fhgft51ugknqdSQL*Plus SELECT DISTINCT C.GD_CUST_ID, ...280375555.971.18dnzbcmgb9h0phSQL*Plus SELECT DISTINCT c.disti...253396550.571.2520hjqfdkcm6umSQL*Plus SELECT DISTINCT c.disti...2175091911.451.607g3wv47q7aa40SQL*Plus SELECT * FROM XXSUB_QUOTE X WH...2013362001.011.06928mhrahfhkpdJDBC Connect Client SELECT a.processed_records, b...193478543.571.516gcd7yy7jjw0uSQL*Plus DECLARE v_print1 varchar2(2000...1805801179.771.8304384fcb6137joracle@lilo (TNS V1-V3) SELECT "A1"."GD_CUST_ID", "A1"...1774301017.671.367tr0031mjpkscSQL*Plus begin publish_to_pos(FALSE); e...1764291017.611.35gdvvuza0axnhbSQL*Plus UPDATE GD_EDI_POS_ITEMS SET TP...1714171171.301.313r45tkag2xj15SQL*Plus DECLARE v_msg VARCHAR2(200); ...1235011012.351.584mx0ubtp5b8dsSQL*Plus DECLARE /* $Id: gd_insert_mis...1235011012.341.582y41msd1654mrSQL*Plus SELECT DISTINCT POS_PART_NO , ...494,337224.3813.658bu6baap1snwyoracle@lilo (TNS V1-V3) SELECT "A1"."PART_NUMBER", "A1...238,432122.7726.55czbcbbrs9m00boracle@lilo (TNS V1-V3) SELECT "A1"."PART_NUMBER", "A1...193,120119.319.82868n3yds47cg4oracle@lilo (TNS V1-V3) SELECT "A1"."PART_NUMBER", "A1... Back to SQL Statistics Back to Top SQL ordered by GetsResources reported for PL/SQL code includes the resources used by all SQL statements called by the code. Total Buffer Gets: 127,310,179 Captured SQL account for 93.8% of Total Buffer Gets Executions Gets per Exec %TotalCPU Time (s)Elapsed Time (s)SQL IdSQL ModuleSQL Text36,436,5013,25511,194.0128.622912.733224.54376u7a6frhp20JDBC Thin Client select * from dba_audit_trail ...19,054,32420952,716.2014.97320.81569.144yc06ra33csvzSQL*Plus DECLARE v_print1 varchar2(2000...19,042,900191,002,257.8914.96318.33560.92fhgft51ugknqdSQL*Plus SELECT DISTINCT C.GD_CUST_ID, ...6,397,99910639,799.905.03123.46501.464mx0ubtp5b8dsSQL*Plus DECLARE /* $Id: gd_insert_mis...6,397,83910639,783.905.03123.42501.212y41msd1654mrSQL*Plus SELECT DISTINCT POS_PART_NO , ...4,920,29520246,014.753.86733.691251.063qfdsumvk7yt5SQL*Plus DECLARE v_msg VARCHAR2(200); ...3,380,91313,380,913.002.66179.77579.8104384fcb6137joracle@lilo (TNS V1-V3) SELECT "A1"."GD_CUST_ID", "A1"...3,340,8087,207463.552.6245.8451.02bmj5us86kyf8aJDBC Connect Client SELECT * FROM XXPUB_FULFILLM...2,443,24512,443,245.001.92171.30416.523r45tkag2xj15SQL*Plus DECLARE v_msg VARCHAR2(200); ...2,391,92314516,496.021.88324.06445.565md9mz2rrs0jcSQL*Plus SELECT COUNT(*) FROM GD_MKTG_Q...2,177,06120010,885.311.71201.22335.96928mhrahfhkpdJDBC Connect Client SELECT a.processed_records, b...2,125,9335439,369.131.67192.78478.356gcd7yy7jjw0uSQL*Plus DECLARE v_print1 varchar2(2000...1,863,0287,193259.011.4630.1432.511y2pqs88ub6uhJDBC Connect Client SELECT * FROM XXPUB_CUST_LOC...1,379,970184,7447.471.08100.75131.07g294qgxf8jqhbJDBC Connect Client INSERT INTO XXSUB_ITEM_ATTR ( ...1,288,72410128,872.401.01176.72430.387tr0031mjpkscSQL*Plus begin publish_to_pos(FALSE); e...1,284,09110128,409.101.01176.14428.92gdvvuza0axnhbSQL*Plus UPDATE GD_EDI_POS_ITEMS SET TP...1,284,05010128,405.001.01132.85182.08fjxusy4bv8b85SQL*Plus select DISTINCT TPOS_FILENAME ... Back to SQL Statistics Back to Top SQL ordered by ReadsTotal Disk Reads: 79,905,605 Captured SQL account for 96.5% of Total Physical ReadsExecutionsReads per Exec %TotalCPU Time (s)Elapsed Time (s)SQL IdSQL ModuleSQL Text35,921,6213,25511,035.8344.962912.733224.54376u7a6frhp20JDBC Thin Client select * from dba_audit_trail ...4,827,07820241,353.906.04733.691251.063qfdsumvk7yt5SQL*Plus DECLARE v_msg VARCHAR2(200); ...2,376,10214516,386.912.97324.06445.565md9mz2rrs0jcSQL*Plus SELECT COUNT(*) FROM GD_MKTG_Q...2,163,22120010,816.112.71201.22335.96928mhrahfhkpdJDBC Connect Client SELECT a.processed_records, b...1,283,93410128,393.401.61176.72430.387tr0031mjpkscSQL*Plus begin publish_to_pos(FALSE); e...1,283,80310128,380.301.61176.14428.92gdvvuza0axnhbSQL*Plus UPDATE GD_EDI_POS_ITEMS SET TP...1,277,30010127,730.001.60132.85182.08fjxusy4bv8b85SQL*Plus select DISTINCT TPOS_FILENAME ...1,209,9517416,350.691.51174.14219.9662wkpdthx9k57SQL*Plus UPDATE GD_MKTG_QUOTE_HEADERS S...1,168,1801961,483.161.46217.49509.357g3wv47q7aa40SQL*Plus SELECT * FROM XXSUB_QUOTE X WH...1,140,7409126,748.891.43106.88147.071fuwtfb2z47ahSQL*Plus select DISTINCT TPOS_FILENAME ...1,113,68211,113,682.001.39162.38256.743bduct0mt1hhcoracle@lilo (TNS V1-V3) SELECT "PART_NUMBER", "PRODUCT...1,113,68111,113,681.001.39132.14199.314djmu315d0jvnoracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,113,68111,113,681.001.39126.71175.435cfvfw9wpx8t5oracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,113,68111,113,681.001.39125.32157.565ygxta8q6thgnoracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,113,68111,113,681.001.39122.67147.896qpsh27z33zy5oracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,113,68111,113,681.001.39125.23148.95cpwrux6mwsfy6oracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,113,68111,113,681.001.39123.06141.47cvzb1cvmdpp34oracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,113,68111,113,681.001.39121.55131.70fchznr7bs81dqoracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,113,68111,113,681.001.39126.05155.03fy7595g0tp46voracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,113,68011,113,680.001.39128.03181.6460pzpx9jt35qnoracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,113,61511,113,615.001.39122.57126.702hp96qz5uuwp6oracle@lilo (TNS V1-V3) SELECT "PART_NUMBER", "PRODUCT...1,113,51211,113,512.001.39125.72134.8079vkpt3hzg03woracle@lilo (TNS V1-V3) SELECT "PART_NUMBER", "PRODUCT...1,112,19111,112,191.001.39119.38136.125ptzsdnruqrhworacle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,112,17611,112,176.001.39123.08140.11dwt9jadadx51aoracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,112,12011,112,120.001.39122.56142.2572bpcq74qrwatoracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,112,00611,112,006.001.39129.90206.14dngx7pmc9ka72oracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,111,99211,111,992.001.39127.89170.991gkzk315sq90xoracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,111,99211,111,992.001.39125.71167.323rbh076r95nuvoracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,106,80911,106,809.001.39124.36178.346jgfda6a3r7w0oracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...1,055,50511,055,505.001.32112.95128.670pj1cq7zq8x6joracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...909,1771909,177.001.14171.30416.523r45tkag2xj15SQL*Plus DECLARE v_msg VARCHAR2(200); ...860,9730 1.0899.31172.88bnzuc1x96jbkdoracle@lilo (TNS V1-V3) SELECT /*+ NOREWRITE */ DECODE...804,9425160,988.401.01252.84396.3220hjqfdkcm6umSQL*Plus SELECT DISTINCT c.disti... Back to SQL Statistics Back to Top SQL ordered by ExecutionsTotal Executions: 885,036 Captured SQL account for 60.8% of Total Executions Rows ProcessedRows per ExecCPU per Exec (s)Elap per Exec (s) SQL IdSQL ModuleSQL Text184,744184,7441.000.000.00g294qgxf8jqhbJDBC Connect Client INSERT INTO XXSUB_ITEM_ATTR ( ...121,090121,0901.000.000.000nrch9d09zjfbJDBC Connect Client INSERT INTO XXSUB_ITEM_XREF_AT...65,54765,5471.000.000.00gfq05puhdqs8vJDBC Connect Client INSERT INTO XXSUB_BOM_COMP_REF...35,04935,0491.000.000.00bmuqkwgyxq95mJDBC Connect Client INSERT INTO XXSUB_BOM_COMP_REF...12,59512,5951.000.000.0083v08gtfj7q88JDBC Connect Client INSERT INTO XXSUB_ITEM_XREF ( ...11,633461,75939.690.010.02749tad6uzbksvSQL*Plus DELETE FROM XXSUB_ITEM_XREF_AT...11,633539,71846.400.010.01artwjs76kssvySQL*Plus DELETE FROM XXSUB_ITEM_ATTR WH...9,6309,6301.000.000.00b41awu29rqx6sJDBC Connect Client INSERT INTO XXSUB_BOM_COMP_ATT...7,2071,2580.170.010.01bmj5us86kyf8aJDBC Connect Client SELECT * FROM XXPUB_FULFILLM...7,193230.000.000.001y2pqs88ub6uhJDBC Connect Client SELECT * FROM XXPUB_CUST_LOC... Back to SQL Statistics Back to Top SQL ordered by Parse CallsTotal Parse Calls: 101,545 Captured SQL account for 73.5% of Total Parse CallsExecutions % Total ParsesSQL IdSQL ModuleSQL Text7,2077,2077.10bmj5us86kyf8aJDBC Connect Client SELECT * FROM XXPUB_FULFILLM...7,1937,1937.081y2pqs88ub6uhJDBC Connect Client SELECT * FROM XXPUB_CUST_LOC...7,1877,1877.0858wzdu30azxcrJDBC Connect Client SELECT * FROM XXPUB_GENERIC ...7,1867,1867.085cku00pvuksrkJDBC Connect Client SELECT * FROM XXPUB_DACLAIM ...5,2035,2035.124m7m0t6fjcs5x update seq$ set increment$=:2,...4,0274,0273.970h6b2sajwb74n select privilege#, level from ...3,0853,0853.04gd38axjtgv5uqJDBC Connect Client select XXSUB_ITEM_SEQ.nextval ...2,9412,9412.9081ky0n97v4zsgemagent_SQL_oracle_database /* OracleOEM */ select s.sid, ...1,8521,8521.82350f5yrnnmshs lock table sys.mon_mods$ in ex...1,8521,8521.82g00cj285jmgsw update sys.mon_mods$ set inser...1,5431,5431.520gy268rg3cxj3JDBC Connect Client select XXSUB_BOM_SEQ.nextval f...1,3821,3821.364cbf4gc30cwn7JDBC Thin Client SELECT SERVER_NAME FROM SYS.XX...1,3821,3821.3666snhg0v0c18dJDBC Thin Client SELECT USERNAME, OSUSER, MAC...1,3821,3821.368suz9a9ykkwwqJDBC Thin Client DECLARE tserver VARCHAR...1,3681,3681.35459f3z9u4fb3u select value$ from props$ wher...1,3601,3601.349wapxfsbzds5hJDBC Thin Client INSERT INTO SYS.XXSOX_INVALIDC...1,3521,3521.330k8522rmdzg4k select privilege# from sysauth...1,3521,3611.3315zytu14qzw6pJDBC Thin Client insert into sys.aud$( sessioni...1,3511,3511.330ws7ahf1d78qa select SYS_CONTEXT('USERENV', ...1,3461,3461.331rd8um1taq1fn update sys.aud$ set action#=:2...1,3211,3211.305ur69atw3vfhj select decode(failover_method,...1,1101,1101.095aa4qy7098w5k SELECT seq, message#, fac, hdr... Back to SQL Statistics Back to Top SQL ordered by Sharable MemoryNo data exists for this section of the report. Back to SQL Statistics Back to TopSQL ordered by Version CountNo data exists for this section of the report. Back to SQL Statistics Back to TopComplete List of SQL TextSQL IdSQL Text04384fcb6137jSELECT "A1"."GD_CUST_ID", "A1"."HUB_PARTY_ID", "A1"."PARTY_NAME", "A1"."CITY", "A1"."XLNX_HUB_GU_PARTY_ID", "A1"."XLNX_HUB_XU_PARTY_ID", "A1"."CREATION_DATE", "A1"."COUNTRY", "A1"."CREATED_BY" FROM "GD"."GD_CUSTOMERS_3MONTHS_DLVIEW" "A1"0gy268rg3cxj3select XXSUB_BOM_SEQ.nextval from dual0h6b2sajwb74nselect privilege#, level from sysauth$ connect by grantee#=prior privilege# and privilege#0 start with grantee#=:1 and privilege#00k8522rmdzg4kselect privilege# from sysauth$ where (grantee#=:1 or grantee#=1) and privilege#00nrch9d09zjfbINSERT INTO XXSUB_ITEM_XREF_ATTR ( SEQUENCE_NO, XREF_RELATIONSHIP_NAME, XREF_ITEM_TYPE, XREF_ITEM_NAME, XREF_ITEM_REVISION, ATTR_TYPE, ATTR_NAME, ATTR_VALUE) VALUES (:v0, :v1, :v2, :v3, :v4, :v5, :v6, :v7)0pj1cq7zq8x6jSELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'HEWLETT%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR ("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1 "."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')0ws7ahf1d78qaselect SYS_CONTEXT('USERENV', 'SERVER_HOST'), SYS_CONTEXT('USERENV', 'DB_UNIQUE_NAME'), SYS_CONTEXT('USERENV', 'INSTANCE_NAME'), SYS_CONTEXT('USERENV', 'SERVICE_NAME'), INSTANCE_NUMBER, STARTUP_TIME, SYS_CONTEXT('USERENV', 'DB_DOMAIN') from v$instance where INSTANCE_NAME=SYS_CONTEXT('USERENV', 'INSTANCE_NAME')15zytu14qzw6pinsert into sys.aud$( sessionid, entryid, statement, ntimestamp#, userid, userhost, terminal, action#, returncode, obj$creator, obj$name, auth$privileges, auth$grantee, new$owner, new$name, ses$actions, ses$tid, logoff$pread, logoff$lwrite, logoff$dead, comment$text, spare1, spare2, priv$used, clientid, sessioncpu, proxy$sid, user$guid, instance#, process#, xid, scn, auditid, sqlbind, sqltext) values(:1, :2, :3, SYS_EXTRACT_UTC(SYSTIMESTAMP), :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20, :21, :22, :23, :24, :25, :26, :27, :28, :29, :30, :31, :32, :33, :34)1fuwtfb2z47ahselect DISTINCT TPOS_FILENAME from gd_edi_pos_items where tpos_process_ind='N' and tpos_territory in ('EUROPE', 'JAPAN', 'SE ASIA')1gkzk315sq90xSELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'LSI CORP%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBST R("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A 1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')1rd8um1taq1fnupdate sys.aud$ set action#=:2, returncode=:3, logoff$time=cast(systimestamp as date), logoff$pread=:4, logoff$lread=:5, logoff$lwrite=:6, logoff$dead=:7, sessioncpu=:8 where sessionid=:1 and entryid=1 and action#=1001y2pqs88ub6uhSELECT * FROM XXPUB_CUST_LOC WHERE WHEN_PROCESSED = '01-jan-1970' order by SEQNO20hjqfdkcm6umSELECT DISTINCT c.disti_edi_849_filename || '!' || a.dar_session_no FROM gd_edi_844_rejects a, gd_edi_844_msgs b, gd_distributors c WHERE a.dar_header_fk = b.header_fk AND a.dar_contract_fk = b.contract_fk AND a.dar_pad_pk = b.pad_pk AND a.dar_session_no = b.session_no AND a.dar_process_ind != 'Y' AND b.created_by = 'EDI-DA-844' AND DECODE(RTRIM(TO_CHAR(TO_DATE(a.created_date), 'DAY')), 'THURSDAY', TRUNC(a.created_date+4), 'FRIDAY', TRUNC(a.created_date+4), 'SATURDAY', TRUNC(a.created_date+3), TRUNC(a.created_date + 2)) = TRUNC(SYSDATE+4) AND b.disti_name = c.disti_name AND c.disti_name = 'AVNET LOGISTICS, US L.P.' AND not exists ( Select 1-- Added not to process more than one file CAR#6286 from gd_edi_845_header where trunc(log_date) = trunc(sysdate) - 7 -- this condition will improve performance not to check old data and trunc(LOG_DATE) = trunc(a.created_date) )2hp96qz5uuwp6SELECT "PART_NUMBER", "PRODUCT_LINE", "ACCOUNT", "REVENUE_AMOUNT", "PERIOD_NAME", "REVENUE_TYPE", "PART_FAMILY", "COMPANY", "ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "O100663" WHERE "ACCOUNT"='4400' AND "REVENUE_TYPE" NOT LIKE 'INT%' AND UPPER("PERIOD_NAME")='NOV-14' AND "PART_NUMBER" LIKE '%-SERV'2y41msd1654mrSELECT DISTINCT POS_PART_NO , POS_TXN_DATE , 'SC' CST_TYPE , DECODE(C.PART_NO, NULL, 'Missing entry in cost_part_validation table for this part', 'Missing SC/OH cost for this part') DESCR FROM COST_PART_VALIDATION C , GD_POS_ITEMS L WHERE POS_PERIOD_NAME = (SELECT VAL_VALUE FROM GD_VALIDATIONS WHERE VAL_TYPE='CURRENT_ACTG_PERIOD' ) AND POS_PRODUCTION_FLAG = 'Y' AND NOT EXISTS (SELECT 1 FROM GD_PART_COSTS WHERE CST_PART_NO = L.POS_PART_NO AND L.POS_TXN_DATE BETWEEN CST_EFF_DATE AND NVL(CST_EXP_DATE, L.POS_TXN_DATE) AND CST_TYPE = 'SC' ) AND C.PART_NO(+) = SUBSTR(L.POS_PART_NO, 1, 3) UNION SELECT DISTINCT POS_PART_NO , POS_TXN_DATE , 'OH' CST_TYPE , DECODE(C.PART_NO, NULL, 'Missing entry in cost_part_validation table for this part', 'Missing SC/OH cost for this part') DESCR FROM COST_PART_VALIDATION C , GD_POS_ITEMS L WHERE POS_PERIOD_NAME = (SELECT VAL_VALUE FROM GD_VALIDATIONS WHERE VAL_TYPE='CURRENT_ACTG_PERIOD' ) AND POS_PRODUCTION_FLAG = 'Y' AND NOT EXISTS (SELECT 1 FROM GD_PART_COSTS WHERE CST_PART_NO = L.POS_PART_NO AND L.POS_TXN_DATE BETWEEN CST_EFF_DATE AND NVL(CST_EXP_DATE, L.POS_TXN_DATE) AND CST_TYPE = 'OH' ) AND C.PART_NO(+) = SUBSTR(L.POS_PART_NO, 1, 3) UNION SELECT D.POS_PARTNUMBER_ID , DECODE(SUBSTR(H.POS_FILENAME, 1, 2), 'ha', D.POS_SHIPPED , 'nh', D.POS_SHIPPED , 'na', D.POS_SHIPPED , SYSDATE ) POS_TXN_DATE , 'SC' CST_TYPE , DECODE(C.PART_NO, NULL, 'Missing entry in cost_part_validation table for this part', 'Missing SC/OH cost for this part') DESC R FROM COST_PART_VALIDATION C , XXSUB_POS_DETAIL D , XXSUB_POS_HEADER H , XXSUB_POS M WHERE TRUNC(WHEN_PROCESSED) = '01-JAN-1970' AND M.SEQUENCE_NO = H.SEQUENCE_NO AND H.SEQUENCE_NO = D.SEQUENCE_NO AND H.POS_HEADER_ID = D.POS_HEADER_ID AND NOT EXISTS (SELECT 1 FROM GD_PART_COSTS WHERE CST_PART_NO = D.POS_PARTNUMBER_ID AND DECODE(SUBSTR(H.POS_FILENAME, 1, 2), 'ha', D.POS_SHIPPED , 'nh', D.POS_SHIPPED , 'na', D.POS_SHIPPED , SYSDATE ) BETWEEN CST_EFF_DATE AND NVL(CST_EXP_DATE, DECODE(SUBSTR(H.POS_FILENAME, 1, 2), 'ha', D.POS_SHIPPED , 'nh', D.POS_SHIPPED , 'na', D.POS_SHIPPED , SYSDATE ) ) AND CST_TYPE = 'SC' ) AND C.PART_NO(+) = SUBSTR(D.POS_PARTNUMBER_ID, 1, 3) UNION SELECT D.POS_PARTNUMBER_ID , DECODE(SUBSTR(H.POS_FILENAME, 1, 2), 'ha', D.POS_SHIPPED , 'nh', D.POS_SHIPPED , 'na', D.POS_SHIPPED , SYSDATE ) POS_TXN_DATE , 'OH' CST_TYPE , DECODE(C.PART_NO, NULL, 'Missing entry in cost_part_validation table for this part', 'Missing SC/OH cost for this part') DESCR FROM COST_PART_VALIDATION C , XXSUB_POS_DETAIL D , XXSUB_POS_HEADER H , XXSUB_POS M WHERE TRUNC(WHEN_PROCESSED) = '01-JAN-1970' AND M.SEQUENCE_NO = H.SEQUENCE_NO AND H.SEQUENCE_NO = D.SEQUENCE_NO AND H.POS_HEADER_ID = D.POS_HEADER_ID AND NOT EXISTS (SELECT 1 FROM GD_PART_COSTS WHERE CST_PART_NO = D.POS_PARTNUMBER_ID AND DECODE(SUBSTR(H.POS_FILENAME, 1, 2), 'ha', D.POS_SHIPPED , 'nh', D.POS_SHIPPED , 'na', D.POS_SHIPPED , SYSDATE ) BETWEEN CST_EFF_DATE AND NVL(CST_EXP_DATE, DECODE(SUBSTR(H.POS_FILENAME, 1, 2), 'ha', D.POS_SHIPPED , 'nh', D.POS_SHIPPED , 'na', D.POS_SHIPPED , SYSDATE ) ) AND CST_TYPE = 'OH' ) AND C.PART_NO(+) = SUBSTR(D.POS_PARTNUMBER_ID, 1, 3) 350f5yrnnmshslock table sys.mon_mods$ in exclusive mode nowait376u7a6frhp20select * from dba_audit_trail where extended_timestamp :1 order by extended_timestamp3bduct0mt1hhcSELECT "PART_NUMBER", "PRODUCT_LINE", "ACCOUNT", "REVENUE_AMOUNT", "PERIOD_NAME", "REVENUE_TYPE", "PART_FAMILY", "COMPANY", "ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "O100663" WHERE "ACCOUNT"='4400' AND "REVENUE_TYPE" NOT LIKE 'INT%' AND (UPPER("PERIOD_NAME")='JAN-14' OR UPPER("PERIOD_NAME")='FEB-14') AND "PART_NUMBER" LIKE '%-SERV'3qfdsumvk7yt5DECLARE v_msg VARCHAR2(200); BEGIN gd_sub_quote_dda_from_compass; EXCEPTION WHEN OTHERS THEN v_msg := SUBSTR(SQLERRM, 1, 200); INSERT INTO gd_tib_errors VALUES ('GD_TIB_DDA_MSGS', 'S', sysdate, 'Error in calling GD_SUB_QUOTE_DDA_FROM_COMPASS procedure '||v_msg, null); END;3r45tkag2xj15DECLARE v_msg VARCHAR2(200); BEGIN gd_tib_pos_publish(NULL); EXCEPTION WHEN OTHERS THEN v_msg := SUBSTR(SQLERRM, 1, 200); INSERT INTO gd_tib_errors VALUES ('GD_TIB_POS_MSGS', 'S', sysdate, 'Error in calling GD_POS_PUBLISH procedure '||v_msg, null); END;3rbh076r95nuvSELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'DOT HILL%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBST R("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A 1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')459f3z9u4fb3uselect value$ from props$ where name = 'GLOBAL_DB_NAME'4cbf4gc30cwn7SELECT SERVER_NAME FROM SYS.XXSOX_VALIDSERVERS WHERE UPPER(SERVER_NAME) = UPPER(:B1 )4djmu315d0jvnSELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'ORACLE%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR( "A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1" ."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')4m7m0t6fjcs5xupdate seq$ set increment$=:2, minvalue=:3, maxvalue=:4, cycle#=:5, order$=:6, cache=:7, highwater=:8, audit$=:9, flags=:10 where obj#=:14mx0ubtp5b8dsDECLARE /* $Id: gd_insert_missing_sc_oh_cost.sql, v 1.1 2010/03/23 08:55:28 saravan Exp $ */ -- ===================================================================== -- FILE NAME : GD_Insert_Missing_SC_OH_Cost.sql -- AUTHOR : Rajesh Solanki -- DATE CREATED : 30/09/2009 -- APPLICATION : Global Disti (GD) -- VERSION : 1.0 -- -- DESCRIPTION : Function to Insert missing SC/OH cost for software parts -- that are published through POS sesseion -- -- ===================================================================== -- MODIFICATION HISTORY -- ===================================================================== -- DATE VERSION LOGIN CHANGE DESCRIPTION -- --------------------------------------------------------------------- -- 30/09/2009 1.0 rajeshs Created -- ===================================================================== -- -- Declaration Section -- lv_sqlerrm VARCHAR2(500); lv_qtr_start DATE; lv_qtr_end DATE; -- -- Declaring Local Cursor's -- -- -- Cursor to reterive parts/transaction dqate and cost type for parts that has missing SC/OH cost -- Both from gd_pos_items and xxsub_pos tables -- CURSOR c1 IS SELECT DISTINCT pos_part_no , pos_txn_date , 'SC' cst_type , DECODE(c.part_no, NULL, 'Missing entry in cost_part_validation table for this part', 'Missing SC/OH cost for this part' ) Descr FROM cost_part_validation c , gd_pos_items l WHERE pos_period_name = (SELECT val_value FROM gd_validations WHERE val_type='CURRENT_ACTG_PERIOD' ) AND pos_production_flag = 'Y' AND NOT EXISTS (SELECT 1 FROM gd_part_costs WHERE cst_part_no = l.pos_part_no AND l.pos_txn_date BETWEEN cst_eff_date AND NVL(cst_exp_date, l.pos_txn_date) AND cst_type = 'SC' ) AND c.part_no(+) = SUBSTR(l.pos_part_no, 1, 3) UNION SELECT DISTINCT pos_part_no , pos_txn_date , 'OH' cst_type , DECODE(c.part_no, NULL, 'Missing entry in cost_part_validation table for this part', 'Missing SC/OH cost for this part') Descr FROM cost_part_validation c , gd_pos_items l WHERE pos_period_name = (SELECT val_value FROM gd_validations WHERE val_type='CURRENT_ACTG_PERIOD' ) AND pos_production_flag = 'Y' AND NOT EXISTS (SELECT 1 FROM gd_part_costs WHERE cst_par t_no = l.pos_part_no AND l.pos_txn_date BETWEEN cst_eff_date AND NVL(cst_exp_date, l.pos_txn_date) AND cst_type = 'OH' ) AND c.part_no(+) = SUBSTR(l.pos_part_no, 1, 3) UNION SELECT d.pos_partnumber_id , DECODE(SUBSTR(h.pos_filename, 1, 2), 'ha', d.pos_shipped , 'nh', d.pos_shipped , 'na', d.pos_shipped , SYSDATE ) pos_txn_date , 'SC' cst_type , DECODE(c.part_no, NULL, 'Missing entry in cost_part_validation table for this part', 'Missing SC/OH cost for this part') Descr FROM cost_part_validation c , xxsub_pos_detail d , xxsub_pos_header h , xxsub_pos m WHERE TRUNC(when_processed) = '01-JAN-1970' AND m.sequence_no = h.sequence_no AND h.sequence_no = d.sequence_no AND h.pos_header_id = d.pos_header_id AND NOT EXISTS (SELECT 1 FROM gd_part_costs WHERE cst_part_no = d.pos_partnumber_id AND DECODE(SUBSTR(h.pos_filename, 1, 2), 'ha', d.pos_shipped , 'nh', d.po s_shipped , 'na', d.pos_shipped , SYSDATE ) BETWEEN cst_eff_date AND NVL(cst_exp_date, DECODE(SUBSTR(h.pos_filename, 1, 2), 'ha', d.pos_shipped , 'nh', d.pos_shipped , 'na', d.pos_shipped , SYSDATE ) ) AND cst_type = 'SC' ) AND c.part_no(+) = SUBSTR(d.pos_partnumber_id, 1, 3) UNION SELECT d.pos_partnumber_id , DECODE(SUBSTR(h.pos_filename, 1, 2), 'ha', d.pos_shipped , 'nh', d.pos_shipped , 'na', d.pos_shipped , SYSDATE ) pos_txn_date , 'OH' cst_type , DECODE(c.part_no, NULL, 'Missing entry in cost_part_validation table for this part', 'Missing SC/OH cost for this part') Descr FROM cost_part_validation c , xxsub_pos_detail d , xxsub_pos_header h , xxsub_pos m WHERE TRUNC(when_processed) = '01-JAN-1970' AND m.sequence_no = h.sequence_no AND h.sequence_no = d.sequence_no AND h.pos_header_id = d.pos_header_id AND NOT EXISTS (SELECT 1 FROM gd_part_costs WHERE cst_part_no = d.pos_partnumber_id AND DECODE(SUBSTR(h.pos_filename, 1, 2), 'ha', d.pos_shipped , 'nh', d.pos_shipped , 'na', d.pos_shipped , SYSDATE ) BETWEEN cst_eff_date AND NVL(cst_exp_date, DECODE(SUBSTR(h.pos_filename, 1, 2), 'ha', d.pos_shipped , 'nh', d.pos_shipped , 'na', d.pos_shipped , SYSDATE ) ) AND cst_type = 'OH' ) AND c.part_no(+) = SUBSTR(d.pos_partnumber_id, 1, 3) ; -- -- Main Section -- BEGIN BEGIN DELETE FROM temp_missing_cost_table; COMMIT; EXCEPTION WHEN OTHERS THEN lv_sqlerrm := SQLERRM; ROLLBACK; RAISE_APPLICATION_ERROR('-20000', 'Err Deleting Data from temp_missing_cost_table (Contact IT/Support): '||lv_sqlerrm); END; -- -- Fetching all parts that has missing SC/OH cost and inserting them into a temporary table -- FOR c in c1 LOOP BEGIN INSERT INTO temp_missing_cost_table VALUES (c.pos_part_no , c.pos_txn_date , c.cst_type , c.descr ); EXCEPTION WHEN OTHERS THEN lv_sqlerrm := SQLERRM; ROLLBACK; RAISE_APPLICATION_ERROR('-20001', 'Err Inserting Missing SC/OH Cost in temp table (Contact IT/Support): '||lv_sqlerrm); END; END LOOP; COMMIT; dbms_output.put_line('02'); EXCEPTION WHEN OTHERS THEN lv_sqlerrm := SQLERRM; RAISE_APPLICATION_ERROR('-20008', 'Please Contact IT/Support For Error: '||lv_sqlerrm); END;4yc06ra33csvzDECLARE v_print1 varchar2(2000); v_last_published_date DATE; i number; v_first_row number; BEGIN xxcm_cust_loc_pub; v_first_row := 0; FOR rec in (SELECT SEQUENCE_NO, ERROR_MESSAGE from xxcm_cust_pub_error WHERE EMAIL_FLAG = 'N') LOOP -- v_print1 := 'ERR SEQ NO:' || TO_CHAR(rec.SEQUENCE_NO) ||' ERR MSG:'|| rec.ERROR_MESSAGE; if v_first_row = 0 then dbms_output.put_line(' GD CUST ID ' || RPAD(' CUSTOMER NAME', 50)|| RPAD(' DISTI NAME', 33) || RPAD(' POS TX#', 10) || RPAD(' ASP TX#', 10) ); v_first_row := 1; end if; v_print1 := rec.ERROR_MESSAGE; FOR i IN 0..LENGTH(v_print1)/250 LOOP DBMS_OUTPUT.PUT_LINE(SUBSTR(v_print1, i*250+1, 250) ); END LOOP; --update when_processed to sysdate UPDATE xxcm_cust_pub_error SET EMAIL_FLAG = 'Y' WHERE SEQUENCE_NO = rec.SEQUENCE_NO ; COMMIT; END LOOP; EXCEPTION WHEN OTHERS THEN ROLLBACK; RAISE; END; 58wzdu30azxcrSELECT * FROM XXPUB_GENERIC WHERE WHEN_PROCESSED = '01-jan-1970' order by SEQUENCE_NO5aa4qy7098w5kSELECT seq, message#, fac, hdr, lm, nl, p1, p2, p3, p4, p5, count(*) over () from sys.wri$_adv_message_groups WHERE id = :1 ORDER BY seq5cfvfw9wpx8t5SELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'GIGAMON%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR ("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1 "."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')5cku00pvuksrkSELECT * FROM XXPUB_DACLAIM WHERE WHEN_PROCESSED = '01-jan-1970' order by SEQUENCE_NO5md9mz2rrs0jcSELECT COUNT(*) FROM GD_MKTG_QUOTE_HEADERS WHERE NVL(MQH_QUOTE_NO, '!') = NVL(:B4 , '!') AND NVL(MQH_FSO_CODE, '!') = NVL(:B3 , '!') AND NVL(MQH_DISTI_NAME, '!') = NVL(:B2 , '!') AND NVL(MQH_CUST_NAME, '!') = NVL(:B1 , '!') 5ptzsdnruqrhwSELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'SIMPLY%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR( "A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1" ."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')5ur69atw3vfhjselect decode(failover_method, NULL, 0 , 'BASIC', 1, 'PRECONNECT', 2 , 'PREPARSE', 4 , 0), decode(failover_type, NULL, 1 , 'NONE', 1 , 'SESSION', 2, 'SELECT', 4, 1), failover_retries, failover_delay, flags from service$ where name = :15ygxta8q6thgnSELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'FIBERHOME%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBS TR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR(" A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')60pzpx9jt35qnSELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'PALO ALTO%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBS TR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR(" A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')62wkpdthx9k57UPDATE GD_MKTG_QUOTE_HEADERS SET MQH_COMMENTS = '' , MQH_STATUS = 'A' , MQH_QUOTE_ENTRY_DATE = SYSDATE , MODIFIED_DATE = SYSDATE WHERE NVL(MQH_QUOTE_NO, '!') = NVL(:B4 , '!') AND NVL(MQH_FSO_CODE, '!') = NVL(:B3 , '!') AND NVL(MQH_DISTI_NAME, '!') = NVL(:B2 , '!') AND NVL(MQH_CUST_NAME, '!') = NVL(:B1 , '!') 66snhg0v0c18dSELECT USERNAME, OSUSER, MACHINE, PROGRAM, MODULE FROM V$SESSION WHERE USERENV('sessionid') = AUDSID AND ROWNUM = 16gcd7yy7jjw0uDECLARE v_print1 varchar2(2000); BEGIN -- Call to the procedure which will filter the data from xxsub_item XXMSG_ITEM_TYPE_UPD; -- Call to the procedure which will filter the data from xxsub_item -- Delete data from Queue tables older than the retention time FOR rec_cleanup IN ( SELECT * FROM XXSUB_ITEM WHERE WHEN_PROCESSED = sysdate - 10 AND WHEN_PROCESSED != '1-JAN-1970' ) LOOP BEGIN DELETE FROM XXSUB_ITEM WHERE sequence_no = rec_cleanup.sequence_no; DELETE FROM XXSUB_ITEM_ATTR WHERE sequence_no = rec_cleanup.sequence_no; DELETE FROM XXSUB_ITEM_XREF WHERE sequence_no = rec_cleanup.sequence_no; DELETE FROM XXSUB_ITEM_XREF_ATTR WHERE sequence_no = rec_cleanup.sequence_no; COMMIT; EXCEPTION WHEN OTHERS THEN NULL; END; END LOOP; --Read the xstatus_eror_tib_pub table and send email to application specific alias or support FOR rec in (SELECT msg_seq_no, sub_msgseqno, message_name, insert_timestamp, message_text FROM XSTATUS_ERR_TIB_PUB WHERE TRUNC(when_processed) = to_date('1-Jan-1970', 'DD-MON-YYYY') AND publish_facility = 'GD' AND message_name like 'ITEM%') LOOP v_print1 := SUBSTR(rec.sub_msgseqno || chr(9) || rec.message_name || chr(9) || rec.insert_timestamp || chr(9) || rec.message_text, 1, 254); dbms_output.put_line( v_print1); --update when_processed to sysdate UPDATE XSTATUS_ERR_TIB_PUB SET when_processed = SYSDATE WHERE msg_seq_no = rec.msg_seq_no; COMMIT; END LOOP; EXCEPTION WHEN OTHERS THEN ROLLBACK; RAISE; END; 6jgfda6a3r7w0SELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'LG%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1" ."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PE RIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')6qpsh27z33zy5SELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'DATANG%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR( "A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1" ."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')72bpcq74qrwatSELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'JDS UNI%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR ("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1 "."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')749tad6uzbksvDELETE FROM XXSUB_ITEM_XREF_ATTR WHERE SEQUENCE_NO = :B1 79vkpt3hzg03wSELECT "PART_NUMBER", "PRODUCT_LINE", "ACCOUNT", "REVENUE_AMOUNT", "PERIOD_NAME", "REVENUE_TYPE", "PART_FAMILY", "COMPANY", "ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "O100663" WHERE "ACCOUNT"='4400' AND "REVENUE_TYPE" NOT LIKE 'INT%' AND UPPER("PERIOD_NAME")='DEC-14' AND "PART_NUMBER" LIKE '%-SERV'7g3wv47q7aa40SELECT * FROM XXSUB_QUOTE X WHERE TRUNC(WHEN_PROCESSED) = '01-JAN-1970' ORDER BY SEQUENCE_NO 7tr0031mjpkscbegin publish_to_pos(FALSE); end;81ky0n97v4zsg/* OracleOEM */ select s.sid, s.serial# from v$session s where s.sid = (select sid from v$mystat where rownum=1)83v08gtfj7q88INSERT INTO XXSUB_ITEM_XREF ( SEQUENCE_NO, XREF_RELATIONSHIP_NAME, XREF_ITEM_TYPE, XREF_ITEM_NAME, XREF_ITEM_REVISION) VALUES (:v0, :v1, :v2, :v3, :v4)868n3yds47cg4SELECT "A1"."PART_NUMBER", "A1"."PRODUCT_LINE", "A1"."ACCOUNT", "A1"."SUB_ACCOUNT", "A1"."EXTENDED_RESALE", "A1"."REVENUE_AMOUNT", "A1"."ID_NUMBER", "A1"."PERIOD_NAME", "A1"."QUANTITY", "A1"."CHANNEL_NAME", "A1"."ENDCUST_SS_ID", "A1"."XCM_ENDCUST_XU_NAME", SUM("A1"."NET_RESALE") FROM "GD"."ASP_REVENUE_TABLE_XCM" "A1" WHERE "A1"."PERIOD_NAME" LIKE 'JAN-14' OR "A1"."PERIOD_NAME" LIKE 'FEB-14' GROUP BY "A1"."PART_NUMBER", "A1"."PRODUCT_LINE", "A1"."ACCOUNT", "A1"."SUB_ACCOUNT", "A1"."EXTENDED_RESALE", "A1"."REVENUE_AMOUNT", "A1"."ID_NUMBER", "A1"."PERIOD_NAME", "A1"."QUANTITY", "A1"."CHANNEL_NAME", "A1"."ENDCUST_SS_ID", "A1"."XCM_ENDCUST_XU_NAME"8bu6baap1snwySELECT "A1"."PART_NUMBER", "A1"."DISTRIBUTOR_NAME", "A1"."PRODUCT_LINE", "A1"."ACCOUNT", "A1"."SUB_ACCOUNT", "A1"."EXTENDED_RESALE", "A1"."REVENUE_AMOUNT", "A1"."ID_NUMBER", "A1"."PERIOD_NAME", "A1"."QUANTITY", "A1"."CHANNEL_NAME", "A1"."XCM_ENDCUST_XU_NAME", SUM("A1"."QUANTITY"), SUM("A1"."REVENUE_AMOUNT"), SUM("A1"."EXTENDED_RESALE"), SUM("A1"."NET_RESALE") FROM "GD"."ASP_REVENUE_TABLE_XCM" "A1" WHERE "A1"."PERIOD_NAME" LIKE 'JAN-14' OR "A1"."PERIOD_NAME" LIKE 'FEB-14' OR "A1"."PERIOD_NAME" LIKE 'MAR-14' GROUP BY "A1"."PART_NUMBER", "A1"."DISTRIBUTOR_NAME", "A1"."PRODUCT_LINE", "A1"."ACCOUNT", "A1"."SUB_ACCOUNT", "A1"."EXTENDED_RESALE", "A1"."REVENUE_AMOUNT", "A1"."ID_NUMBER", "A1"."PERIOD_NAME", "A1"."QUANTITY", "A1"."CHANNEL_NAME", "A1"."XCM_ENDCUST_XU_NAME"8suz9a9ykkwwqDECLARE tserver VARCHAR2(80) := NULL; tusername VARCHAR2(80) := NULL; tosuser VARCHAR2(80) := NULL; tmachine VARCHAR2(80) := NULL; tprogram VARCHAR2(80) := NULL; tmodule VARCHAR2(80) := NULL; BEGIN BEGIN SELECT username, osuser, machine, program, module INTO tusername, tosuser, tmachine, tprogram, tmodule FROM v$session WHERE userenv('sessionid') = audsid AND rownum = 1; END; BEGIN SELECT server_name INTO tserver FROM SYS.XXSOX_ValidServers WHERE UPPER(server_name) = UPPER(tmachine); EXCEPTION WHEN no_data_found THEN IF substr(ltrim(nvl(tprogram, 'NULL')), 1, 7) != 'bifrost' THEN XXSOX_UserLog(tusername, tosuser, tmachine, tprogram, tmodule); END IF; END; END;928mhrahfhkpdSELECT a.processed_records, b.unprocessed_records, a.processed_records_hours FROM (SELECT COUNT(*) as processed_records, nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '00', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '01', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '02', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '03', 1, 0)), 0) ||'~'||nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '04', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '05', 1, 0)), 0) ||'~'||nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '06', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '07', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '08', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '09', 1, 0)), 0) ||'~'||nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '10', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '11', 1, 0)), 0) ||'~'||nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '12', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '13', 1, 0)), 0) ||'~'||nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '14', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '15', 1, 0)), 0) ||'~'||nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '16', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '17', 1, 0)), 0) ||'~'||nvl(SUM(DECODE(TO_CHAR(when_proce ssed, 'hh24'), '18', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '19', 1, 0)), 0) ||'~'||nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '20', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '21', 1, 0)), 0) ||'~'||nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '22', 1, 0)), 0) ||'~'|| nvl(SUM(DECODE(TO_CHAR(when_processed, 'hh24'), '23', 1, 0)), 0) processed_records_hours FROM XXSUB_OPPORTUNITY_PROGRAM WHERE when_processed TRUNC(SYSDATE)) a, (SELECT COUNT(*) as unprocessed_records FROM XXSUB_OPPORTUNITY_PROGRAM WHERE when_processed = '01-JAN-1970') b9wapxfsbzds5hINSERT INTO SYS.XXSOX_INVALIDCONNECTIONS VALUES (:B5 , :B4 , :B3 , :B2 , :B1 , SYSDATE)artwjs76kssvyDELETE FROM XXSUB_ITEM_ATTR WHERE SEQUENCE_NO = :B1 b41awu29rqx6sINSERT INTO XXSUB_BOM_COMP_ATTR ( SEQUENCE_NO, COMP_RELATIONSHIP_NAME, COMP_RELATIONSHIP_ID, COMP_ITEM_TYPE, COMP_ITEM_NAME, COMP_ITEM_REVISION, ATTR_NAME, ATTR_VALUE ) VALUES ( :v0, :v1, :v2, :v3, :v4, :v5, :v6, :v7 )bmj5us86kyf8aSELECT * FROM XXPUB_FULFILLMENT WHERE WHEN_PROCESSED = '01-jan-1970' order by SEQUENCE_NObmuqkwgyxq95mINSERT INTO XXSUB_BOM_COMP_REF ( SEQUENCE_NO, COMP_RELATIONSHIP_NAME, COMP_RELATIONSHIP_ID, COMP_ITEM_TYPE, COMP_ITEM_NAME, COMP_ITEM_REVISION, REF_RELATIONSHIP_NAME, REF_ITEM_TYPE , REF_ITEM_NAME, REF_ITEM_REVISION ) VALUES ( :v0, :v1, :v2, :v3, :v4, :v5, :v6, :v7, :v8, :v9 )bnzuc1x96jbkdSELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'DELL%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A 1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"." PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')cpwrux6mwsfy6SELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'GIGA%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A 1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"." PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')cvzb1cvmdpp34SELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'ARISTA%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR( "A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1" ."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')czbcbbrs9m00bSELECT "A1"."PART_NUMBER", "A1"."DISTRIBUTOR_NAME", "A1"."PRODUCT_LINE", "A1"."ACCOUNT", "A1"."SUB_ACCOUNT", "A1"."EXTENDED_RESALE", "A1"."REVENUE_AMOUNT", "A1"."ID_NUMBER", "A1"."PERIOD_NAME", "A1"."QUANTITY", "A1"."CHANNEL_NAME", "A1"."XCM_ENDCUST_XU_NAME", SUM("A1"."QUANTITY"), SUM("A1"."REVENUE_AMOUNT"), SUM("A1"."EXTENDED_RESALE"), SUM("A1"."NET_RESALE") FROM "GD"."ASP_REVENUE_TABLE_XCM" "A1" WHERE "A1"."PERIOD_NAME" LIKE 'JAN-14' OR "A1"."PERIOD_NAME" LIKE 'FEB-14' GROUP BY "A1"."PART_NUMBER", "A1"."DISTRIBUTOR_NAME", "A1"."PRODUCT_LINE", "A1"."ACCOUNT", "A1"."SUB_ACCOUNT", "A1"."EXTENDED_RESALE", "A1"."REVENUE_AMOUNT", "A1"."ID_NUMBER", "A1"."PERIOD_NAME", "A1"."QUANTITY", "A1"."CHANNEL_NAME", "A1"."XCM_ENDCUST_XU_NAME"dngx7pmc9ka72SELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'BAIDU%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR(" A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1". "PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')dnzbcmgb9h0phSELECT DISTINCT c.disti_edi_849_filename || '!' || a.dar_session_no FROM gd_edi_844_rejects a, gd_edi_844_msgs b, gd_distributors c WHERE a.dar_header_fk = b.header_fk AND a.dar_contract_fk = b.contract_fk AND a.dar_pad_pk = b.pad_pk AND a.dar_session_no = b.session_no AND a.dar_process_ind != 'Y' AND b.created_by = 'EDI-DA-844' AND DECODE(RTRIM(TO_CHAR(TO_DATE(a.created_date), 'DAY')), 'THURSDAY', TRUNC(a.created_date+4), 'FRIDAY', TRUNC(a.created_date+4), 'SATURDAY', TRUNC(a.created_date+3), TRUNC(a.created_date + 2)) = TRUNC(SYSDATE+4) AND b.disti_name = c.disti_namedwt9jadadx51aSELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'SIMPLYVITI%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUB STR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR( "A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')fchznr7bs81dqSELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'AMAZON%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR( "A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1" ."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')fhgft51ugknqdSELECT DISTINCT C.GD_CUST_ID, C.HUB_PARTY_ID, C.CUSTOMER_NAME, C.ADDRESS_LINE1, C.ADDRESS_LINE2, C.ADDRESS_LINE3, C.ADDRESS_LINE4, C.CITY, C.STATE, C.PROVINCE, C.COUNTY, C.COUNTRY, C.POSTAL_CODE, C.STATUS, C.DISTI_CUST_ID, C.CREATION_DATE, C.LAST_UPDATE_DATE, C.DISTI_NAME FROM GD_CUSTOMERS C, XXCM_CUST_LOC_REPUBLISH REP WHERE C.GD_CUST_ID = REP.GD_CUST_ID(+) AND ( C.CREATION_DATE = :B1 OR C.LAST_UPDATE_DATE = :B1 OR REP.LAST_UPDATE_DATE = :B1 ) UNION SELECT DISTINCT C.GD_CUST_ID, C.HUB_PARTY_ID, C.CUSTOMER_NAME, C.ADDRESS_LINE1, C.ADDRESS_LINE2, C.ADDRESS_LINE3, C.ADDRESS_LINE4, C.CITY, C.STATE, C.PROVINCE, C.COUNTY, C.COUNTRY, C.POSTAL_CODE, C.STATUS, C.DISTI_CUST_ID, C.CREATION_DATE, C.LAST_UPDATE_DATE, C.DISTI_NAME FROM GD_CUSTOMERS C, XXCM_CUST_LOC_REPUBLISH REP WHERE C.GD_CUST_ID = REP.GD_CUST_ID(+) AND ( C.CREATION_DATE :B1 OR C.LAST_UPDATE_DATE :B1 OR REP.LAST_UPDATE_DATE :B1 ) AND ( C.CREATION_DATE :B1 -30 OR C.LAST_UPDATE_DATE :B1 -30 OR REP.LAST_UPDATE_DATE :B1 -30 ) AND C.GD_CUST_ID NOT IN (SELECT SOURCE_SYSTEM_REFERENCE FROM XXPUB_CUST_LOC)fjxusy4bv8b85select DISTINCT TPOS_FILENAME from gd_edi_pos_items where tpos_process_ind='N' and tpos_territory = 'NORTH AMERICA'fy7595g0tp46vSELECT /*+ NOREWRITE */ DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER'), "A1"."CUSTOMER_CITY", "A1"."CUSTOMER_COUNTRY", "A1"."DISTRIBUTOR_NAME", "A1"."EXTENDED_RESALE", "A1"."PART_NUMBER", "A1"."QUANTITY", "A1"."REGION", "A1"."SHIPCUST_XCM_NAME", "A1"."ENDCUST_XCM_NAME" FROM "GD"."ASP_REVENUE_TABLE" "A1" WHERE "A1"."ENDCUST_XCM_NAME" LIKE 'INTELLIPROP%' AND (DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SU BSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q314' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q414' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q214' OR DECODE(SUBSTR("A1"."PERIOD_NAME", 1, 3), 'APR', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAY', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUN', 'Q1'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JUL', 'Q2'||SUBSTR ("A1"."PERIOD_NAME", 5, 6), 'AUG', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'SEP', 'Q2'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OCT', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'NOV', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'DEC', 'Q3'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'JAN', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'FEB', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'MAR', 'Q4'||SUBSTR("A1"."PERIOD_NAME", 5, 6), 'OTHER')='Q114') AND ("A1"."REVENUE_TYPE" LIKE 'POS%' OR "A1"."REVENUE_TYPE" LIKE 'DIRECT')g00cj285jmgswupdate sys.mon_mods$ set inserts = inserts + :ins, updates = updates + :upd, deletes = deletes + :del, flags = (decode(bitand(flags, :flag), :flag, flags, flags + :flag)), drop_segments = drop_segments + :dropseg, timestamp = :time where obj# = :objng294qgxf8jqhbINSERT INTO XXSUB_ITEM_ATTR ( SEQUENCE_NO, ATTR_NAME, ATTR_VALUE ) VALUES (:v0, :v1, :v2)gd38axjtgv5uqselect XXSUB_ITEM_SEQ.nextval from dualgdvvuza0axnhbUPDATE GD_EDI_POS_ITEMS SET TPOS_PROCESS_IND = 'N' WHERE TPOS_PROCESS_IND = 'X'gfq05puhdqs8vINSERT INTO XXSUB_BOM_COMP_REF_ATTR ( SEQUENCE_NO, COMP_RELATIONSHIP_NAME, COMP_RELATIONSHIP_ID, COMP_ITEM_TYPE, COMP_ITEM_NAME, COMP_ITEM_REVISION, REF_RELATIONSHIP_NAME, REF_ITEM_TYPE, REF_ITEM_NAME, REF_ITEM_REVISION, ATTR_NAME, ATTR_VALUE ) VALUES ( :v0, :v1, :v2, :v3, :v4, :v5, :v6, :v7, :v8, :v9, :v10, :v11 )Back to SQL Statistics Back to TopInstance Activity Statistics Instance Activity Stats Instance Activity Stats - Absolute Values Instance Activity Stats - Thread Activity Back to Top Instance Activity StatsStatisticTotalper Secondper TransCPU used by this session1,046,17329.0929.58CPU used when call started1,034,05928.7629.24CR blocks created7440.020.02Cached Commit SCN referenced299,9928.348.48Commit SCN cached500.000.00DB time7,123,161198.09201.40DBWR checkpoint buffers written102,4652.852.90DBWR checkpoints650.000.00DBWR object drop buffers written00.000.00DBWR revisited being-written buffer2660.010.01DBWR thread checkpoint buffers written00.000.00DBWR transaction table writes1,0600.030.03DBWR undo block writes90,3862.512.56DFO trees parallelized30.000.00IMU CR rollbacks820.000.00IMU Flushes33,2620.920.94IMU Redo allocation size282,489,1527,855.837,987.14IMU commits7,7890.220.22IMU contention1100.000.00IMU ktichg flush1130.000.00IMU pool not allocated2,0330.060.06IMU recursive-transaction flush6810.020.02IMU undo allocation size1,075,551,96829,910.3630,410.31IMU- failed to get a private strand2,0330.060.06PX local messages recv'd148,3584.134.19PX local messages sent148,4134.134.20Parallel operations downgraded 1 to 25 pct30.000.00Parallel operations downgraded to serial30.000.00SMON posted for undo segment recovery20.000.00SMON posted for undo segment shrink790.000.00SQL*Net roundtrips to/from client779,62521.6822.04SQL*Net roundtrips to/from dblink2260.010.01active txn count during cleanout21,3590.590.60application wait time640.000.00background checkpoints completed580.000.00background checkpoints started590.000.00background timeouts127,5523.553.61branch node splits1000.000.00buffer is not pinned count48,155,8441,339.181,361.57buffer is pinned count49,846,2201,386.191,409.36bytes received via SQL*Net from client105,053,9412,921.482,970.31bytes received via SQL*Net from dblink336,9489.379.53bytes sent via SQL*Net to client338,562,4499,415.199,572.56bytes sent via SQL*Net to dblink42,5401.181.20calls to get snapshot scn: kcmgss521,08114.4914.73calls to kcmgas160,1174.454.53calls to kcmgcs33,1710.920.94change write time9,3520.260.26cleanout - number of ktugct calls31,4030.870.89cleanouts and rollbacks - consistent read gets410.000.00cleanouts only - consistent read gets7140.020.02cluster key scan block gets273,8217.617.74cluster key scans5,5520.150.16commit batch performed10.000.00commit batch requested10.000.00commit batch/immediate performed3510.010.01commit batch/immediate requested3510.010.01commit cleanout failures: block lost1290.000.00commit cleanout failures: buffer being written450.000.00commit cleanout failures: callback failure5,9240.160.17commit cleanout failures: cannot pin410.000.00commit cleanouts458,56512.7512.97commit cleanouts successfully completed452,42612.5812.79commit immediate performed3500.010.01commit immediate requested3500.010.01commit txn count during cleanout45,9711.281.30concurrency wait time1,3880.040.04consistent changes26,1830.730.74consistent gets120,536,7183,352.043,408.07consistent gets - examination2,485,35769.1270.27consistent gets direct89,2322.482.52consistent gets from cache120,447,4863,349.563,405.55current blocks converted for CR60.000.00cursor authentications1330.000.00data blocks consistent reads - undo records applied20,1690.560.57db block changes7,071,281196.65199.93db block gets6,773,461188.37191.51db block gets direct910.000.00db block gets from cache6,773,370188.36191.51deferred (CURRENT) block cleanout applications90,2862.512.55dirty buffers inspected38,9251.081.10enqueue conversions12,4320.350.35enqueue releases550,62015.3115.57enqueue requests550,73915.3215.57enqueue timeouts1200.000.00enqueue waits100.000.00execute count885,03624.6125.02failed probes on index block reclamation50.000.00free buffer inspected79,874,3462,221.252,258.38free buffer requested79,787,9852,218.852,255.94heap block compress9,0540.250.26hot buffers moved to head of LRU499,63013.8914.13immediate (CR) block cleanout applications7550.020.02immediate (CURRENT) block cleanout applications132,1093.673.74index crx upgrade (found)00.000.00index crx upgrade (positioned)66,6171.851.88index fast full scans (full)4280.010.01index fetch by key651,81418.1318.43index scans kdiixs115,902,576442.24449.63leaf node 90-10 splits2,8490.080.08leaf node splits10,4410.290.30lob reads1,0530.030.03lob writes1,9610.050.06lob writes unaligned1,9610.050.06logons cumulative1,4890.040.04messages received71,2631.982.01messages sent71,2611.982.01no buffer to keep pinned count00.000.00no work - consistent read gets117,854,3093,277.453,332.23opened cursors cumulative103,6812.882.93parse count (failures)50.000.00parse count (hard)1,5610.040.04parse count (total)101,5452.822.87parse time cpu2,1280.060.06parse time elapsed3,0090.080.09physical read IO requests3,756,646104.47106.22physical read bytes###############18,203,603.6818,507,880.46physical read total IO requests3,814,558106.08107.85physical read total bytes###############18,254,915.0718,560,049.52physical read total multi block requests2,712,57475.4376.70physical reads79,905,6052,222.122,259.26physical reads cache79,691,2472,216.162,253.20physical reads cache prefetch75,962,6622,112.472,147.78physical reads direct214,3585.966.06physical reads direct (lob)60.000.00physical reads direct temporary tablespace120,9103.363.42physical reads prefetch warmup00.000.00physical write IO requests73,0332.032.06physical write bytes2,387,124,22466,384.2767,493.90physical write total IO requests199,5265.555.64physical write total bytes6,820,727,296189,679.71192,850.24physical write total multi block requests112,2643.123.17physical writes291,3978.108.24physical writes direct123,9963.453.51physical writes direct (lob)60.000.00physical writes direct temporary tablespace120,6933.363.41physical writes from cache167,4014.664.73physical writes non checkpoint283,7807.898.02pinned buffers inspected3310.010.01prefetch clients - default00.000.00prefetch warmup blocks aged out before use00.000.00prefetched blocks aged out before use1730.000.00process last non-idle time35,6710.991.01queries parallelized30.000.00recursive calls4,048,725112.59114.47recursive cpu usage241,8866.736.84redo blocks written2,724,06675.7577.02redo buffer allocation retries1950.010.01redo entries3,069,53485.3686.79redo log space requests2460.010.01redo log space wait time2,2260.060.06redo ordering marks88,8142.472.51redo size1,337,984,40037,208.4237,830.37redo subscn max counts109,3633.043.09redo synch time25,2430.700.71redo synch writes14,5780.410.41redo wastage11,858,984329.79335.30redo write time43,0441.201.22redo writer latching time100.000.00redo writes42,9641.191.21rollback changes - undo records applied9870.030.03rollbacks only - consistent read gets7090.020.02rows fetched via callback236,7366.586.69session connect time00.000.00session cursor cache hits60,9701.701.72session logical reads127,310,1793,540.413,599.59session pga memory45,811,7601,273.991,295.29session pga memory max449,533,26412,501.2112,710.17session uga memory47,480,2561,320.391,342.46session uga memory max2,043,083,92856,816.7557,766.45shared hash latch upgrades - no wait85,1852.372.41shared hash latch upgrades - wait00.000.00sorts (disk)20.000.00sorts (memory)152,0944.234.30sorts (rows)10,898,508303.08308.15sql area evicted390.000.00sql area purged40.000.00summed dirty queue length452,75712.5912.80switch current to new buffer3,0320.080.09table fetch by rowid14,024,220390.00396.52table fetch continued row1,081,01830.0630.56table scan blocks gotten80,547,3002,239.962,277.41table scan rows gotten1,292,651,95135,947.7636,548.63table scans (cache partitions)00.000.00table scans (direct read)5130.010.01table scans (long tables)4,9640.140.14table scans (rowid ranges)5130.010.01table scans (short tables)21,8600.610.62total number of times SMON posted2700.010.01transaction rollbacks3510.010.01transaction tables consistent read rollbacks40.000.00transaction tables consistent reads - undo records applied1470.000.00undo change vector size641,739,68817,846.3418,144.64user I/O wait time700,66519.4919.81user calls797,52222.1822.55user commits35,3590.981.00user rollbacks90.000.00workarea executions - onepass170.000.00workarea executions - optimal131,2263.653.71write clones created in background30.000.00write clones created in foreground2120.010.01Back to Instance Activity Statistics Back to TopInstance Activity Stats - Absolute ValuesStatistics with absolute values (should not be diffed) StatisticBegin ValueEnd Valuesession cursor cache count56,24776,946opened cursors current426512logons current5262Back to Instance Activity Statistics Back to TopInstance Activity Stats - Thread ActivityStatistics identified by '(derived)' come from sources other than SYSSTAT StatisticTotalper Hourlog switches (derived)595.91 Back to Instance Activity Statistics Back to Top IO Stats Tablespace IO Stats File IO Stats Back to Top Tablespace IO Statsordered by IOs (Reads + Writes) desc TablespaceReadsAv Reads/sAv Rd(ms)Av Blks/RdWritesAv Writes/sBuffer WaitsAv Buf Wt(ms)SYSTEM1,505,025420.6624.011,17301156.87GLODIST1,151,454323.3817.3237,618165.00ASP_REV_DATA973,357271.8424.17240000.00GLODIST_INDEX78,92523.391.035,645000.00ASP_REV_INDEX27,76911.721.00171000.00UNDOTBS67100.541.0020,7661941.38SYSAUX12,01904.242.422,250000.00TEMP4,948013.6124.454,176000.00INVTEST_DATA1,48306.5116.44254000.00TOOLS79507.0715.77511000.00INVTESTI19400.771.00116000.00XRO_USER_SPACE11600.861.0057000.00QUEST7701.301.0057000.00TEMP_XRO100.001.000000.00Back to IO Stats Back to TopFile IO Statsordered by Tablespace, File TablespaceFilenameReadsAv Reads/sAv Rd(ms)Av Blks/RdWritesAv Writes/sBuffer WaitsAv Buf Wt(ms)ASP_REV_DATA/db/oradata/glodist/ASP_DATA01.DBF356,535101.3717.7668000.00ASP_REV_DATA/db/oradata/glodist/ASP_DATA02.DBF206,91662.2529.6857000.00ASP_REV_DATA/db/oradata/glodist/ASP_DATA03.DBF221,95162.0827.9157000.00ASP_REV_DATA/db/oradata/glodist/ASP_DATA04.DBF187,95552.0025.8758000.00ASP_REV_INDEX/db/oradata/glodist/ASP_INDEX01.DBF5,54002.341.0057000.00ASP_REV_INDEX/db/oradata/glodist/ASP_INDEX02.DBF19,64711.261.0057000.00ASP_REV_INDEX/db/oradata/glodist/ASP_INDEX03.DBF2,58203.821.0057000.00GLODIST/db/oradata/glodist/GLODIST01.DBF91,81433.8712.702,595000.00GLODIST/db/oradata/glodist/GLODIST02.DBF94,67633.2816.101,914000.00GLODIST/db/oradata/glodist/GLODIST03.DBF179,38052.6020.455,0030210.00GLODIST/db/oradata/glodist/GLODIST04.DBF69,52824.5412.4212,048033.33GLODIST/db/oradata/glodist/GLODIST05.DBF68,43222.8210.851,337000.00GLODIST/db/oradata/glodist/GLODIST06.DBF42,00113.4815.311,255000.00GLODIST/db/oradata/glodist/GLODIST07.DBF33,24913.9017.621,155000.00GLODIST/db/oradata/glodist/GLODIST08.DBF52,61912.8812.79493000.00GLODIST/db/oradata/glodist/GLODIST09.DBF28,49913.9615.42463000.00GLODIST/db/oradata/glodist/GLODIST10.DBF31,33313.9818.40167000.00GLODIST/db/oradata/glodist/GLODIST11.DBF44,10413.1424.31376000.00GLODIST/db/oradata/glodist/GLODIST12.DBF30,31913.2224.60106000.00GLODIST/db/oradata/glodist/GLODIST13.DBF53,58812.7520.01733000.00GLODIST/db/oradata/glodist/GLODIST14.DBF51,66113.4522.79858000.00GLODIST/db/oradata/glodist/GLODIST15.DBF9,46805.6617.991,310000.00GLODIST/db/oradata/glodist/GLODIST16.DBF39,75911.965.581,413000.00GLODIST/db/oradata/glodist/GLODIST17.DBF25,14012.187.38506000.00GLODIST/db/oradata/glodist/GLODIST18.DBF13,44503.6526.9296000.00GLODIST/db/oradata/glodist/GLODIST19.DBF20,35013.5527.33276000.00GLODIST/db/oradata/glodist/GLODIST20.DBF7,26605.9325.72223000.00GLODIST/db/oradata/glodist/GLODIST21.DBF18,03315.7616.13734000.00GLODIST/db/oradata/glodist/GLODIST22.DBF19,20015.7617.372,011000.00GLODIST/db/oradata/glodist/GLODIST23.DBF14,91005.1425.24286000.00GLODIST/db/oradata/glodist/GLODIST24.DBF23,66613.3719.25266000.00GLODIST/db/oradata/glodist/GLODIST25.DBF26,52313.3626.14949010.00GLODIST/db/oradata/glodist/GLODIST26.DBF30,36313.6316.45766000.00GLODIST/db/oradata/glodist/GLODIST27.DBF32,12813.0920.73279000.00GLODIST_INDEX/db/oradata/glodist/GLODIST_INDEX01.DBF9,06402.271.00459000.00GLODIST_INDEX/db/oradata/glodist/GLODIST_INDEX02.DBF5,23104.391.00522000.00GLODIST_INDEX/db/oradata/glodist/GLODIST_INDEX03.DBF5,30603.991.00544000.00GLODIST_INDEX/db/oradata/glodist/GLODIST_INDEX04.DBF6,73703.121.00353000.00GLODIST_INDEX/db/oradata/glodist/GLODIST_INDEX05.DBF15,33003.311.02642000.00GLODIST_INDEX/db/oradata/glodist/GLODIST_INDEX06.DBF4,09504.461.03438000.00GLODIST_INDEX/db/oradata/glodist/GLODIST_INDEX07.DBF4,24404.481.09654000.00GLODIST_INDEX/db/oradata/glodist/GLODIST_INDEX08.DBF10,83102.191.03426000.00GLODIST_INDEX/db/oradata/glodist/GLODIST_INDEX09.DBF7,33902.821.00320000.00GLODIST_INDEX/db/oradata/glodist/GLODIST_INDEX10.DBF7,51702.791.05350000.00GLODIST_INDEX/db/oradata/glodist/GLODIST_INDEX11.DBF1,48509.411.25524000.00GLODIST_INDEX/db/oradata/glodist/GLODIST_INDEX12.DBF1,74608.161.21413000.00INVTESTI/db/oradata/glodist/INVTESTI01.DBF9700.721.0058000.00INVTESTI/db/oradata/glodist/INVTESTI02.DBF9700.821.0058000.00INVTEST_DATA/db/oradata/glodist/INVEST_DATA01.DBF73005.8116.39105000.00INVTEST_DATA/db/oradata/glodist/INVEST_DATA02.DBF75307.1816.48149000.00QUEST/db/oradata/glodist/QUEST01.DBF7701.301.0057000.00SYSAUX/db/oradata/glodist/SYSAUX01.DBF12,01904.242.422,250000.00SYSTEM/db/oradata/glodist/SYSTEM01.DBF1,505,025420.6624.011,17301156.87TEMP/db/oraredo01/glodist/TEMP01.DBF2,225015.3323.761,86600 TEMP/db/oraredo01/glodist/TEMP02.DBF2,723012.2125.012,31000 TEMP_XRO/db/oraredo01/glodist/TEMP_RO_01.dbf100.001.00000 TOOLS/db/oradata/glodist/TOOLS01.DBF79507.0715.77511000.00UNDOTBS/db/oradata/glodist/UNDOTBS01.DBF67100.541.0020,7661941.38XRO_USER_SPACE/db/oradata/glodist/USER_SPACE.DBF11600.861.0057000.00 Back to IO Stats Back to Top Buffer Pool StatisticsStandard block size Pools D: default, K: keep, R: recycle Default Pools for other block sizes: 2k, 4k, 8k, 16k, 32k PNumber of BuffersPool Hit%Buffer GetsPhysical ReadsPhysical WritesFree Buff WaitWrit Comp WaitBuffer Busy WaitsD27,66437127,187,87479,691,617167,40100215 Back to Top Advisory Statistics Instance Recovery Stats Buffer Pool Advisory PGA Aggr Summary PGA Aggr Target Stats PGA Aggr Target Histogram PGA Memory Advisory Shared Pool Advisory SGA Target Advisory Streams Pool Advisory Java Pool Advisory Back to Top Instance Recovery StatsB: Begin snapshot, E: End snapshot Targt MTTR (s) Estd MTTR (s)Recovery Estd IOsActual Redo BlksTarget Redo BlksLog File Size Redo BlksLog Ckpt Timeout Redo BlksLog Ckpt Interval Redo Blks B271530145132609623958026096 E43202096470118953323958089533 Back to Advisory Statistics Back to TopBuffer Pool AdvisoryOnly rows with estimated physical reads 0 are displayed ordered by Block Size, Buffers For Estimate PSize for Est (M)Size FactorBuffers for EstimateEst Phys Read FactorEstimated Physical ReadsD200.092,4701.15354,780,022D400.184,9401.08335,279,685D600.277,4101.06328,354,962D800.369,8801.05323,193,960D1000.4512,3501.03319,603,441D1200.5414,8201.02316,533,122D1400.6317,2901.02313,992,553D1600.7119,7601.01312,248,216D1800.8022,2301.01310,910,816D2000.8924,7001.00309,924,893D2200.9827,1701.00309,166,923D2241.0027,6641.00309,034,782D2401.0729,6401.00308,496,861D2601.1632,1101.00307,899,504D2801.2534,5800.99307,283,334D3001.3437,0500.99306,726,520D3201.4339,5200.99306,260,766D3401.5241,9900.99305,809,724D3601.6144,4600.99305,319,391D3801.7046,9300.99304,672,530D4001.7949,4000.98303,261,648 Back to Advisory Statistics Back to Top PGA Aggr SummaryPGA cache hit % - percentage of W/A (WorkArea) data processed only in-memory PGA Cache Hit %W/A MB ProcessedExtra W/A MB Read/Written94.2816,6211,009Back to Advisory Statistics Back to TopPGA Aggr Target StatsB: Begin snap E: End snap (rows dentified with B or E contain data which is absolute i.e. not diffed over the interval) Auto PGA Target - actual workarea memory target W/A PGA Used - amount of memory used for all Workareas (manual + auto) %PGA W/A Mem - percentage of PGA memory allocated to workareas %Auto W/A Mem - percentage of workarea memory controlled by Auto Mem Mgmt %Man W/A Mem - percentage of workarea memory under manual control PGA Aggr Target(M)Auto PGA Target(M)PGA Mem Alloc(M) W/A PGA Used(M) %PGA W/A Mem%Auto W/A Mem%Man W/A MemGlobal Mem Bound(K)B200116140.750.000.000.000.0040,960E200110147.860.000.000.000.0040,960 Back to Advisory Statistics Back to Top PGA Aggr Target HistogramOptimal Executions are purely in-memory operations Low OptimalHigh OptimalTotal ExecsOptimal Execs1-Pass ExecsM-Pass Execs2K4K115,513115,5130064K128K56056000128K256K2200256K512K363600512K1024K14,51914,519001M2M402402002M4M161160104M8M22008M16M19172016M32M12102032M64M422064M128M100100Back to Advisory Statistics Back to TopPGA Memory AdvisoryWhen using Auto Memory Mgmt, minimally choose a pga_aggregate_target value where Estd PGA Overalloc Count is 0 PGA Target Est (MB)Size FactrW/A MB ProcessedEstd Extra W/A MB Read/ Written to Disk Estd PGA Cache Hit %Estd PGA Overalloc Count250.1377,742.11125,417.2438.004,636500.2577,742.11125,417.2438.004,6361000.5077,742.1138,322.7567.001101500.7577,742.1117,779.6081.0002001.0077,742.1110,073.6989.0002401.2077,742.119,570.3089.0002801.4077,742.119,327.7789.0003201.6077,742.119,327.7789.0003601.8077,742.119,290.8589.0004002.0077,742.117,835.1891.0006003.0077,742.115,850.0193.0008004.0077,742.115,850.0193.0001,2006.0077,742.115,850.0193.0001,6008.0077,742.115,850.0193.000 Back to Advisory Statistics Back to Top Shared Pool AdvisorySP: Shared Pool Est LC: Estimated Library Cache Factr: Factor Note there is often a 1:Many correlation between a single logical object in the Library Cache, and the physical number of memory objects associated with it. Therefore comparing the number of Lib Cache objects (e.g. in v$librarycache), with the number of Lib Cache Memory Objects is invalid. Shared Pool Size(M)SP Size FactrEst LC Size (M)Est LC Mem ObjEst LC Time Saved (s)Est LC Time Saved FactrEst LC Load Time (s)Est LC Load Time FactrEst LC Mem Obj Hits1400.47373,063167,7160.9215,63861.576,781,0911720.57684,802181,6520.991,7026.706,789,1582040.68965,625183,0731.002811.116,790,7112360.791287,771183,0811.002731.076,791,2182680.8915911,271183,0881.002661.056,791,6823001.0019013,455183,1001.002541.006,792,2163321.1122215,485183,1021.002520.996,792,2703641.2124417,402183,1021.002520.996,792,2703961.3224417,402183,1021.002520.996,792,2704281.4324417,402183,1021.002520.996,792,2704601.5324417,402183,1021.002520.996,792,2704921.6424417,402183,1021.002520.996,792,2705241.7524417,402183,1021.002520.996,792,2705561.8524417,402183,1021.002520.996,792,2705881.9624417,402183,1021.002520.996,792,2706202.0724417,402183,1021.002520.996,792,270 Back to Advisory Statistics Back to Top SGA Target AdvisorySGA Target Size (M)SGA Size FactorEst DB Time (s)Est Physical Reads4000.50108,016318,154,4916000.75103,132311,603,5248001.00101,748309,007,8581,0001.25101,748309,007,8581,2001.50101,748309,007,8581,4001.75101,748309,007,8581,6002.00101,748309,007,858Back to Advisory Statistics Back to TopStreams Pool AdvisorySize for Est (MB)Size FactorEst Spill CountEst Spill Time (s)Est Unspill CountEst Unspill Time (s)160.160000280.280000400.400000520.520000640.640000760.760000880.8800001001.0000001121.1200001241.2400001361.3600001481.4800001601.6000001721.7200001841.8400001961.9600002082.0800002202.2000002322.3200002442.440000Back to Advisory Statistics Back to TopJava Pool AdvisoryNo data exists for this section of the report. Back to Advisory Statistics Back to TopWait Statistics Buffer Wait Statistics Enqueue Activity Back to Top Buffer Wait Statisticsordered by wait time desc, waits desc ClassWaitsTotal Wait Time (s)Avg Time (ms)data block12117undo header9201undo block200Back to Wait Statistics Back to TopEnqueue Activityonly enqueues with waits are shown Enqueue stats gathered prior to 10g should not be compared with 10g data ordered by Wait Time desc, Waits desc Enqueue Type (Request Reason)RequestsSucc GetsFailed GetsWaitsWt Time (s)Av Wt Time(ms)PR-Process Startup6969021371.00KO-Multiple Object Checkpoint (fast object checkpoint)54540602.00PS-PX Process Reservation456336120201.00 Back to Wait Statistics Back to Top Undo Statistics Undo Segment Summary Undo Segment Stats Back to Top Undo Segment SummaryMin/Max TR (mins) - Min and Max Tuned Retention (minutes) STO - Snapshot Too Old count, OOS - Out of Space count Undo segment block stats: uS - unexpired Stolen, uR - unexpired Released, uU - unexpired reUsed eS - expired Stolen, eR - expired Released, eU - expired reUsed Undo TS#Num Undo Blocks (K)Number of TransactionsMax Qry Len (s)Max Tx ConcurcyMin/Max TR (mins)STO/ OOSuS/uR/uU/ eS/eR/eU190.7367,3213,4597120/1200/00/0/0/0/0/0 Back to Undo Statistics Back to Top Undo Segment StatsMost recent 35 Undostat rows, ordered by Time desc End TimeNum Undo BlocksNumber of TransactionsMax Qry Len (s)Max Tx ConcyTun Ret (mins)STO/ OOSuS/uR/uU/ eS/eR/eU24-Mar 18:041,5411,694051200/00/0/0/0/0/024-Mar 17:541,2081,034051200/00/0/0/0/0/024-Mar 17:441176011200/00/0/0/0/0/024-Mar 17:3417145021200/00/0/0/0/0/024-Mar 17:241,3192,223021200/00/0/0/0/0/024-Mar 17:14301331051200/00/0/0/0/0/024-Mar 17:0463268021200/00/0/0/0/0/024-Mar 16:542,0161,761061200/00/0/0/0/0/024-Mar 16:441,08566862151200/00/0/0/0/0/024-Mar 16:34737493021200/00/0/0/0/0/024-Mar 16:241,4281,039031200/00/0/0/0/0/024-Mar 16:144,3784,275051200/00/0/0/0/0/024-Mar 16:043,2612,623061200/00/0/0/0/0/024-Mar 15:542,3331,74412351200/00/0/0/0/0/024-Mar 15:444973351,44621200/00/0/0/0/0/024-Mar 15:3484557684321200/00/0/0/0/0/024-Mar 15:244123691,43521200/00/0/0/0/0/024-Mar 15:145129883531200/00/0/0/0/0/024-Mar 15:0489762523131200/00/0/0/0/0/024-Mar 14:54818577021200/00/0/0/0/0/024-Mar 14:44548213021200/00/0/0/0/0/024-Mar 14:344941,000031200/00/0/0/0/0/024-Mar 14:24453328021200/00/0/0/0/0/024-Mar 14:141,635608031200/00/0/0/0/0/024-Mar 14:041,428701031200/00/0/0/0/0/024-Mar 13:544,6712,281061200/00/0/0/0/0/024-Mar 13:443,4452,057051200/00/0/0/0/0/024-Mar 13:343,2141,9671,70461200/00/0/0/0/0/024-Mar 13:242,4201,1141,10451200/00/0/0/0/0/024-Mar 13:141,46937454321200/00/0/0/0/0/024-Mar 13:0474481114441200/00/0/0/0/0/024-Mar 12:54748998021200/00/0/0/0/0/024-Mar 12:449501,890031200/00/0/0/0/0/024-Mar 12:349631,344041200/00/0/0/0/0/0Back to Undo Statistics Back to TopLatch Statistics Latch Activity Latch Sleep Breakdown Latch Miss Sources Parent Latch Statistics Child Latch Statistics Back to Top Latch Activity"Get Requests", "Pct Get Miss" and "Avg Slps/Miss" are statistics for willing-to-wait latch get requests "NoWait Requests", "Pct NoWait Miss" are for no-wait latch get requests "Pct Misses" for both should be very close to 0.0 Latch NameGet RequestsPct Get MissAvg Slps /MissWait Time (s)NoWait RequestsPct NoWait MissASM db client latch24,2510.00 00 AWR Alerted Metric Element list167,7140.00 00 Consistent RBA43,0300.00 00 FAL request queue8370.00 00 FAL subheap alocation8370.00 00 FIB s.o chain latch5900.00 00 FOB s.o list latch20,5440.090.0000 In memory undo latch767,7070.010.77052,6170.00JS queue state obj latch215,2800.00 00 KMG MMAN ready and startup request latch11,9830.00 00 KTF sga latch750.00 010,9350.00KWQMN job cache list latch80.00 00 KWQP Prop Status200.00 00 MQL Tracking Latch0 07180.00Memory Management Latch0 011,9830.00OS process4,7790.00 00 OS process allocation15,1760.010.0000 OS process: request allocation2,9200.100.0000 PL/SQL warning settings7,0620.00 00 SGA IO buffer pool latch2,428,6330.120.0002,428,6320.09SQL memory manager latch15019.330.69011,9120.00SQL memory manager workarea list latch869,4940.000.0000 Shared B-Tree1,7880.00 00 active checkpoint queue latch53,5720.030.0000 active service list95,3360.030.45017,1800.00archive control1,3850.00 00 archive process latch13,7040.011.0000 begin backup scn array180.00 00 cache buffer handles1,4410.00 00 cache buffers chains349,094,0790.000.021167,278,9480.00cache buffers lru chain359,9570.570.000170,247,3040.36cache table scan latch0 02,699,0440.15channel handle pool latch3,2920.00 00 channel operations parent latch175,3670.000.0000 checkpoint queue latch1,393,5770.000.000166,6730.00client/application info43,4150.00 00 commit callback allocation2300.00 00 compile environment latch1,5370.00 00 dml lock allocation402,5650.000.0000 dummy allocation3,0640.160.0000 enqueue hash chains1,113,8530.000.000900.00enqueues1,272,6560.010.0000 error message lists1470.680.0000 event group latch1,4650.00 00 event range base latch10.00 00 file cache latch5,8190.00 00 global KZLD latch for mem in SGA1,3560.00 00 global tx hash mapping16,8670.00 00 hash table column usage latch3740.00 018,4850.00hash table modification latch1,0760.00 00 job_queue_processes parameter latch5980.00 00 kks stats3,2620.00 00 kokc descriptor allocation latch200.00 00 ksuosstats global area2,4170.081.0000 ktm global data4500.00 00 kwqbsn:qsga1,7780.00 00 lgwr LWN SCN50,7440.00 00 library cache1,532,7840.010.0701,9770.00library cache load lock5640.00 00 library cache lock418,6730.000.0000 library cache lock allocation15,9560.00 00 library cache pin336,8630.000.0000 library cache pin allocation1,1000.00 00 list of block allocation11,1300.00 00 loader state object freelist3,1260.00 00 logminer context allocation100.00 00 longop free list parent2410.00 01480.00message pool operations parent latch3940.00 00 messages443,2110.010.0000 mostly latch-free SCN50,8060.010.4000 multiblock read objects6,042,2510.020.0100 ncodef allocation latch5710.00 00 object queue header heap117,7440.00 011,0000.00object queue header operation160,213,9050.000.0100 object stats modification2590.00 00 parallel query alloc buffer7,9440.620.0000 parallel query stats826.100.0000 parameter list6270.00 00 parameter table allocation management3,1770.030.0000 post/wait queue23,9660.010.00015,9060.00process allocation2,9200.030.0001,4640.07process group creation2,9200.00 00 process queue2,3300.170.0000 process queue reference6,127,6230.010.000192,8100.40qmn task queue latch5,1200.00 00 query server freelists2,1304.740.0800 query server process480.00 0480.00redo allocation258,6480.100.0203,069,0330.07redo copy0 03,069,6940.02redo writing210,4870.010.0000 resmgr group change latch8,4540.00 00 resmgr:active threads10,2160.00 00 resmgr:actses change group1,4720.00 00 resmgr:actses change state90.00 00 resmgr:free threads list3,0220.130.0000 resmgr:incr/decr stats460,2650.000.0000 resmgr:resource group CPU method115,5840.020.0500 resmgr:schema config7,2050.00 011,9750.00row cache objects920,7850.010.0001910.00rules engine rule set statistics1,0000.00 00 sequence cache50,0310.00 00 session allocation1,431,2220.080.0300 session idle bit2,305,0290.000.0900 session state list latch5,9070.100.0000 session switching5710.00 00 session timer11,9750.00 00 shared pool5,150,8170.020.0100 shared pool sim alloc1070.00 00 shared pool simulator674,6240.000.0000 sim partition latch100.00 010,5570.00simulator hash latch27,737,4730.000.0100 simulator lru latch167,4040.140.00017,595,1050.11slave class210.00 00 slave class create8411.901.0020 sort extent pool3,1550.100.0000 state object free list1200.00 00 statistics aggregation3,3600.00 00 temp lob duration state obj allocation360.00 00 threshold alerts latch4,0650.00 00 trace latch120.00 00 transaction allocation243,7300.00 00 transaction branch allocation20,0110.00 00 undo global data380,6170.000.0000 user lock5,4240.00 00 Back to Latch Statistics Back to Top Latch Sleep Breakdownordered by misses desc Latch NameGet RequestsMissesSleepsSpin GetsSleep1Sleep2Sleep3cache buffers chains349,094,0799,6841749,517000SGA IO buffer pool latch2,428,6332,84142,837000cache buffers lru chain359,9572,03672,029000multiblock read objects6,042,2511,381141,370000session allocation1,431,2221,110341,081000shared pool5,150,8171,072111,061000object queue header operation160,213,9051,020131,007000process queue reference6,127,6237721771000simulator hash latch27,737,4733122310000redo allocation258,6482554251000library cache1,532,78415511144000query server freelists2,130101893000session idle bit2,305,02979772000In memory undo latch767,707433310000active service list95,336331520000SQL memory manager latch15029209000resmgr:resource group CPU method115,58420119000slave class create8410100000mostly latch-free SCN50,806523000ksuosstats global area2,417220000archive process latch13,704110000Back to Latch Statistics Back to TopLatch Miss Sourcesonly latches with sleeps are shown ordered by name, sleeps desc Latch NameWhereNoWait MissesSleepsWaiter SleepsIn memory undo latchktiFlush: child0350In memory undo latchkticmt: child011SGA IO buffer pool latchksfd_free_sgabuffer034SGA IO buffer pool latchksfd_alloc_sgabuffer010SQL memory manager latchqesmmIQueryRefreshBound02020active service listksws_event: ksws event02521active service listkswssyis: find service entry 1010archive process latchkcrrgpll010cache buffers chainskcbzib: multi-block read: nowait02380cache buffers chainskcbgtcr: kslbegin excl0109235cache buffers chainskcbrls: kslbegin05856cache buffers chainskcbzgb: scan from tail. nowait0150cache buffers chainskcbzib: finish free bufs010140cache buffers chainskcbgcur: kslbegin074cache buffers chainskcbgtcr: fast path075cache buffers chainskcbnew: new latch again070cache buffers chainskcbget: pin buffer036cache buffers chainskcbchg: kslbegin: call CR func025cache buffers chainskcbbxsv011cache buffers chainskcbchg: kslbegin: bufs not pinned015cache buffers chainskcbget: exchange011cache buffers chainskcbgtcr: kslbegin shared010cache buffers lru chainkcbzgws070ksuosstats global areaksugetosstat022lgwr LWN SCNkcs023020library cachekglScanDependency070library cachekgldte: child 00422multiblock read objectskcbzib: normal mbr free0910multiblock read objectskcbzib: mbr get054object queue header operationkcbw_unlink_q0107object queue header operationkcbw_link_q050object queue header operationkcbo_switch_mq_bg036object queue header operationkcbo_swap_buf_bg013process queue referencekxfpqrsnd010query server freelistskxfpobadf088redo allocationkcrfw_redo_gen: redo allocation 1040resmgr:resource group CPU methodkgkpupdateclassbitmap011session allocationksuxds: KSUSFCLC not set0149session allocationksucri087session allocationksursi0412session allocationksuxds: not user session036session allocationkxfprdp030session allocationksudlp011session allocationkxfpqidqr015session idle bitksuxds043session idle bitksupuc: clear busy023session idle bitksupuc: if ksurcp022shared poolkghalo078shared poolkghupr1043simulator hash latchkcbs_lookup_setid: lookup dba012simulator hash latchkcbsacc: insert dba010slave class createksvcreate0100 Back to Latch Statistics Back to Top Parent Latch StatisticsNo data exists for this section of the report. Back to Latch Statistics Back to TopChild Latch StatisticsNo data exists for this section of the report. Back to Latch Statistics Back to TopSegment Statistics Segments by Logical Reads Segments by Physical Reads Segments by Row Lock Waits Segments by ITL Waits Segments by Buffer Busy Waits Back to Top Segments by Logical ReadsTotal Logical Reads: 127,310,179 Captured Segments account for 97.6% of Total OwnerTablespace NameObject NameSubobject NameObj. TypeLogical Reads%TotalSYSSYSTEMAUD$ TABLE36,662,99228.80GDASP_REV_DATAASP_REVENUE_TABLE TABLE25,567,42420.08GDGLODISTXXCM_CUST_LOC_REPUBLISH_I1 INDEX18,727,13614.71GDGLODISTGD_PART_COSTS TABLE5,821,8884.57GDGLODISTGD_EDI_POS_ITEMS TABLE5,397,2804.24 Back to Segment Statistics Back to Top Segments by Physical ReadsTotal Physical Reads: 79,905,605 Captured Segments account for 98.8% of Total OwnerTablespace NameObject NameSubobject NameObj. TypePhysical Reads%TotalSYSSYSTEMAUD$ TABLE36,115,79245.20GDASP_REV_DATAASP_REVENUE_TABLE TABLE23,531,99829.45GDGLODISTGD_EDI_POS_ITEMS TABLE5,356,3046.70GDGLODISTGD_MKTG_QUOTE_HEADERS TABLE3,650,9154.57GDGLODISTXXSUB_OPPORTUNITY_PROGRAM TABLE2,339,5512.93 Back to Segment Statistics Back to Top Segments by Row Lock Waits% of Capture shows % of row lock waits for each top segment compared with total row lock waits for all segments captured by the Snapshot OwnerTablespace NameObject NameSubobject NameObj. TypeRow Lock Waits% of CaptureGDGLODIST_INDEXDC_RULES_N1 INDEX1372.22GDGLODIST_INDEXPK_DH_DC_NO INDEX316.67GDGLODIST_INDEXPK_DL_LINE_ID INDEX15.56GDGLODISTXXSUB_QUOTE_I2 INDEX15.56 Back to Segment Statistics Back to Top Segments by ITL WaitsNo data exists for this section of the report. Back to Segment Statistics Back to TopSegments by Buffer Busy Waits% of Capture shows % of Buffer Busy Waits for each top segment compared with total Buffer Busy Waits for all segments captured by the Snapshot OwnerTablespace NameObject NameSubobject NameObj. TypeBuffer Busy Waits% of CaptureSYSSYSTEMSEQ$ TABLE1453.85SYSSYSTEMAUD$ TABLE934.62SYSSYSTEMI_AUD1 INDEX27.69GDGLODISTXXSUB_ITEM TABLE13.85 Back to Segment Statistics Back to Top Dictionary Cache Stats"Pct Misses" should be very low ( 2% in most cases) "Final Usage" is the number of cache entries being used CacheGet RequestsPct MissScan ReqsPct MissMod ReqsFinal Usagedc_awr_control6490.000 201dc_database_links2,8980.000 05dc_files24,6400.000 056dc_global_oids2,7450.000 023dc_histogram_data55,8801.440 06,436dc_histogram_defs21,1381.890 04,292dc_object_grants6,8010.000 0129dc_object_ids30,6450.230 01,340dc_objects9,5070.970 01,157dc_profiles1,3660.000 02dc_rollback_segments4,1020.000 019dc_segments7,4091.130 361,191dc_sequences5,2950.020 5,29533dc_table_scns890.000 28dc_tablespace_quotas10.000 12dc_tablespaces37,9660.000 015dc_usernames7,2860.000 035dc_users157,5490.000 084outstanding_alerts1,6800.000 026 Back to Top Library Cache Activity"Pct Misses" should be very low NamespaceGet RequestsPct MissPin RequestsPct MissReloadsInvali- dationsBODY3,0090.0013,4130.0000CLUSTER70.00120.0000INDEX80.00780.0000SQL AREA31,8679.09920,6800.517311TABLE/PROCEDURE1,9711.67136,0770.211530TRIGGER254.005,6300.0410Back to TopMemory Statistics Process Memory Summary SGA Memory Summary SGA breakdown difference Back to Top Process Memory SummaryB: Begin snap E: End snap All rows below contain absolute values (i.e. not diffed over the interval) Max Alloc is Maximum PGA Allocation size at snapshot time Hist Max Alloc is the Historical Max Allocation for still-connected processes ordered by Begin/End snapshot, Alloc (MB) desc CategoryAlloc (MB)Used (MB)Avg Alloc (MB)Std Dev Alloc (MB)Max Alloc (MB)Hist Max Alloc (MB)Num ProcNum AllocBOther114.46 1.914.6122306060 Freeable21.560.000.770.613 2828 SQL3.011.560.060.04095142 PL/SQL1.760.880.030.02006052EOther122.39 1.754.2822307070 Freeable19.940.000.800.673 2525 SQL3.371.750.060.040496152 PL/SQL2.211.130.030.02007062 Back to Memory Statistics Back to Top SGA Memory SummarySGA regionsBegin Size (Bytes)End Size (Bytes) (if different)Database Buffers234,881,024 Fixed Size2,142,568 Redo Buffers2,162,688 Variable Size599,674,520 Back to Memory Statistics Back to TopSGA breakdown differenceordered by Pool, Name N/A value for Begin MB or End MB indicates the size of that Pool/Name was insignificant, or zero in that snapshot PoolNameBegin MBEnd MB% Diffjavafree memory152.00152.000.00largePX msg pool1.031.030.00largefree memory14.9714.970.00sharedASH buffers15.5015.500.00sharedCCursor14.9418.5724.24sharedHeap0: KGL2.882.88-0.04sharedKCB Table Scan Buffer3.803.800.00sharedKGLS heap5.655.680.51sharedKQR M PO3.483.490.24sharedKSFD SGA I/O b3.793.790.00sharedKTI-UNDO3.223.220.00sharedPCursor7.9312.7961.21sharedPL/SQL DIANA 3.41 sharedPL/SQL MPCODE3.813.922.90sharedevent statistics per sess3.943.940.00sharedfree memory73.5632.39-55.97sharedkglsim hash table bkts4.004.000.00sharedlibrary cache13.7414.394.72sharedrow cache7.167.160.00sharedsql area69.2698.4942.21streamsfree memory100.00100.000.00 buffer_cache224.00224.000.00 fixed_sga2.042.040.00 log_buffer2.062.060.00 Back to Memory Statistics Back to Top Streams Statistics Streams CPU/IO Usage Streams Capture Streams Apply Buffered Queues Buffered Subscribers Rule Set Back to Top Streams CPU/IO UsageStreams processes ordered by CPU usage CPU and I/O Time in micro seconds Session TypeCPU TimeUser I/O TimeSys I/O TimeQMON Coordinator579,72600QMON Slaves477,70700 Back to Streams Statistics Back to Top Streams CaptureNo data exists for this section of the report. Back to Streams Statistics Back to TopStreams ApplyNo data exists for this section of the report. Back to Streams Statistics Back to TopBuffered QueuesNo data exists for this section of the report. Back to Streams Statistics Back to TopBuffered SubscribersNo data exists for this section of the report. Back to Streams Statistics Back to TopRule SetRule Sets ordered by Evaluations Ruleset NameEvalsFast EvalsSQL ExecsCPU TimeElapsed TimeSYS.ALERT_QUE_R00000Back to Streams Statistics Back to TopResource Limit StatsNo data exists for this section of the report. Back to Topinit.ora ParametersParameter NameBegin valueEnd value (if different)_shared_pool_reserved_min_alloc10000000 aq_tm_processes1 audit_file_dest/db/oralog/glodist audit_trailDB background_dump_dest/db/oralog/glodist compatible10.2.0.4 control_files/db/oractrl01/glodist/CONTROL01.ctl, /db/oractrl02/glodist/CONTROL02.ctl core_dump_dest/db/oralog/glodist db_block_size8192 db_cache_size159383552 db_file_multiblock_read_count32 db_files200 db_nameglodist dml_locks1000 fast_start_mttr_target300 global_namesFALSE java_pool_size159383552 job_queue_processes4 large_pool_size16777216 log_archive_dest/db/oraarch/glodist/arch_ log_archive_format%t_%s_%r.ARC log_buffer2097152 max_dump_file_size10240 nls_date_formatDD-MON-RR HH24:MI:SS open_cursors300 os_authent_prefix parallel_max_servers24 parallel_min_servers8 pga_aggregate_target209715200 processes400 query_rewrite_enabledTRUE query_rewrite_integrityTRUSTED remote_os_authentTRUE resource_manager_planXRO_PLAN session_max_open_files50 sga_target838860800 shared_pool_size314572800 streams_pool_size104857600 timed_statisticsTRUE undo_managementAUTO undo_retention7200 undo_tablespaceUNDOTBS user_dump_dest/db/oralog/glodist utl_file_dir/tmp Back to TopEnd of Report Thanks,jayraj

  • RELEVANCY SCORE 2.65

    DB:2.65:Fuzzy Lookup - Similarity Score = 1.0 (Column Level) When Comparing To Blank Fields pp


    As the title says, I get similarity = 1.0 when comparing two blank columns. Yes, they are identical (both are blank), but I would like the similarity score to be 0 instead of 1. Anyone know how to get around this ?dakine

    DB:2.65:Fuzzy Lookup - Similarity Score = 1.0 (Column Level) When Comparing To Blank Fields pp

    You should be able to achieve this behavior by using the DerivedColumn transformation on the FL output.

  • RELEVANCY SCORE 2.65

    DB:2.65:Joining Two Tables With The Same Column Names aa


    I have columns (acctno,opendate,matdate) in the table missbco and i have columns ( acctno,transdate,mnthcnt,remarks) in the table misled. I need to get distinct acctno from missbco comparing with the acctno of misled table with transdate greater than matdate

    DB:2.65:Joining Two Tables With The Same Column Names aa

    sorry ,untested
    SELECT DISTINCT missbco.acctno FROM missbco JOIN misled
    ON missbco.acctno =misled .acctno
    WHERE transdate matdateBest Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/

  • RELEVANCY SCORE 2.65

    DB:2.65:Comparing Names In Columns j1


    I have two columns of names. How do I in a 3rd column see what names are missing? I want to see what names are in Column A that are not in Column B and then I want to run it the other way B to A.
    Thanks
    Cheyenne

  • RELEVANCY SCORE 2.65

    DB:2.65:How To Use Case Properly c7


    hi,
    " rachmat i did try your solution it didn't work out. Its giving me more records"

    I am using two tables named GL_OB (For Opening balance) and GL_Club (For every Transaction details)
    TABLE
    GL_OB(
    GL_DATE DATE NOT NULL,
    ACCOUNTNO VARCHAR2(14) NOT NULL,
    OPENING_BAL NUMBER(15,2) DEFAULT 0,
    GEN_DT DATE NOT NULL,
    CONSTRAINT PK_GLOB PRIMARY KEY (ACCOUNTNO,GL_DATE,GEN_DT)

    TABLE
    GL_CLUB(
    GL_DATE DATE,
    VOUCHER_NO VARCHAR2(5),
    ACCOUNTNO VARCHAR2(14) NOT NULL,
    BR_BANK VARCHAR2(4),
    DESCRIPTION VARCHAR2(35),
    EMP_CODE VARCHAR2(6),
    CR_AMT NUMBER(15,2),
    DR_AMT NUMBER(15,2))

    Chart of Account code with 14 character and 9 character

    Chart of account-(14 characters w/o any space in between) 800 15 44 12 40 221

    First 3 character represents -ContraCode(800)
    4th 5th Character Represents-Division code(15)
    6th 7th Characters Represents-section code(44)
    8th 9th characters represents- Activity code(12)
    10th 11th characters represents -station code(40)
    12th to 14 th character represents Account code(221)

    * 14 character chart of account will always start either with '7','8' or '9' character only

    9 character chart of account(W/O ANY SPACE IN BETWEEN)- 205 30 15 45

    First three characters represents -Account code(205)
    4rd 5th character represents -Division code(30)
    6th 7th character represents -section code(15)
    8th 9th character represents -station code(45)

    In 9 character chart of account Account is in First three character where as in 14 character chart of accounts account code is in 12th to 14 th characters.

    In 9 character chart of account station is at 8th 9th position
    where as in 14 character chart of accounts it is at 10th 11th position.

    I need a query which gives all detail records based on opening Balance which is against either account code and (division code or station code)
    I have written query which is not giving me all records, i am having problem with accountno starting with other than '7','8','9' where the opening balance is against accountcode and (division or station code)

    1)For example 3rd record in GL_OB has opening balance against '205' accountcode and '55' division' rest of the characters are 'zero' , now against this accountcode and division i need all the details data from GL_CLUB with same acount code ie '205' and division '55' rest of the characters can be anything it can have any section or station but i need to get the detail records based on account code and division from GL_CLUB. ie 1st record from GL_CLUB as given below

    2)Now taking 2nd record in GL_OB ie 205000000 accountno In this case I need all the records based on account code '205' ie i need to get 2nd ,3rd, 4th record from GL_Club
    3)Now taking 5th record of GL_OB ie 340000020 which has opening balance of 50000 against account code '340' and station as '20', In this case i need only the 5th record of GL_CLUB

    GL_OB Table Data (sample)
    gl_date gen_dt accountno opening_bal
    -------------------------------------------------------------------------------------
    02/06/2005 01/04/2005 000000000 200000
    23/07/2005 01/04/2005 205000000 600000
    22/06/2005 01/04/2005 205550000 400000
    30/07/2005 01/04/2005 340000000 300000
    23/07/2005 01/04/2005 340000020 500000
    03/05/2005 01/04/2005 70000000000000 100000
    12/05/2005 01/04/2005 70000000000346 200000
    04/05/2005 01/04/2005 77000000000112 300000
    20/04/2005 01/04/2005 80000000000000 500000
    03/04/2005 01/04/2005 80000000000210 200000
    22/05/2005 01/04/2005 87000000000345 400000
    30/05/2005 01/04/2005 90000000000245 700000
    02/05/2005 01/04/2005 90044000000000 800000

    GL_CLUB DATA (Sample)
    gl_date gen_dt accountno cramt dramt
    ------------------------------------------------------------------------------------------
    07/06/2005 01/04/2005 205551200 20000
    08/06/2005 01/04/2005 205662300 3000
    09/06/2005 01/04/2005 205771700 10000
    12/06/2005 01/04/2005 205000020 40000
    22/07/2005 01/04/2005 340000020 50000
    23/07/2005 01/04/2005 340221700 40000
    11/07/2005 01/04/2005 340001230 50000
    12/08/2005 01/04/2005 77022330020112 4000
    20/08/2005 01/04/2005 70032120030346 20000
    30/06/2005 01/04/2005 70043540020231 20000

    I have written query which is not retriveing all records
    (select
    go.gen_dt,gc.gl_date,
    gc.accountno,
    substr(go.accountno,4,2) div,
    substr(go.accountno,6,2) sec ,
    substr(go.accountno,4,2)||'/'||substr(go.accountno,6,2) divsec ,
    case when substr(go.accountno,1,1) in ('7','8')then
    substr(go.accountno,10,2) else
    substr(go.accountno,8,2) end stn,
    ( case when substr(go.accountno,1,1) in ('7','8') then
    substr(go.accountno,1,3) ||'/'||substr(go.accountno,4,4)||'/'||
    substr(go.accountno,12,3)
    else
    substr(go.accountno,1,3)||'/'||substr(go.accountno,4,4)||'/'||
    substr(go.accountno,8,2) end ) accno,
    (go.opening_bal) ,
    gc.voucher_no,
    gc.tr_code,
    ltrim(gc.sh_desc)shdesc,
    nvl(gc.cr_amt,0) CRAMT,
    nvl(gc.dr_amt,0) DRAMT,
    gc.emp_code_or_csrvno
    from
    gl_ob go,glclub gc

    WHERE

    (to_date(gc.gen_dt,'dd/mm/rrrr') between
    to_date('01/04/2005','dd/mm/rrrr') and
    to_date('31/03/2006','dd/mm/rrrr'))
    and
    (to_date(go.gen_dt,'dd/mm/rrrr') between
    to_date('01/04/2005','dd/mm/rrrr') and
    to_date('31/03/2006','dd/mm/rrrr'))

    and

    ( case when substr(go.accountno,1,1) in ('7','8') then
    substr(go.accountno,1,3)||substr(go.accountno,12,3)
    else
    substr(go.accountno,1,3)
    end
    )
    =
    ( case when substr(gc.accountno,1,1) in ('7','8') then

    substr(gc.accountno,1,3)||substr(rpad(gc.accountno,14,0),12,3)
    else
    substr(gc.accountno,1,3)
    end
    )

    and
    ( case when substr(go.accountno,1,1) in ('7','8') then
    substr(rpad(go.accountno,14,0),12,3)
    when substr(go.accountno,1,1) in ('9')then
    ( case when substr(go.accountno,8,2) not in ('00') then
    substr(go.accountno,8,2)
    else
    ( case when substr(go.accountno,1,3) not in ( select
    substr(accountno,1,3) from v_gl_ob group by substr(accountno,1,3) having count(*) 1) then (substr(go.accountno,1,3)||00000000000)
    else
    ( case when substr(rpad(go.accountno,14,0),8,2) '00' then substr(rpad(go.accountno,14,0),8,2) else
    (substr(go.accountno,1,3)||substr(go.accountno,8,2)) end ) end ) end )
    else
    ( case when substr(go.accountno,4,2) not in ('00') then
    substr(rpad(go.accountno,14,0),4,2)
    when substr(go.accountno,8,2) not in ('00') then
    substr(rpad(go.accountno,14,0),8,2)
    else
    ( case when substr(go.accountno,1,3) not in ( select
    substr(accountno,1,3) from v_gl_ob group by substr(accountno,1,3) having
    count(*) 1) then (substr(go.accountno,1,3)||00000000000)
    else
    ( case when substr(go.accountno,4,2) '00' then
    substr(rpad(go.accountno,14,0),4,2) when substr(rpad(go.accountno,14,0),8,2) '00' then
    substr(rpad(go.accountno,14,0),8,2) else (substr(go.accountno,1,5)||substr(go.accountno,8,2)) end ) end ) end )
    end)
    = (case when substr(go.accountno,1,1) in ('7','8')then
    substr(rpad(gc.accountno,14,0),12,3)
    when substr(go.accountno,1,1) in ('9')then
    ( case when substr(rpad(go.accountno,14,0),8,2) not in ('00') then
    substr(rpad(gc.accountno,14,0),8,2) else ( case when substr(go.accountno,1,3) not in ( select substr(accountno,1,3) from v_gl_ob group by substr(accountno,1,3) having count(*) 1)
    then (substr(gc.accountno,1,3)||00000000000) else
    ( case when
    substr(rpad(go.accountno,14,0),8,2) '00' then substr(rpad (gc.accountno,14,0),8,2) else
    (substr(gc.accountno,1,3)||substr(gc.accountno,8,2)) end ) end ) end )
    else
    (case when substr(rpad(go.accountno,14,0),4,2) not in
    ('00') then substr(rpad(gc.accountno,14,0),4,2) when substr(rpad(go.accountno,14,0),8,2) not in ('00') then
    substr(rpad(gc.accountno,14,0),8,2) else ( case when substr(go.accountno,1,3) not in ( select
    substr(accountno,1,3) from v_gl_ob group by substr(accountno,1,3) having
    count(*) 1) then
    (substr(gc.accountno,1,3)||00000000000) else ( case when
    substr(rpad(go.accountno,14,0),4,2) '00' then substr(rpad(gc.accountno,14,0),4,2) when substr(rpad(go.accountno,14,0),8,2) '00' then substr(rpad(gc.accountno,14,0),8,2)else
    (substr(gc.accountno,1,5)||substr(gc.accountno,8,2)) end )end ) end )end ))
    order by 8,
    gc.tr_code,go.gen_dt,gc.gl_date;

    In the above query i am having problem when the accountno starts with other than '7','8','9' and when the opening balance is against accountcode ie first three characters rest all are 'zero' In this case if i am making comparasion with first three characters in club then it includes the accountno with divisionno also which i shouldn't get.
    Do not concentrate on select columns just go through where clause, i need to refine my case so that it includes all records.
    If you have any further doubts do reply to this.

    As i said earlier i am having problem with Chartof Accounts starting with Other than '7','8','9'.series
    The opening balance is given against either ( account code divisionno )
    or (account code station code). It will be any one of them it can't have opening balance against 3 (account code,station code divisionno)
    so my problem is if the opening balance is against division no then against that i can get the Transaction Records from GL_CLUB similarlly if the opening balance is against station code i can get the Transaction records from GL_CLUB. But when opening balance is against "Account code only" rest all characters are 'zero'
    for example
    202-00-00-00-00000
    202-33-00-00-00000
    202-00-00-42-00000

    based on 2nd record above i can get the detail records from detail tables by selecting Account code '202' and division no '33' rest of the character can be anything in detail table.
    Similarly i can get detail records for 3 rd record above ie '202' account code and '42' station code.
    but when i go for first record since there is only account code ie '202' so if i write my query as substr(go.accountno,1,3)=substr(gc.accountno,1,3)
    its including the records with station code '42' and division no ''33'
    actually i should get only those records with account code '202' and any record other than station code '41' and division no '33' .

    The opening balance can be giiven only against (account code and division no) or (account code and station code) In '200' series if the opening balance is against 'station code' in other series may be '500' series it can be against 'division no'
    I have written query for the above in series not starting with "7','8','9'
    I really appreciate i you can help me out.

    Thanks
    Ram

    DB:2.65:How To Use Case Properly c7

    Hi Ram,
    why not to create 2 views on the tables like (table Gl_Ob):

    CREATE OR REPLACE VIEW My_View
    AS
    SELECT
    DECODE(LENGHT(AccountNo), 9, TO_CHAR(NULL), SUBSTR(AccountNo, 1, 3)) Contra
    , SUBSTR(AccountNo, 4, 2) Division
    , SUBSTR(AccountNo, 6, 2) Section
    , DECODE(LENGHT(AccountNo), 9, TO_CHAR(NULL), SUBSTR(AccountNo, 8, 2)) Activity
    , DECODE(LENGHT(AccountNo), 9, SUBSTR(AccountNo, 8, 2), SUBSTR(AccountNo, 10, 2)) Station
    , DECODE(LENGHT(AccountNo), 9, SUBSTR(AccountNo, 1, 3), SUBSTR(AccountNo, 12, 3)) Account
    , Gl_Date
    , Gen_Dt
    , Openng_Bal
    FROM Gl_Ob
    /

    Instead You can use that as an Online view but anyway I think is more readable ....

    Anyway, why using COBOL format in a field :)) ?

    Hope this helps

    Max

  • RELEVANCY SCORE 2.65

    DB:2.65:Re: Concatinating The Values Of Two Columns ??? af


    Can anyone help me out in concatenating the values of two columns ??SQL select 'Hello ' || 'user642297' sweet_prog from dual;

    SWEET_PROG
    ----------------
    Hello user642297Please ASAP...:(

    Regards,

    Christopher Simons

  • RELEVANCY SCORE 2.65

    DB:2.65:Need Help Comparing Two Fields In An Expression s3


    I have a dataset that contains two columns with delivery date information. One has the scheduled delivery date, the other has the actual delivery date. I want to write an expression that will give me the percentage of shipments that arrived on
    time by comparing those two columns, but expression writing in VS seems very limited and can't have the obvious solution. Can someone point me in the right direction for accomplishing this?

    It seems like this should work, but it doesn't:

    Count(IIF(Fields!delivered_date Fields!est_delivery, 1, Nothing))

    DB:2.65:Need Help Comparing Two Fields In An Expression s3

    Hi meef,
    To achieve something similar we used
    Count( IIF(CDATE(
    Fields!delivered_date.Value) CDATE( Fields!est_delivery.Value), 1, 0))
    in another hidden column then used the total of that column to work out some statitstics.
    Hope this helps,
    Mike

  • RELEVANCY SCORE 2.65

    DB:2.65:Difference Between Two Time Values 3s


    Hi,

    I am using an oracle 8.0.4 DB on Winnt. I have a problem in one of the tables I have two fields which takes in time Values. But the Datatype specified at the time of creation was varchar2(4). Now the problem is how do I find the Time interval difference between the two fields. The data in the fields look like 0000 for 00:00, 1800 for 18:00 and so on. I tried using the substring func and tried creating an value which resembled a time value. But When I tried to find the difference it gave the following error.

    ORA-01843: not a valid month

    The query I used was

    select to_date((substr(atd_a,1,2)||':'||substr(atd_a,3,2)),'HH24:MM:SS')-to_date((substr(etd_a,1,2)||':'||substr(etd_a,3,2)),'HH24:MM:SS') from table.

    Can anyone please help me out.
    Thanks in advance.
    Regards
    Dinesh

    DB:2.65:Difference Between Two Time Values 3s

    Kevin,
    Thanks a lot for ur help in pointing out where I went wrong.
    Regards
    Dinesh

  • RELEVANCY SCORE 2.65

    DB:2.65:Virtual Column Based Partitioning m3


    Hi,

    we have a non-partitioned table in a production database and wish to partition it based on an expression. Since we are on 11.2 the first thing that comes to mind is virtual column based partitioning. The "problem" is that in order to partition by a virtual column, you have to create one, and adding a new column to a table could break any application that doesn't reference the existing columns by name, e.g. "SELECT *" or. "INSERT INTO table VALUES(....)".

    My question is: is it possible to somehow specify the expression on which to partition directly in the "partition by" clause rather than specifying it as a virtual column definition?

    Example:

    Instead of this..
    SQL create table test (
    2 id number not null,
    3 content varchar2(10),
    4 record_type varchar2(1) generated always as (case when (substr(content, 1, 1)='B' and not substr(content, 1, 3)='Bxy') then 'B' else 'A' end) virtual
    5 )
    6 partition by list(record_type)
    7 (
    8 partition partA values ('A'),
    9 partition partB values ('B')
    10 );

    Table created...I'd like to use something like this:
    SQL create table test (
    2 id number not null,
    3 content varchar2(10)
    4 )
    5 partition by list((case when (substr(content, 1, 1)='B' and not substr(content, 1, 3)='Bxy') then 'B' else 'A' end))
    6 (
    7 partition partA values ('A'),
    8 partition partB values ('B')
    9 );
    partition by list((case when (substr(content, 1, 1)='B' and not substr(content, 1, 3)='Bxy') then 'B' else 'A' end))
    *
    ERROR at line 5:
    ORA-00904: : invalid identifierThank you in advance for any answers.

    Regards,
    Jure

    DB:2.65:Virtual Column Based Partitioning m3

    Thanks for the answer Justin.

    I think that creating a view is a good idea, I'll try it.

    You could easily create more performance problems by partitioning a table in that case.The table in question is a log table and I'm implementing partitioning for facilitating data purging/archival. For now I don't expect any performance benefits (i.e. partition pruning) from partitioning since the queries that are currently run against that table rarely reference the partitioning key in the WHERE clause. However, some of them could be modified to achieve that, but that's currently not the primary goal.

    Regards,
    Jure

  • RELEVANCY SCORE 2.64

    DB:2.64:Bulk Update With Substr az


    hi, i have two tables to compare and insert data statment is

    ------------------------------

    UPDATE table_a a set (a,b) = (SELECT 1 FROM table_b b
    WHERE a.b =substr(b.col , 1,3)
    and a.c = substr(b.col,4,5)
    and a.d = substr(b.col,6,7)
    )

    ------------------------------

    the columns c,d is null in table_a and the substr values also return nul from table_b

    but no rows is updating...

    Please advise.

    DB:2.64:Bulk Update With Substr az

    Thanks for you replies.

    i made a procedure for that.

    PROCEDURE local_null_handle(p_datatype varchar2,p_fstart out varchar2 , p_fend out varchar2) IS
    --generate NVL based on datatype for : varchar2,date,number
    v_f1 varchar2(30); v_f2 varchar2(30);
    v_dt date := to_date('01-jan-0001','dd-mm-yyyy');
    BEGIN
    IF UPPER(p_datatype) LIKE 'VARCHAR2%' THEN
    v_f1 := 'NVL(';
    v_f2 := ',' || '''~''' || ')';
    ELSIF UPPER(p_datatype) LIKE 'DATE%' THEN
    v_f1 := 'NVL(';
    v_f2 := ',''' ||v_dt|| ''')';
    ELSIF UPPER(p_datatype) LIKE 'NUMBER%' THEN
    v_f1 := 'NVL(';
    v_f2 := ',0)';
    END IF;

    p_fstart := v_f1;
    p_fend := v_f2;
    END;

  • RELEVANCY SCORE 2.64

    DB:2.64:Sql Query 3f


    Hi

    My requirement is below

    I am executing this query

    SELECT A.SWITCH_MODEL_DESC,SUBSTR(A.SWITCH_MODEL_DESC, 76, 2),LENGTH(SUBSTR(A.SWITCH_MODEL_DESC, 76, 2)) FROM M08_NT_UV_SWITCH_MODEL_TBL Athe o/p shows

    SWITCH_MODEL_DESC SUBSTR(A.SWITCH_MODEL_DESC,76,2)LENGTH(SUBSTR(A.SWITCH_MODEL_DESC,76,2))

    ILEC FRAME TO PIP ETN ET 2
    LEC ETHERNET - CPA OFFNET TYPE2 / TYPE4 ETN ET 2
    IP CONVERGED CONTACT CENTER S N S 2Why I am getting length of this char S is 2. It should be 1 rite.
    and also
    if the column length has more than 1 char, separate them by a *|* delimiter. i.e in the above case i wnt to insert delimiter for the two values E|T

    DB:2.64:Sql Query 3f

    There might be different reasons for returning length as 2.

    you might have some spaces after / before 'S', actually you asked to retrieve 2 characters from substring.

    if you want to single character trim out side the substr., to eliminate spaces.

    SELECT A.SWITCH_MODEL_DESC,SUBSTR(A.SWITCH_MODEL_DESC, 76, 1)||'|'||SUBSTR(A.SWITCH_MODEL_DESC, 77, 1) , LENGTH(trim(SUBSTR(A.SWITCH_MODEL_DESC, 76, 2))) FROM M08_NT_UV_SWITCH_MODEL_TBL A

    you can trim '|' if that is single character.

  • RELEVANCY SCORE 2.64

    DB:2.64:Comparing Text Between Two Columns df


    My mind is blank and I can't figure out the syntax.

    In Column A I have email addresses, I have copied in Column B another set of email addresses

    I am looking for a simple formula to say, the text in colmun A is the same as column B.

    If (A1=B1,"true","CorrectEmail")

    But what sytax would I use to get this result in Column C?

    DB:2.64:Comparing Text Between Two Columns df

    Hi,

    If the order of matching e-mail addresses is not the same, then you will have to try this formula in cell C1

    =IF(COUNTIF($B$2:$B$50,A1)0,"OK","Correct mail")

    Hope this helps.

  • RELEVANCY SCORE 2.63

    DB:2.63:Finding Columns With Only Null As Values c3


    I have a list of tables around 30 in number. Among them i need to generate a report with Table Name and Column Names, for which all values are NULL.
    In other words, i need to find all the columns for which all the values are NULL.

    I thought of dealing it with cursors, and comparing the total count with null count in each column. But i need to loop "Number of columns" times. Is there any better way to do this?

  • RELEVANCY SCORE 2.63

    DB:2.63:Comparing Rowcounts Of Two Tables 3j


    I am trying to write a procedure that will compare the rowcounts in two tables. The situation is we have two sets of tables named 'Txxxx' and 'Hxxxx'. A table such as T153 should have the same number of rows as H153. I want to write a procedure that lists all the tables and their row counts in pairs. I am able to retrieve all the matched pairs but am stuck on how to derive the row count dynamically once I have retrieved the data. For a start I have:
    declare
    tab1 dba_tables.table_name%type;
    tab2 dba_tables.table_name%type;
    cursor tab_cursor is
    select a.table_name, b.table_name from
    dba_tables a, dba_tables b where
    substr(a.table_name,1,1) = 'T'
    and
    substr(b.table_name,1,1) = 'H'
    and
    substr(a.table_name,2,3) = substr(b.table_name,2,3);
    begin
    open tab_cursor;
    fetch tab_cursor into tab1, tab2;
    while tab_cursor%found loop
    dbms_output.put_line(tab1 || ' ' ||tab2);
    fetch tab_cursor into tab1,tab2;
    end loop;
    close tab_cursor;
    end;
    /

    DB:2.63:Comparing Rowcounts Of Two Tables 3j

    thanks and thanks for making it so simple.... i need to study up on dynamic sql.

  • RELEVANCY SCORE 2.63

    DB:2.63:Array Processing In Hana 8c


    Hi all,I am using release 64 HANA SPS 6. I have a question on how to compare array elements. Here is what I have so far:1) Used array_agg to get two columns of a table2) I iterate over those, and compare values in Column A to Column B IF :a[:i] = :b[:i] then .... END IF.However, I get an error saying array A comparison with array B is not supported. (note that both are NVARCHAR(12) arrays)3) I tried to assign the values to two scalars, so as to compare the scalars thereafter, but converting ONE value in an array to a scalar is not supported either. Any pointers on how to go about comparing values in arrays ? Does anyone have a working example of array processing ? (beyond just "array_agg" and "unnest" ? )Regards,Andy Anand

    DB:2.63:Array Processing In Hana 8c

    I think I can answer this myself - I've just noticed that even though the editor shows a red X error at that line, the procedure DOES actually compile ok and can be executed.

  • RELEVANCY SCORE 2.63

    DB:2.63:Comparing Two Sheets sm


    guys,
    i have two sheets. sheet 1 has 400 names with three columns and sheet two has 3500 names with 10 columns. if the names on 1 is on sheet 2 then the entire row on sheet 2extracts to sheet 3. is this possible?

    DB:2.63:Comparing Two Sheets sm

    Hi,

    Please clarify the data layout. Are the 400 names in sheet1, in any one column of sheet1 or are they in all three columns? Same question for sheet 2 as well

  • RELEVANCY SCORE 2.63

    DB:2.63:Comparing 2 Array z1


    Hi,I have two arrays. I want check the new one with the old and remain the new values delete the rest...Any routin help?TIA

    DB:2.63:Comparing 2 Array z1

    Hi Volvo,This is what I understood your problem to be:You have two arrays, Array Old and Array New - make an array containing the elements that exist only in Array New and not Array Old. If this is the problem you are having, I have included a VI to implement this. It goes through each element in Array New, and searches this element in Array Old. If it does not exist in Array Old, then add the element to a new array (I have called this new array New Entries in the VIs). I recommend you look at the non-memory efficient implementation, as it is more easier to read. I have also included a memory efficient version of the solution to avoid a build array in a loop, this can be useful if you are dealing with larger array sizes (hundreds of thousands++, depending on your pc memory).Good luck!









    Attachments:







    Compare_two_arrays_and_keep_ones_in_second_array_only.vi ‏27 KB

  • RELEVANCY SCORE 2.63

    DB:2.63:Ora-06550 Error ks


    Hi there,

    I have written this code which I have had working with a smaller amount of data. The idea is that this can read a text file and then insert the data into a tablespace that has already been created. The issue is that I get an error and I can't find the problem. I have posted the code and the error. If anyone can fix this I will be forever grateful.
    Cheers

    DECLARE

    fh UTL_FILE.FILE_TYPE; -- file handle to input file
    input_line VARCHAR2(4000); -- line from input file
    begin_time DATE; -- Time load began
    end_time DATE; -- Time load ended
    total_rows NUMBER:=0; -- Total rows processed

    -- Variables for column contents
    CLIENT_ID_IN VARCHAR2(30);
    CLIENT_IN VARCHAR2(30);
    ABN_IN VARCHAR2(30);
    PRIMARY_CONTACT_IN VARCHAR2(30);
    PRIMARY_EMAIL_IN VARCHAR2(30);
    PRIMARY_TEL_IN VARCHAR2(30);
    PRIMARY_IN VARCHAR2(30);
    COMMERCIAL_CONTACT_IN VARCHAR2(30);
    COMMERCIAL EMAIL_IN VARCHAR2(30);
    COMMERCIAL_TEL_IN VARCHAR2(30);
    TECHNICAL_CONTACT_IN VARCHAR2(30);
    TECH_EMAIL_IN VARCHAR2(30);
    TECH_TEL_IN VARCHAR2(30);
    OPT_OUT_REQUESTS_IN VARCHAR2(30);
    OPT_OUT_EMAIL_IN VARCHAR2(30);
    ADDRESS_LINE_1_IN VARCHAR2(30);
    ADDRESS_LINE_2_IN VARCHAR2(30);
    ADDRESS_LINE_3_IN VARCHAR2(30);
    STATE_IN VARCHAR2(30);
    POSTCODE_IN VARCHAR2(30);
    TEL_IN VARCHAR2(30);
    WEB_IN VARCHAR2(30);
    CS_DROPBOX_IN VARCHAR2(30);
    CS_TEL_IN VARCHAR2(30);

    BEGIN

    -- Open the input file for reading

    fh:=UTL_FILE.FOPEN('DIR_TEMP','clientstest.txt','r');
    DELETE FROM NET_CLIENT;
    COMMIT;

    -- Get beginning time
    begin_time := SYSDATE;

    -- Loop through file, read one line at a time, and insert
    -- into the database table.
    LOOP
    -- Get input line
    BEGIN
    UTL_FILE.GET_LINE(fh,input_line);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN EXIT;
    END;

    total_rows:= total_rows + 1;

    -- Parse line contents
    CLIENT_ID_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    CLIENT_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    ABN_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    PRIMARY_CONTACT_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    PRIMARY_EMAIL_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    PRIMARY_TEL_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    PRIMARY_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    COMMERCIAL_CONTACT_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    COMMERCIAL_EMAIL_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    COMMERCIAL_TEL_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    TECHNICAL_CONTACT_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    TECH_EMAIL_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    TECH_TEL_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    OPT_OUT_REQUESTS_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    OPT_OUT_EMAIL_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    ADDRESS_LINE_1_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    ADDRESS_LINE_2_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    ADDRESS_LINE_3_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    STATE_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    POSTCODE_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    TEL_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    WEB_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    CS_DROPBOX_IN:=SUBSTR(input_line,1,INSTR(input_line,',')-1);
    input_line:=SUBSTR(input_line,INSTR(input_line,',')+1);
    CS_TEL_IN:=input_line;

    -- Insert data into table without bind variables

    INSERT INTO NET_CLIENT

    NAMES
    (
    CLIENT_ID,
    ABN,
    CP_ACCOUNT_ID,
    BORIS_ACCESS_ORDER_ID,
    ACCESS_TYPE,
    SAP_CODE,
    USER_ID,
    ACCOUNT_EXEC_USER_ID,
    PHONE_NUMBER,
    ADDRESS_LINE_1,
    ADDRESS_LINE_2,
    ADDRESS_LINE_3,
    POSTCODE,
    AUS_STATE,
    EMAIL
    )

    VALUES
    (
    CLIENT_ID_IN,
    ABN_IN,
    CLIENT_IN,
    'BORIS123',
    'admin',
    'SAP123',
    1,
    1,
    TEL_IN,
    ADDRESS_LINE_1_IN,
    ADDRESS_LINE_2_IN,
    ADDRESS_LINE_3_IN,
    POSTCODE_IN,
    STATE_IN,
    PRIMARY_EMAIL_IN
    )
    ;

    END LOOP;
    COMMIT;

    -- Close input file
    UTL_FILE.FCLOSE(fh);

    END;
    /

    Error report:
    ORA-06550: line 18, column 22:
    PLS-00103: Encountered the symbol "VARCHAR2" when expecting one of the following:

    := . ( @ % ; not null range default character
    The symbol ":=" was substituted for "VARCHAR2" to continue.

    DB:2.63:Ora-06550 Error ks

    '_' missing in COMMERCIAL EMAIL_IN
    COMMERCIAL EMAIL_IN VARCHAR2(30);

  • RELEVANCY SCORE 2.63

    DB:2.63:Use Of Substr With Instr 9d


    Hi everybody,
    I have a for where I bring all the information from a .txt file combining substr with instr, but right now I'm only bringing 3 columns and I would like to bring 8 columns of the file. Is there a way to do it with these functions?
    Each column in the .txt file is divided by comma.
    This is what I have right now:
    :MY_DATABLOCK.ITEM1 := substr(Salida,1,instr(Salida,',',1,1)-1);
    :MY_DATABLACK.ITEM2 := substr(Salida,instr(Salida,',',1,1)+1,(instr(Salida,',',1,2)-instr(Salida,',',1,1))-1);
    :MY_DATABLOCK.ITEM3:= substr(Salida,instr(Salida,',',1,2)+1);

    Please help me!

    DB:2.63:Use Of Substr With Instr 9d

    Does the file exist on the Application Server or Database Server? If it is on the database server or it could be put on the database server, I would suggest using an Oracle External Table to read the data from the file into a "Table". Then you can base your form off of the external table just like any other table. If you are reading the file with TEXT_IO or with Webutil's CLIENT_TEXT_IO, then you will have to develop your own logic for parsing the string. You might consider using a LOOP to loop through the file instead of individual calls as you are doing.

    Another option would be to research the DBMS_UTILITY package and COMMA_TO_TABLE procedure. You could pass each line of the file to this procedure and it will return that line from the file parsed into a PL/SQL collection. This is a 9i database package so it may not work with any Forms version below Forms 10g.

    Hope this helps.
    Craig...

  • RELEVANCY SCORE 2.62

    DB:2.62:Substr Terminate After Delimiter?? jc


    I have values:
    12345-, 12345678-123
    I need to select only the string prior to the delimiter '-'.
    I understand the following:
    select translate (substr(col1,1), 'x-','x') from temp:
    result:
    12345, 12345678123.
    How do I get the additional string value 123 after the '-' out of the substr?

    DB:2.62:Substr Terminate After Delimiter?? jc

    As Nicolas said, the requirements are dubious, but if you are on 10g, you can try the following:

    SQL select * from test_sub;

    COL1
    --------------------
    12345-
    12345678-123

    SQL select regexp_replace(col1,'-.*') "Values" from test_sub;

    Values
    --------------------
    12345
    12345678For 9i and below:

    SQL select substr(col1,1,instr(col1,'-')-1) "Values" from test_sub;

    Values
    --------------------
    12345
    12345678Message was edited by:
    ebrian

    Message was edited by:
    ebrian

  • RELEVANCY SCORE 2.62

    DB:2.62:In Between Time Value zk


    Hi,

    I am working in oracle 8i. I am having two time columns. the column name is starttime and end time. in that i need a query to find the values between starttime and endtime comparing to another table having time data.

    its in HH24 format.

    Rgds....

    DB:2.62:In Between Time Value zk

    user537350 wrote:
    we need a query to fetch only the records having time between 04:00 and 12:00 ie) 09:00 not 18:00.Assuming the fields are defined as char.

    SELECT * FROM yourtable
    WHERE
    starttime ='04:00'
    and endtime = '12:00'SS

  • RELEVANCY SCORE 2.62

    DB:2.62:Comparing Data In Two Sets Of Two Columns And Automatically Inserting Matching Data Into A Third Set Of Two Columns as


    I want to compare the data in Column D and E with Column G and H. Only if the data is exactly match, i.e T, T to T, T as with row 1 or A, G to A, G with row 8 do I want T, T or A, G to show up in Column J and K, with the T, T or A, G showing up in the
    respective columns J and K. I have 700,000 rows of information so doing it by hand would take weeks. Please help!

    DB:2.62:Comparing Data In Two Sets Of Two Columns And Automatically Inserting Matching Data Into A Third Set Of Two Columns as

    You may also try this formula in cell J1, simply enter
    =IF($D1" "$E1=$G1" "$H1,D1,"") and drag it to right to cell K1 and then drag both cells to down.

  • RELEVANCY SCORE 2.62

    DB:2.62:Conditional Formatting - How Do I Highly Differences Between Two Columns Cell-To-Cell Comparison jd


    Please help! I am trying to highlight non-numeric differences between two columns using conditional formatting. This is a cell-to-cell/column-to-column comparison rather than comparing two lists. How do I use the COUNTIF argument or any other argument
    to highlight the cells that contain different values side-by-side?

  • RELEVANCY SCORE 2.62

    DB:2.62:Comparing Two Database Tables To All Find Matching Columns 3d


    Hi,
    is there any query to find matching columns from two database tables(not system tables).

    Thanks and regards, Rishabh

    DB:2.62:Comparing Two Database Tables To All Find Matching Columns 3d

    SELECT (a.Table_Schema '.' a.Table_Name '.' a.Column_Name) AS ATable, b.Table_Name '.' b.Table_Schema '.' b.Column_Name AS BTable
    FROM HFPROMMS_LIVE_22Jan.INFORMATION_SCHEMA.COLUMNS a
    INNER JOIN HFPROMMS_Training_23Dec.INFORMATION_SCHEMA.COLUMNS b ON b.Table_Name = a.Table_Name AND b.Table_Schema = a.Table_Schema AND a.Column_Name = b.Column_Name
    WHERE a.Table_Name = 'tblName'

    If you want o check twotables in same database;

    SELECT (a.Table_Schema + . + a.Table_Name + . + a.Column_Name) AS ATable, b.Table_Name + . + b.Table_Schema + . + b.Column_Name AS BTable
    FROM INFORMATION_SCHEMA.COLUMNS a
    INNER JOIN INFORMATION_SCHEMA.COLUMNS b ON b.Table_Name = a.Table_Name AND b.Table_Schema = a.Table_Schema AND a.Column_Name = b.Column_Name
    WHERE a.Table_Name = ATableName
    AND b.Table_Name = BTableName

  • RELEVANCY SCORE 2.61

    DB:2.61:Comparing Two Values To Get The Difference 7m



    Hello,

    I'm trying to compare two values in an expression and get the difference but I don't want a negative number. Is there anyway to formulate this WITHOUT an If statement???

    Example: I'm comparing The Book quantitiy of several items and the counted quantity. I want a new field that is the difference between the two and is always a positive number.

    DB:2.61:Comparing Two Values To Get The Difference 7m


    You can use the function fabs( ) to get the absolute value, always positive.

  • RELEVANCY SCORE 2.61

    DB:2.61:Comparing The Values Of The Cells Of Two Seperate Rows z8


    Hi

    I am trying to compare the values in two rows, just to make clear they are the same row from the same table on is in a TempTable just before the row is updated and the other from the updated row, what I am looking to do is to compare the values of the cells
    in the rows to see what has been updated in the row.

    select * into #myTemp from tUsers where UID = @UID
    select * from tUsers where UID = @UID

    CREATE TABLE dbo.tUserChanges
    (
    cID int IDENTITY (1,1),
    cChangeDate DateTime,
    cValueChanged varchar(30),
    cPreviousValue bit,
    cCurrentValue bit
    )

    So what I need to do is compare is columns cell value to the other tables values and insert in into the tUserChanges table when they are different

    Thanks your help will be appreciated

    DB:2.61:Comparing The Values Of The Cells Of Two Seperate Rows z8


    You can scan the table for comparing the rows like

    declare cur_decl … for

    select …;

    open cur_decl

    fetch next from cur_decl into …

    while @@fetch_status=0

    begin

    fetch next from cur_decl into …;

    // codes you compare the values of the current row with the previous row

    end

    close cur_decl

    deallocate cur_decl
    using a DB SP

    Many Thanks Best Regards, Hua Min

  • RELEVANCY SCORE 2.61

    DB:2.61:Equation To A Columns Of Values In Text File, Please Help sx



    i have applied an equation to column values of a text file, thr is two columns; for each 10 values i should get an output value, so a total of 5 values + 5 values for each of the two columns with 50 values.

    my vi doesnt wrk properly, the values are not coorect, and i get only 5 values instead of 10 (5 for each of the 2 columns with 50 values)

    i hv attached my vi, pls help.







    Solved!
    Go to Solution.

  • RELEVANCY SCORE 2.61

    DB:2.61:Is There An Easy Way To Compare Two Null Columns? 7m


    I need to compare a significant number of columns between records in two tables for a data conversion. I really need a comparison that will return true if: 1) both columns are null; or 2) both columns are not null and equal. I want it to return false if: 3) one column is null and the other is not; or 4) both columns are not null and are not equal. I am trying to find records which are not exact matches.

    I found documentation at oracle-base.com about the SYS_OP_MAP_NONNULL function that would do what I want, but I don't want to use this since it's an undocumented feature and my code will be in production for a period of time.

    I would rather not have to use a construct like this for each and every column I'm comparing:

    (
    (
    a.col is null
    and b.col is null
    )
    or (
    a.col = b.col
    )
    )Also, I know about the NVL function, but I'm comparing columns which are entered by users, and I'm not comfortable substituting any values for null because those values might actually exist in the data.

    DB:2.61:Is There An Easy Way To Compare Two Null Columns? 7m


    For what it's worth, I compared explain plans using both methods and they were 100% identical.

    Thanks for posting that result. That may clear up any doubt others may have had.

  • RELEVANCY SCORE 2.61

    DB:2.61:Procedure j9


    Hi all

    How to upload an excel data into Oracle table. I have a table with two columns. I have an example of performing the same with .txt. Can anyone help me out to do the same procedure from excel not from text file.

    My Example :
    Declare
    in_file Text_IO.File_Type;
    linebuf VARCHAR2 (80);
    v_empid number(2);
    v_ename varchar2(20);
    begin
    in_file := Text_IO.Fopen('D:\Raghava\Examples\sample.txt', 'r');
    LOOP
    Text_IO.Get_Line(in_file,linebuf);

    ---- cut the line based on the delimiter in the file let it be ','
    v_empid:=substr(linebuf,1,instr(linebuf,',',1)-1);
    v_ename:=substr(linebuf,instr(linebuf,',',1)+1,instr(linebuf,',',2)-1);
    insert into sss values (v_empid,v_ename);
    commit;
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    Message('No Data found...eof', 'sss');
    Text_IO.Fclose(in_file);
    end;

    Regards

    Joshi

    DB:2.61:Procedure j9

    Convert your .xls file to comma separated values (csv) file. Then you can proceed the same way as you did for the text file.

  • RELEVANCY SCORE 2.61

    DB:2.61:Comparing The Contents Of Two Tables 3s


    I would like to compare the data of two tables both of the tables has same number of columns as well data type.

    IS there anything i can query to get the mismatched data?

    thanks

    DB:2.61:Comparing The Contents Of Two Tables 3s

    Hi,

    take a look at http://www.oracle.com/technology/oramag/oracle/05-jan/o15asktom.html

    regards
    vlado

  • RELEVANCY SCORE 2.60

    DB:2.60:Delete Duplicates Seems To Delete The Line With Values! p7



    Hi there

    I am using the following 2 lines of code to omit duplicate lines from my data is there are more than 1 matnrs.

    sort part_data by matnr.

    delete ADJACENT DUPLICATES FROM part_data COMPARING matnr.

    The trouble is, this seems to stop 3 of my columns from displaying the values. Stock_days and stock_months both show as 0.

    If I used COMPARING ALL FIELDS instead, does this mean that the code would show lines with stock_days and stock_months if they have a value greater than zero but one line per each matnr.

    DB:2.60:Delete Duplicates Seems To Delete The Line With Values! p7


    You can use the following -

    sort itab.

    delete adjacent duplicates from itab comparing all fields.

    award me points if it helps.

    Thanks,

    Sheel

  • RELEVANCY SCORE 2.60

    DB:2.60:Defining View With Phantom Columns? 1z


    I found a way to create a view with phantom columns for my length, width, and height values but it still doesn't quite get what I want. This is the view definition:

    DROP VIEW Vendor_test_view;
    CREATE VIEW Vendor_test_view as
    Select
    VENDOR_TICKET_ITEMS.Item_Code,
    VENDOR_TICKET_ITEMS.Dimensional_Values,
    VENDOR_TICKET_ITEMS.Quantity,
    VENDOR_ITEMS.Unit_of_meas,
    substr(VENDOR_TICKET_ITEMS.Dimensional_Values, 1,10) as Length,
    substr(VENDOR_TICKET_ITEMS.Dimensional_Values, 11,20) as Width,
    substr(VENDOR_TICKET_ITEMS.Dimensional_Values, 21,30) as Height
    From Vendor_ticket_items, Vendor_Items
    Where (VENDOR_ITEMS.Item_code = VENDOR_TICKET_ITEMS.Item_code)
    ORDER by item_code;

    There are a couple of problems I have with this view. First the VENDOR_TICKET_ITEMS.Dimensional_Values is defined as a varchar2 field and I want the Length, Width, and Height to be floating point numbers. When I do a desc on this view these fields must be inheriting the data type from the source value.

    The other problem is that the VENDOR_TICKET_ITEMS.Dimensional_Values string is not really lined up in columns but is variable length for the length, width, and height components encoded into the string.

    My questions are:
    1. Is there a way to create a view without a direct correlation to another column? Can I define a phantom column as being floating point number as a stand-alone which contains NULL? Something similar to how a standard table column is defined?

    2. Is there a conversion function to convert a text value of '0.0' to a floating point value for the phantom columns? I am able to get the following statement to work in the view instead:
    substr('0.0', 1,3) as Length,
    substr('0.0', 1,3) as Width,
    substr('0.0', 1,3) as Height

    I want to do the encoding and decoding in my program that calls the view but I would like to use the length, width, and height fields as placeholders for these values in my calculations. I'm just not finding the correct way to define a view without relating it to an already existing column.

    DB:2.60:Defining View With Phantom Columns? 1z

    Thanks, I'm going to read up on the cast function.

  • RELEVANCY SCORE 2.60

    DB:2.60:Re: Comparing Timestamp Columns ... I.E. Counting Matches Between Multiple Cols 8s


    Are the values in your result columns correct though?

    DB:2.60:Re: Comparing Timestamp Columns ... I.E. Counting Matches Between Multiple Cols 8s

    @Frank: That works, great! ... I did have to remove the WITH clause because it gives a "ORA-24374: define not done before fetch or execute and fetch" error. I suspect it has something to do with our server/client versions here. Thanks again.

  • RELEVANCY SCORE 2.60

    DB:2.60:Re: Run The Queries Which Are Columns Of A Table 8f


    HI, you mean something like this. below is the query which finds all the rows with status as Y

    sqlcreate table testtable(query_status varchar2(200));
    table created

    sqlinsert into testtable values('select * from emp Y');
    1 row inserted

    sqlinsert into testtable values('select * from dept Y');
    1 row inserted

    sqlinsert into testtable values('select * from country N');
    1 row inserted

    sqlselect * from testtable where UPPER(substr(query_status,-1))='Y';

    DB:2.60:Re: Run The Queries Which Are Columns Of A Table 8f

    The fact you are asking this suggests there is some very bad application design going on.
    It's very easy to come up with a solution that looks this way, but there's nearly always a better solution.

  • RELEVANCY SCORE 2.60

    DB:2.60:Really Need Some Numbers 09 Applescript Help Please. aj


    Hi All,I am attempting to use Applescript to allow me to collect the values of a pair of columns on one table and store them in an array then to use the values of one of those columns and compare them to the values of a column in another table and populate the coresponding second column of that other table with the second column stored in the array from the first table by comparing their coresponding matching values in the first column.That was a real mouthful so to de-confuse you here is an example :-)Table 1:Name | Age | Skill | DietFred | 35 | ProgrammerJane | 40 | AnalystAndy | 20 | SlobPeter | 22 | GardenerTable 2Name | DietFred | VegetarianEddy | Meat EaterBoris | VegetarianPeter | PescetarianIn this case I would need the script to add the Diet column values from table 2 to the Diet column in table 1 when I get a match in the Name columns of both tables (for Fred and Peter in this case) So it's kind of merging data between two tables.To give you this:Table 1 (Updated)Name | Age | Skill | DietFred | 35 | Programmer | VegetarianJane | 40 | Analyst |Andy | 20 | Slob |Peter | 22 | Gardener | PescetarianI'm very new to Applescript so this is giving me total grief.Any ideas please anyone as I am at the end of my tether and have wasted hours trying to figure out where to start even:-(Cheers in advance Paul :-)

    DB:2.60:Really Need Some Numbers 09 Applescript Help Please. aj

    Hi Paul,Thanks for the feedback. Always happy to know an answer has helped.Regards,Barry

  • RELEVANCY SCORE 2.60

    DB:2.60:Comparing Two Integer Values In Java jz


    How Can we compare two integer values with out using Relational operators and methods which are avilable in java for comparing.

    DB:2.60:Comparing Two Integer Values In Java jz

    Cross-post:
    http://forum.java.sun.com/thread.jspa?threadID=583826

  • RELEVANCY SCORE 2.60

    DB:2.60:Comparing Datetime Values dp


    I am querying a database that contains two datetime columns
    datetime1 and datetime2. How would I write a cfquery to
    select only records where datetime2 is six months greater than
    datetime1? Thanks!

  • RELEVANCY SCORE 2.60

    DB:2.60:Sql zf


    how do i transform columns to rows in a table?

    Ex: select id,substr(description,1,30) dsc1,substr(description,31,30) dsc2
    from tab_1;

    I want dsc2 to be printed as a row instead of column

    DB:2.60:Sql zf

    Hi,
    You can try :

    select id,substr(description,1,30) dsc1 from tab_1
    UNION ALL
    select id, substr(description,31,30) dsc2 from tab_1

    Regards

  • RELEVANCY SCORE 2.60

    DB:2.60:Comparing Two Columns Of Data For Discrepancies 7s


    I have two columns of idential numbers pulled from 2 different spreadsheets. I'm trying to find out if there is a way to have Excel compare the two columns for possible discrepancy. For example Col. A = 900, Col. B should also = 900. Thank you.

    DB:2.60:Comparing Two Columns Of Data For Discrepancies 7s

    Sureanytime! Thanks for the feedback!!!

    Glad to help,
    ~jaeson

  • RELEVANCY SCORE 2.60

    DB:2.60:Number Array Comparison To String 1j


    I am using an arrary with an index of no more than 19and comparing valueto see ifeach position is healthy and display a string to indicate the health. For some reason the values in the string are displaying up to 40 and when I change values are not displaying correctly. Attached is the compare.vi, could someone tell/show me how to correct this. Also is there a way of dispalying the health of the 20 slots in two columns?









    Attachments:







    Compare.vi ‏29 KB

    DB:2.60:Number Array Comparison To String 1j

    Yes, initializing the shift register is important. Ohterwise it retains its previous value, as you discovered.A for loop runs the minimum of the number wired to N or the number of entries in an autoindexing array. If your Fault Status array never has more than 20 elements, wiring to N is not needed. If Fault Status has fewer than 20 elements, the loop will only run until they have all been tested.You can also move constant parts of the strings outside the loop rather than rebuilding them on each iteration.The comparison functions work on arrays and produce array results (unless Compare Aggregates mode is selected).Here is a modified version of your VI.Lynn









    Attachments:







    Compare.2.vi ‏29 KB