• RELEVANCY SCORE 4.21

    DB:4.21:How Can I Change The Where Condition In The First Sql Query? 9m




    SELECT IND_SSN, BEG_SVC_DT, END_SVC_DT,
    TRUNC(MONTHS_BETWEEN((TO_DATE('19'||END_SVC_DT,'YYYYMMDD')),BEG_SVC_DT)/12),
    mod(trunc(months_between((to_date('19'||end_svc_dt,'YYYYMMDD')),BEG_SVC_DT)),12),
    DECODE((SUBSTR(END_SVC_DT,5,2) - SUBSTR(BEG_SVC_DT,1,2)+1),-1,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -2,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -3,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -4,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -5,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -6,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -7,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -8,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -9,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -10,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -11,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -12,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -13,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -14,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -15,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -16,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -17,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -18,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -19,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -20,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -21,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -22,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -23,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -24,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -25,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -26,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -27,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -28,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -29,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -30,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    -31,((SUBSTR(END_SVC_DT,5,2)+ 31) - SUBSTR(BEG_SVC_DT,1,2)),
    30,0,
    (SUBSTR(END_SVC_DT,5,2) - SUBSTR(BEG_SVC_DT,1,2)+1))
    FROM SVC_OCCURRENCES
    WHERE end_svc_dt not in ('PRESENT')
    AND SUBSTR(END_SVC_DT,1,1) IN '9'
    AND SUBSTR(END_SVC_DT,5,2) NOT IN ('31')
    and (SUBSTR(END_SVC_DT,5,2) - SUBSTR(BEG_SVC_DT,1,2)+1) not in ('30')
    UNION
    SELECT IND_SSN, BEG_SVC_DT, END_SVC_DT, NULL, NULL, NULL
    FROM SVC_OCCURRENCES
    WHERE SUBSTR(END_SVC_DT,1,1) IN 'P'

    The above code works fine and I get the correct numeric values from the SQL
    query when the varchar2 end_svc_dt field is numeric however if I have encoded
    the word 'PRESENT' in the varchar2 end_svc dt field the SQL query aborts at
    the last statement in the WHERE condition. The beg_svc_dt field is a Date field.

    and (SUBSTR(END_SVC_DT,5,2) - SUBSTR(BEG_SVC_DT,1,2)+1) not in ('30')

    I get the following error message
    ERROR ORA-0722 INVALID NUMBER

    I encode the word 'PRESENT' in a varchar2 end_svc_dt field on an Oracle form. This is the only word that can be encoded.

    Is there some way that I can bypass the last statement in the where condition and
    compute the values from the SQL query without having the SQL query abort?

    Eventually I want to do this in a report. I know that this sounds strange but can it be done?

    DB:4.21:How Can I Change The Where Condition In The First Sql Query? 9m

    The above code works fine and I get the correct
    numeric values from the SQL
    query when the varchar2 end_svc_dt field is numeric
    however if I have encoded
    the word 'PRESENT' in the varchar2 end_svc dt field
    the SQL query aborts at
    the last statement in the WHERE condition.Ouch!
    Storting dates in VARCHAR2 columns is bad practice, poor design and makes for horrible code.

    The beg_svc_dt field is a Date field.

    and (SUBSTR(END_SVC_DT,5,2) -
    SUBSTR(BEG_SVC_DT,1,2)+1) not in ('30')If it's a date field then why on earth are you trying to SUBSTR it. SUBSTR = sub-string i.e. take a sub section of a string not sub-date.

    I get the following error message
    ERROR ORA-0722 INVALID NUMBERAnd you're surprised by this?

    Is there some way that I can bypass the last
    statement in the where condition and
    compute the values from the SQL query without having
    the SQL query abort?Store your dates properly, use additional flag columns for non-date information and code your SQL properly.

    Eventually I want to do this in a report. I know
    that this sounds strange but can it be done?Yes, most things are possible.

  • RELEVANCY SCORE 3.96

    DB:3.96:Re: How To Get The First 6 Digits And The Last 4 Digits In A String ? dd




    select substr (str, 1, 6)
    , substr (str, 7, length (str) -10)
    , substr (str, -4)
    from test

  • RELEVANCY SCORE 3.82

    DB:3.82:Set 7s




    Can you tell me how I can get this to work.

    I am trying to replace the second position of micode in table mtinven with 'X' for all records that have 'S' in position 2.

    update mtinven
    set substr(micode,2,1) = 'X'
    where substr(micode,2,1) = 'S'

    Thanks in advance.

    DB:3.82:Set 7s

    I posted mine before Todd's showed up but mine has a bug (doh!) Todd's has the correct index for the rest of the string.

    Richard

  • RELEVANCY SCORE 3.70

    DB:3.70:Title To Reflect Month Chosen Shows #Multivalue For All Months fp



    I've created a blank cell for the report's title as follows:

    =If(Substr([Fiscal Year/Period];4;3)="001";"January " +Substr([Fiscal Year/Period];8;4)+" Profit by Order" ; If (Substr([Fiscal Year/Period];4;3)="002";"February " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="003";"March " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="004";"April " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="005";"May " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="006";"June " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="007";"July " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="008";"August " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="009";"September " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="010";"October " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="011";"November " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="012";"December " +Substr([Fiscal Year/Period];8;4)+" Profit by Order"))))))))))))

    However, if the user selects 'All Periods', this formula shows #MULTIVALUE

    Does anyone know how to fix this where if the user selects All Periods, the Title of the report will reflect "All Periods"?

    DB:3.70:Title To Reflect Month Chosen Shows #Multivalue For All Months fp


    Ok, well, all you have to do is adding another condition at the beginning of your formula. Since all the values are really seen by webintelligence as 001;002;003;004; etc -all of them separated by the sign ; - you have to add this condition first of all:

    =If Pos(ReportFilter([Fiscal Year/Period]);";")0 Then "ALL periodS" Else If(Substr([Fiscal Year/Period];4;3)="001";"January " +Substr([Fiscal Year/Period];8;4)+" Profit by Order" ; If (Substr([Fiscal Year/Period];4;3)="002";"February " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="003";"March " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="004";"April " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="005";"May " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="006";"June " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="007";"July " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="008";"August " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="009";"September " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="010";"October " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="011";"November " +Substr([Fiscal Year/Period];8;4)+" Profit by Order";If (Substr([Fiscal Year/Period];4;3)="012";"December " +Substr([Fiscal Year/Period];8;4)+" Profit by Order"))))))))))))

    if it doesnt work the first time, maybe you need to remove the filter and then apply it again, it will work for sure.

  • RELEVANCY SCORE 3.67

    DB:3.67: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:3.67: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 3.61

    DB:3.61:Problem With Substr Function jj



    I am trying to use the following code where Region1 is a string variable

    RegLen = length(Region1);

    if substr(Region1,RegLen-7,8) = "Division" then

    Region2 = cat(Region1," Support");

    For some reason this won't work and the error occures at 'RegLen-7' in the substr function. when I replace this with a number, 14 for example' it works, but as Region1 can be any number of characters long I need this calculation in there.

    Thanks

    DB:3.61:Problem With Substr Function jj


    Worked out what the problem is now.

    Some of the values for Region1 are less than 7 characters long and this is where was falling down.

    Simple error, bit took hours to work out!!!!

  • RELEVANCY SCORE 3.56

    DB:3.56:Apex 4.2, Db 11g: How Run Constructed Sql Into Variable Within Plsql zz


    Hello

    I'm using Apex 4.2.1.00.08. My DB is 11.2.0.2.0.

    I'm creating a dynamic charting tool that allows the user to select the field of data to display in a pie chart, and the column to group by.

    To do this, I am slightly abusing three selects on the page. For example, P31_COLUMN shows the user options such as 'Status', 'Frequency', but the return values are actually a long concatenation of columns from a table, with each column separated by a different number of hyphens. Hence all the substr().

    The below code works pretty well as intended, except the final part of the vLINK code (substr(:P31_COLUMN,0,instr(:P31_COLUMN,'-')-1)) returns the COLUMN_NAME rather than returning the value from that column. This is correct, because vLINK is just a concatenation and is not running the select statement (unlike the same bit of code within vSQL, which returns the value I need, because the SQL statement is actually run):

    DECLARE

    vSQL VARCHAR2(1000);
    vLINK VARCHAR2(1000);

    BEGIN

    IF :P31_DISPLAY is not null AND :P31_COLUMN is not null THEN

    vLINK:='f?p=APP_ID.:40:'||:app_session||'::::IREQ_'||substr(:P31_COLUMN,-(length(:P31_COLUMN)-instr(:P31_COLUMN,'-----')-4))||':'||substr(:P31_COLUMN,0,instr(:P31_COLUMN,'-')-1)||':';

    vSQL:='select '''||vLINK||''' link, ';
    vSQL:= vSQL || substr(:P31_COLUMN,0,instr(:P31_COLUMN,'-')-1) ||' name, ';
    vSQL:= vSQL || substr(:P31_DISPLAY,0,instr(:P31_DISPLAY,'-')-1)||'('||substr(:P31_DISPLAY,-(length(:P31_DISPLAY)-instr(:P31_DISPLAY,'-')))||') value ';
    vSQL:= vSQL || 'from '|| substr(:P31_CATEGORY,-(length(:P31_CATEGORY)-instr(:P31_CATEGORY,'-')));

    IF substr(:P31_COLUMN,instr(:P31_COLUMN,'-')+1,1)='1' THEN

    vSQL:= vSQL ||' join ' || substr(:P31_COLUMN,instr(:P31_COLUMN,'---')+3,instr(:P31_COLUMN,'----')-instr(:P31_COLUMN,'---')-3);
    vSQL:= vSQL ||' on ' || substr(:P31_COLUMN,instr(:P31_COLUMN,'--')+2,instr(:P31_COLUMN,'---')-instr(:P31_COLUMN,'--')-2);
    vSQL:= vSQL ||' = ' || substr(:P31_COLUMN,instr(:P31_COLUMN,'----')+4,instr(:P31_COLUMN,'-----')-instr(:P31_COLUMN,'----')-4);

    END IF;

    vSQL:= vSQL ||' group by ' || substr(:P31_COLUMN,0,instr(:P31_COLUMN,'-')-1);

    ELSE

    vSQL:='select null link, ''All work activities'' name, count(*) value from aa_wl_activities3';

    END IF;

    END;My strategy was to run a SQL statement in advance, pulling out the value of the column, rather than the column name, and popping it in a variable to refer to it within vLINK. My attempted code so far looks like this:

    DECLARE

    vSQL VARCHAR2(1000);
    vLINK VARCHAR2(1000);
    vGET VARCHAR2(1000);
    vRET VARCHAR2(1000);

    BEGIN

    IF :P31_DISPLAY is not null AND :P31_COLUMN is not null THEN

    vGET:='SELECT '||substr(:P31_COLUMN,0,instr(:P31_COLUMN,'-')-1)||' from '||substr(:P31_CATEGORY,-(length(:P31_CATEGORY)-instr(:P31_CATEGORY,'-')));
    IF substr(:P31_COLUMN,instr(:P31_COLUMN,'-')+1,1)='1' THEN
    vGET:= vGET ||' join ' || substr(:P31_COLUMN,instr(:P31_COLUMN,'---')+3,instr(:P31_COLUMN,'----')-instr(:P31_COLUMN,'---')-3);
    vGET:= vGET ||' on ' || substr(:P31_COLUMN,instr(:P31_COLUMN,'--')+2,instr(:P31_COLUMN,'---')-instr(:P31_COLUMN,'--')-2);
    vGET:= vGET ||' = ' || substr(:P31_COLUMN,instr(:P31_COLUMN,'----')+4,instr(:P31_COLUMN,'-----')-instr(:P31_COLUMN,'----')-4);
    END IF;

    vRET:= return vGET;

    vLINK:='f?p=APP_ID.:40:'||:app_session||'::::IREQ_'||substr(:P31_COLUMN,-(length(:P31_COLUMN)-instr(:P31_COLUMN,'-----')-4))||':'||substr(:P31_COLUMN,0,instr(:P31_COLUMN,'-')-1)||':';

    vSQL:='select '''||vLINK||''' link, ';
    vSQL:= vSQL || substr(:P31_COLUMN,0,instr(:P31_COLUMN,'-')-1) ||' name, ';
    vSQL:= vSQL || substr(:P31_DISPLAY,0,instr(:P31_DISPLAY,'-')-1)||'('||substr(:P31_DISPLAY,-(length(:P31_DISPLAY)-instr(:P31_DISPLAY,'-')))||') value ';
    vSQL:= vSQL || 'from '|| substr(:P31_CATEGORY,-(length(:P31_CATEGORY)-instr(:P31_CATEGORY,'-')));

    IF substr(:P31_COLUMN,instr(:P31_COLUMN,'-')+1,1)='1' THEN

    vSQL:= vSQL ||' join ' || substr(:P31_COLUMN,instr(:P31_COLUMN,'---')+3,instr(:P31_COLUMN,'----')-instr(:P31_COLUMN,'---')-3);
    vSQL:= vSQL ||' on ' || substr(:P31_COLUMN,instr(:P31_COLUMN,'--')+2,instr(:P31_COLUMN,'---')-instr(:P31_COLUMN,'--')-2);
    vSQL:= vSQL ||' = ' || substr(:P31_COLUMN,instr(:P31_COLUMN,'----')+4,instr(:P31_COLUMN,'-----')-instr(:P31_COLUMN,'----')-4);

    END IF;

    vSQL:= vSQL ||' group by ' || substr(:P31_COLUMN,0,instr(:P31_COLUMN,'-')-1);

    ELSE

    vSQL:='select null link, ''All work activities'' name, count(*) value from aa_wl_activities3';

    END IF;

    END;Apex won't let me save this, or any variation I can think of, throwing this (or similar) error:

    Error Message1 error has occurred
    ORA-06550: line 20, column 14: PLS-00103: Encountered the symbol "VGET" when expecting one of the following: . ( * @ % = - + ; / at in is mod remainder not rem an exponent (**) or != or ~= = = and or like like2 like4 likec between || multiset member submultiset The symbol "." was substituted for "VGET" to continueThe problem is quite a basic one, I think, which is that I don't know how to run a constructed SQL statement and return the value into a variable. I have one working example from a different page:

    DECLARE
    myNum NUMBER;
    BEGIN
    SELECT MAX(activities_ref)+1
    into myNum
    from AA_WL_ACTIVITIES3 ;
    htp.p(myNum);
    END;But I am unclear how I can map this across, given that the small piece of code above just runs and is not constructed.

    Does anyone know what the command is to "run" or "return" a piece of constructed SQL into a variable?

    Thanks for any help...

    Emma

    DB:3.56:Apex 4.2, Db 11g: How Run Constructed Sql Into Variable Within Plsql zz

    The rest seems OK:

    vSQL := 'some sql statement';

    For the rest, I'm not sure what you want to do with this code. At the end of your procedure you have a sql statement in variable vSQL. Then what?

  • RELEVANCY SCORE 3.53

    DB:3.53:Sort Order In Group-By-Rollup Select With Count Distinct 8k


    Using 10gR2,

    Group-By-Rollup in following Select statement retrieves the rows in expected sorted order:

    select substr( phone_number, 1, 7 ) "Phone-Group",
    substr( phone_number, 1, 3 ) "Phone-Group 2",
    count( job_id )
    from employees e
    group by rollup( substr( phone_number, 1, 7 ) ), substr( phone_number, 1, 3 )That's OK!

    but after changing the count to count-distinct, then all summary-rows from rollup are retrieved finally which is not expected :

    select substr( phone_number, 1, 7 ) "Phone-Group",
    substr( phone_number, 1, 3 ) "Phone-Group 2",
    count( DISTINCT job_id )
    from employees e
    group by rollup( substr( phone_number, 1, 7 ) ), substr( phone_number, 1, 3 )What's the reason of this behaviour?

    How to get the right sort-order ( as expected from first select ) with count-distinct?

  • RELEVANCY SCORE 3.52

    DB:3.52:Unusual Wiildcard-Style Query zp



    I have a requirement that I hope someone can assist me with.

    I have been asked to "recreate" a SQL Server report in QlikView which, in the main, is very straightforward in terms of the data joins.

    The only aspect that baffles me relates to a particular field (let's call it RefNo) which is a 10-digit number. The SQL SELECT that we are replacing is of the order:

    SELECT fieldlist.....

    FROM tableslist

    WHERE

    substr(RefNo,1,4) IN ('8418', '8423', '8424')

    OR

    substr(RefNo,1,5) IN ('85711')

    OR

    substr(RefNo,1,6) IN ('630110', '841451', '841460')

    OR

    substr(RefNo,1,7) IN ('84414869')

    OR

    substr(RefNo,1,8) IN ('84615011', '85101000')

    OR

    substr(RefNo,1,9) IN ('850980000')

    OR

    substr(RefNo,1,10) IN ('8465950000')

    Any ideas as to how I can incorporate this kind of requirement in QlikView - I was even thinking of saving all the combinations in a Bookmark but that would involve a ridiculous amount of manual work and also would not allow for additions or modifications to the codes in future.

    Any ideas would be very welcome.

    Alexis

    DB:3.52:Unusual Wiildcard-Style Query zp


    Now we are getting closer!

    I could store all the refnos in an excel spreadsheet and then create a "wildmatch" statement such as the one listed ...

  • RELEVANCY SCORE 3.44

    DB:3.44:Fetch Xml From Database ac


    Hi,

    I am using Oracle 10g R2 (run on IBM AIX platform on Windows XP) and I want to fetch an XML from my database.

    The XML is stored in the form of CLOB in a table - "Audit". Now I am trying to get it out using the below, but since the XML is very big, I have to use DBMS_OUTPUT.PUT_LINE all the time.

    declare
    x clob;
    begin
    select MESSAGE into x Audit where ID=8466840;
    dbms_output.put_line(substr(x,1,4000));
    dbms_output.put_line(substr(x,4001,8000));
    dbms_output.put_line(substr(x,8001,12000));
    dbms_output.put_line(substr(x,8001,12000));
    dbms_output.put_line(substr(x,12001,16000));
    dbms_output.put_line(substr(x,16001,20000));
    dbms_output.put_line(substr(x,20001,24000));
    dbms_output.put_line(substr(x,24001,28000));
    dbms_output.put_line(substr(x,28001,32000));
    dbms_output.put_line(substr(x,32001,36000));
    dbms_output.put_line(substr(x,36001,40000));
    dbms_output.put_line(substr(x,44001,48000));
    dbms_output.put_line(substr(x,48001,52000));
    exception
    when no_data_found then
    dbms_output.put_line('no data found');
    when others then
    dbms_output.put_line(SQLERRM);
    end;
    /MESSAGE column in the table stores the XML and it is in CLOB format.

    Now is there any function or anything in Oracle by which I can get my XML at once (complete) from the database.

    Many Thanks in anticipation of help.

    DB:3.44:Fetch Xml From Database ac

    If you want to print a CLOB with dbms_output then you may take help from this
    PROCEDURE print_clob(p_clob in clob) as
    l_offset number default 1;
    BEGIN
    loop
    exit when l_offset dbms_lob.getlength(p_clob);
    dbms_output.put_line(dbms_lob.substr(p_clob, 255, l_offset));
    l_offset := l_offset + 255;
    end loop;
    END print_clob;To write a XML as file, Here is two methods:
    Method - I

    CREATE OR REPLACE PROCEDURE WriteXMLFile(pi_xml IN XMLTYPE default NULL,
    pi_colb IN clob default NULL,
    pi_directory_name VARCHAR2,
    pi_file_name IN VARCHAR2) IS
    v_doc DBMS_XMLDOM.DOMDocument;
    v_file VARCHAR2(2000);

    BEGIN

    IF pi_xml IS NOT NULL AND pi_colb IS NOT NULL THEN
    RAISE_APPLICATION_ERROR(-20001,
    'Pass only one parameter, either XMLTYPE or CLOB.');
    END IF;

    IF pi_xml IS NULL AND pi_colb IS NULL THEN
    RAISE_APPLICATION_ERROR(-20002,
    'Pass atleast one parameter, either XMLTYPE or CLOB.');
    END IF;

    IF pi_xml IS NOT NULL AND pi_colb IS NULL THEN
    v_doc := DBMS_XMLDOM.NEWDOMDOCUMENT(pi_xml);
    ELSIF pi_xml IS NULL AND pi_colb IS NOT NULL THEN
    v_doc := DBMS_XMLDOM.NEWDOMDOCUMENT(XMLTYPE(pi_colb));
    END IF;

    IF DBMS_XMLDOM.ISNULL(v_doc) THEN
    RAISE_APPLICATION_ERROR(-20003, 'Unable to create XML.');
    END IF;
    --pi_directory_name should be created as a DIRECTORY object on the database
    v_file := pi_directory_name || '\' || pi_file_name;
    DBMS_XMLDOM.WRITETOFILE(v_doc, v_file, 'UTF-8');
    DBMS_XMLDOM.FREEDOCUMENT(v_doc);
    END WriteXMLFile;

    ---Usages
    DECLARE
    v_clob CLOB;
    BEGIN
    SELECT clob_col INTO v_clob FROM test_clob WHERE id = 1;
    WriteXMLFile(pi_xml = NULL,
    pi_colb = v_clob,
    pi_directory_name = 'TEST_DIR',
    pi_file_name = 'emp_clob.xml');
    END;
    ----------
    DECLARE
    v_xml XMLTYPE;
    BEGIN
    SELECT xmltype(clob_col) INTO v_xml FROM test_clob WHERE id = 1;
    WriteXMLFile(pi_xml = v_xml,
    pi_colb = NULL,
    pi_directory_name = 'TEST_DIR',
    pi_file_name = 'emp_clob.xml');
    END;
    -------------Method II
    DECLARE
    v_clob CLOB := EMPTY_CLOB;
    v_amount INTEGER;
    CURSOR cur_crl IS
    SELECT request_code, response_file FROM clarity_response_log;

    BEGIN
    dbms_lob.createtemporary(v_clob, TRUE);
    FOR i IN cur_crl LOOP
    v_amount := DBMS_LOB.GETLENGTH(i.response_file.getCLOBVal());
    Dbms_LOB.WRITEAPPEND(v_clob, v_amount, i.response_file.getCLOBVal());
    v_amount := DBMS_LOB.GETLENGTH(CHR(10));
    Dbms_LOB.WRITEAPPEND(v_clob, v_amount, CHR(10)); --This is for Line break.
    END LOOP;


    DBMS_XSLPROCESSOR.CLOB2FILE(cl = v_clob,
    flocation = 'TEST_DIR',
    fname = 'response.xml',
    csid = 0);

    END;

  • RELEVANCY SCORE 3.44

    DB:3.44: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.44: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.43

    DB:3.43:Fiscal Year For Output Csv ac


    I am trying to output file in CSV format. Everything works beautifully except Fiscal_date (format yyyymm); with cutoff on Sept of each year.

    I have codes that "interpret" the *:control.begin_date* (format yyyymmdd); if it's Sept, it'll be 201201. I also have variable Fiscal_date varchar(6) and if statements where if mm is (01, 02, etc) then fiscal_date will be yyyy||01, 02, etc. The output will always in a monthly basis and no overlaps of month; which means it'll always be something like 201102, 201103, etc.

    if substr(to_char(:control.begin_date),5,2) = '01' then Fiscal_date := substr(to_char(:control.begin_date),1,4)||'05' ;
    elsif substr(to_char(:control.begin_date),5,2) = '02' then Fiscal_date := substr(to_char(:control.begin_date),1,4)||'06';
    elsif substr(to_char(:control.begin_date),5,2) = '03' then Fiscal_date := substr(to_char(:control.begin_date),1,4)||'07';
    elsif substr(to_char(:control.begin_date),5,2) = '04' then Fiscal_date := substr(to_char(:control.begin_date),1,4)||'08';
    elsif substr(to_char(:control.begin_date),5,2) = '05' then Fiscal_date := substr(to_char(:control.begin_date),1,4)||'09';
    elsif substr(to_char(:control.begin_date),5,2) = '06' then Fiscal_date := substr(to_char(:control.begin_date),1,4)|| '10';
    elsif substr(to_char(:control.begin_date),5,2) = '07' then Fiscal_date := substr(to_char(:control.begin_date),1,4)||'11';
    elsif substr(to_char(:control.begin_date),5,2) = '08' then Fiscal_date := substr(to_char(:control.begin_date),1,4)||'12';
    elsif substr(to_char(:control.begin_date),5,2) = '09' then Fiscal_date := substr(to_char(:control.begin_date),1,4)+1|| '01';
    elsif substr(to_char(:control.begin_date),5,2) = '10' then Fiscal_date := substr(to_char(:control.begin_date),1,4)+1||'02';
    elsif substr(to_char(:control.begin_date),5,2) = '11' then Fiscal_date := substr(to_char(:control.begin_date),1,4)+1||'03';
    elsif substr(to_char(:control.begin_date),5,2) = '12' then Fiscal_date := substr(to_char(:control.begin_date),1,4)+1||'04';
    message('Fiscal_date : '||Fiscal_date );
    end if;The output message is always nothing.

    Open to suggestions of better way of doing it or to resolve the problem.

    Thanks.

    DB:3.43:Fiscal Year For Output Csv ac

    Maybe this
    :FISCAL_DATE:=TO_CHAR(ADD_MONTHS(:CONTROL.bEGIN_DATE, 4),'YYYY') ||
    TO_CHAR(:CONTROL.BEGIN_DATE, 'MM');

  • RELEVANCY SCORE 3.43

    DB:3.43:Datetostring And Substr In One Statement 1f


    Why do I get an error when I run the following DQL statement?SELECT SUBSTR(DATESTRING(r_creation_date, 'mm-dd-yyyy'),7,10) as current_year FROM dm_document.Error occured during query execution :[DM_QUERY_E_SYNTAX]error: "A Parser Error (syntax error) has occurred in the vicinity of: SELECT SUBSTR(DATESTRING("It works fine if I have:SELECT DATESTRING(r_creation_date, 'mm-dd-yyyy') as current_year FROM dm_document.So, when I add SUBSTR around DATETOSTRING function it fails. Does anyone have an idea on how to get the four digit year from date in another way?

    DB:3.43:Datetostring And Substr In One Statement 1f

    Hello,Try thisSELECT DATETOSTRING(r_creation_date, 'yyyy') as current_year FROM dm_document

  • RELEVANCY SCORE 3.42

    DB:3.42:How To Substr Field In Sap Query. fa



    Dear Developer,

    How to substr any field in SAP Query ?

    Regards,

    Ujed.

    DB:3.42:How To Substr Field In Sap Query. fa


    Hi Ujed,

    To do substrings in SAP Query simply use the following syntax:

    Field[FromPos : ToPos]

    Regards,

    Leif

  • RELEVANCY SCORE 3.42

    DB:3.42:Substr Function Returns Wrong Result 3j



    Dear experts,

    in a DATA step I am using the substr function on a $10. formatted variable that contains numbers.The numbers begin with 5, however substr(variable,1,1) returns 6

    How can I make it work?

    Thank you,

    Stefan

    DB:3.42:Substr Function Returns Wrong Result 3j


    Ups, I just found my error myself, thx anyway!

  • RELEVANCY SCORE 3.41

    DB:3.41:Html Db With Javascript zj


    Hi everybody,
    Is it possible to have a substr(.....) in a getval ?

    document.getElementById('P1_RESULT').value =
    getVal(substr('P1_VALUE_1',3,5) * getVal(substr('P1_VALUE_2',3,5,)

    Thank you. Bye.

    DB:3.41:Html Db With Javascript zj

    Hello,
    \
    Try something like this.

    html_GetElement('P1_RESULT').value = substr(html_GetElement('P1_VALUE_1').value,3,5) * substr(html_GetElement('P1_VALUE_2').value,3,5)

    Carl

  • RELEVANCY SCORE 3.39

    DB:3.39:Substr? How I Can Extract The Codes That Are Only 6 Characters ap


    I have this query


    SELECT
    distinct
    SUBSTR(A.STVSBGI_CODE,1,6),
    SUBSTR(B.STVSBGI_CODE,1,6),
    A.STVSBGI_TYPE_IND,
    B.STVSBGI_CODE,
    B.STVSBGI_TYPE_IND
    FROM
    stvsbgi A ,
    stvsbgi_TEST6C B
    WHERE A.STVSBGI_TYPE_IND = 'C'
    AND B.STVSBGI_TYPE_IND = 'C'
    AND instr(A.STVSBGI_CODE,1,6) = instr(B.STVSBGI_CODE,1,6)
    I want to be able to extract ONLY the values(STVSBGI_CODE) where the SUBSTR(A.STVSBGI_CODE,1,6),
    there are codes in the tables with 4 characters, well the query is giving me both 4 and 6 characters...
    How I can write the query just to get the codes with 6 characters
    Thank yoou

  • RELEVANCY SCORE 3.36

    DB:3.36:Bulk Insert With Conditions kj


    Hi,Currently I am migrating scripts/database from Oracle to new SQL Server 2008. There are some control files used in Oracle to load data from a flat file. Can someone give me an Idea of how to perform this insertion in SQL Server BULK INSERT with multiple conditions?? Also suggest is there any other better way plz.Sample Control file code in existing Oracle:load datainto table TABLE_NAMEREPLACEwhen(1:2) = '01'(       recid POSITION (1:2) ,        DOC_NO POSITION(4:10),        SEQNO POSITION (12:15),        TRIG_DATE POSITION(17:28) DATE RRMMDDHH24MISS,        terr POSITION (30:37) substr(:terr,1,2)||substr(:terr,4,1)||substr(:terr,6,1)||substr(:terr,8,1),        comm_terr POSITION (39:46) substr(:comm_terr,1,2)||substr(:comm_terr,4,1)||substr(:comm_terr,6,1)||substr(:comm_terr,8,1),        customer POSITION (48:70),        gpp POSITION (72:75),        comments POSITION(77:92),        REQ_DELIVERY POSITION(94:99),        RELSE_TO_FLC  POSITION(101:101))

    DB:3.36:Bulk Insert With Conditions kj

    We use a much simpler format, and though it does not have the row by row flexibility that this appears to have, it also is significantly more abstract and I think a lot safer.  This is a FORTRAN-style parsing scheme that you are showing, and we have seen how fragile working from character position in a line can be, especially when schemas can change. Here is some documentation on how our format files work: http://msdn.microsoft.com/en-us/library/ms191516.aspx http://doc.ddart.net/mssql/sql70/impt_bcp_16.htm If possible, I would suggest moving to a fixed format for safety and cross-provider utility. Hope that helps, JohnThis post is provided 'as is' and confers no express or implied warranties or rights.

  • RELEVANCY SCORE 3.35

    DB:3.35:Substr Of Long String dm


    how to get a sub string of the column value, for which the data type of column is Long

    DB:3.35:Substr Of Long String dm

    Hi,

    Then try this.. this might work out for your
    requirement.
    http://www.oracle.com/technology/oramag/code/tips2003/
    052503.html... and if your data is longer than 32k, you could create a function or procedure to use the TO_LOB function to insert the data into a GTT, converting the LONG to a LOB while doing so. This is just used to temporarily convert the data to a LOB so you can perform operations on it that are not allowed on LONG data.

    There is a bit of overhead involved, but the process works.

  • RELEVANCY SCORE 3.35

    DB:3.35:Re: Instr,Substr x9


    cant get friend, are you trying to create varying IN list ??

    DB:3.35:Re: Instr,Substr x9

    Why does Dave's version not work for you?

    as a string is limited to 4000 characters i think, i would make it as short as possible. If # never appears in a name, i'd make the string like this:

    Jim#George#Ann and simply look for Jim (with instring as Dave said)

    regards, martina

  • RELEVANCY SCORE 3.35

    DB:3.35:Generating Report Using Web Adi d1


    I am trying to run a download using web adi and I encountered an error "SQL error: ORA-00923: FROM keyword not found where expected occurred processing stored SQL for Content 20003:HR_303_CNT" . When I run my view using SQL developer, in run perfectly.Here is the view that I created that is being used in the View Name.

    CREATE OR REPLACE FORCE VIEW "APPS"."COMPANY_ASSOCIATE_INFO_V" ("FirstName", "MiddleName", "LastName", "SSO", "EmailAddress", "AdjustedService Date", "Abbrev", "JobDate", "GEJobFunction", "PositionName", "Division", "CompanyName", "GroupNumber", "GroupName", "RegionNumber", "RegionName", "AreaNumber", "AreaName", "DistDept#", "DistDeptName", "Reportto1Number", "Reportto1Name", "Reportto2Number", "Reportto2Name", "Reportto3Number", "Reportto3Name", "EmployeeStatus", "LocationCode", "SupervisorFirstName", "SupervisorMiddleName", "SupervisorLastName", "SupervisorSSO", "SupervisorEmail Address") AS
    (SELECT
    ppx.FIRST_NAME "FirstName"
    , ppx.middle_names "MiddleName"
    , ppx.LAST_NAME"LastName"
    , ppx.EMPLOYEE_NUMBER"SSO"
    , ppx.email_address "EmailAddress"
    , pps.adjusted_svc_date "AdjustedServiceDate"
    , pp.ATTRIBUTE1"Abbrev"
    , apps.Penske_get_Abbrev_dt(ppx.person_id) "JobDate"
    , pp.ATTRIBUTE4"GEJobFunction"
    , ppd.segment2"PositionName"
    , haou.attribute1 "Division"
    , port.COMPANY_NAME"CompanyName"
    , SUBSTR(port.GROUP_NAME,1,6) "GroupNumber"
    , SUBSTR(port.GROUP_NAME,8) "GroupName"
    , SUBSTR(port.REGION_NAME,1,6) "RegionNumber"
    , SUBSTR(port.REGION_NAME,8) "RegionName"
    , SUBSTR(port.AREA_NAME,1,6) "AreaNumber"
    , SUBSTR(port.AREA_NAME,8) "AreaName"
    , SUBSTR(port.DIST_DEPT,1,6) "DistDept#"
    , SUBSTR(port.DIST_DEPT,8) "DistDeptName"
    , SUBSTR(port.REPORT_TO_1,1,6) "Reportto1Number"
    , SUBSTR(port.REPORT_TO_1,8) "Reportto1Name"
    , SUBSTR(port.REPORT_TO_2,1,6) "Reportto2Number"
    , SUBSTR(port.REPORT_TO_2,8) "Reportto2Name"
    , SUBSTR(port.REPORT_TO_3,1,6) "Reportto3Number"
    , SUBSTR(port.REPORT_TO_3,8) "Reportto3Name"
    , past.user_status "EmployeeStatus"
    , hla.location_code "LocationCode"
    , ppx1.FIRST_NAME"SupervisorFirstName"
    , ppx1.middle_names "SupervisorMiddleName"
    , ppx1.LAST_NAME"SupervisorLastName"
    , ppx1.EMPLOYEE_NUMBER"SupervisorSSO"
    , ppx1.email_address "SupervisorEmailAddress"
    FROM
    per_people_x ppx,
    per_people_x ppx1,
    per_assignments_x pax,
    hr_all_organization_units haou,
    hr_locations_all hla,
    penske_org_report_tbl port,
    per_positions pp,
    per_position_definitions ppd,
    per_periods_of_service pps,
    per_assignment_status_types past
    WHERE
    pax.organization_id = haou.ORGANIZATION_ID
    AND ppx.person_id = pax.person_id
    AND ppx1.person_id (+) = pax.supervisor_id
    AND ppx.person_type_id IN (124, 145)
    AND pax.business_group_id = ppx.business_group_id
    AND pax.ASSIGNMENT_TYPE = 'E'
    AND hla.location_id (+) = pax.location_id
    AND port.DIST_DEPT_ORG_ID (+) = pax.organization_id
    AND SYSDATE BETWEEN pax.effective_start_date
    AND pax.Effective_end_date
    AND SYSDATE BETWEEN ppx.effective_start_date
    AND ppx.Effective_end_date
    AND pps.period_of_service_id = pax.period_of_service_id
    AND pps.date_start = (SELECT MAX(DATE_START) FROM PER_PERIODS_OF_SERVICE
    WHERE PERSON_ID=pax.person_id)
    AND pp.position_id (+) = pax.position_id
    AND ppd.position_definition_id (+) = pp.position_definition_id
    AND past.assignment_status_type_id = pax.assignment_status_type_id
    AND past.active_flag = 'Y'
    );

    Is there a limitation in Web ADI on how many tables to be used in a view? Im so lost...

    Edited by: user9968177 on Oct 7, 2008 2:16 PM

    DB:3.35:Generating Report Using Web Adi d1

    I changed all view to this ansd it worked. Thanks for all your help.

    CREATE OR REPLACE FORCE VIEW "APPS"."Company_LMS_ASSOCIATE_INFO_V" ("FIRSTNAME", "MIDDLEINITIAL", "LASTNAMENAME", "SSO", "EMAIL", "ADJUSTEDSERVICEDATE", "ABBREV", "JOBDATE", "GEJOBFUNCTION", "POSITIONNAME", "DIVISION", "COMPANYNAME", "GROUPNUMBER", "GROUPNAME", "REGIONNUMBER", "REGIONNAME", "AREANUMBER", "AREANAME", "DISTDEPTNO", "DISTDEPTNAME", "REPORTTOONENUMBER", "REPORTTOONENAME", "REPORTTOTWONUMBER", "REPORTTOTWONAME", "REPORTTOTHREENUMBER", "REPORTTOTHREENAME", "EMPLOYEESTATUS", "LOCATIONCODE", "SUPERVISORFIRSTNAME", "SUPERVISORMIDDLENAME", "SUPERVISORLASTNAME", "SUPERVISORSSO", "SUPERVISOREMAIL") AS
    SELECT
    ppx.FIRST_NAME "FIRSTNAME"
    , ppx.middle_names "MIDDLEINITIAL"
    , ppx.LAST_NAME "LASTNAME"
    , ppx.EMPLOYEE_NUMBER "SSO"
    , ppx.email_address "EMAIL"
    , pps.adjusted_svc_date "ADJUSTEDSERVICEDATE"
    , pp.ATTRIBUTE1 "ABBREV"
    , apps.Penske_get_Abbrev_dt(ppx.person_id) "JOBDATE"
    , pp.ATTRIBUTE4 "GEJOBFUNCTION"
    , ppd.segment2 "POSITIONNAME"
    , haou.attribute1 "DIVISION"
    , port.COMPANY_NAME "COMPANYNAME"
    , SUBSTR(port.GROUP_NAME,1,6) "GROUPNUMBER"
    , SUBSTR(port.GROUP_NAME,8) "GROUPNAME"
    , SUBSTR(port.REGION_NAME,1,6) "REGIONNUMBER"
    , SUBSTR(port.REGION_NAME,8) "REGIONNAME"
    , SUBSTR(port.AREA_NAME,1,6) "AREANUMBER"
    , SUBSTR(port.AREA_NAME,8) "AREANAME"
    , SUBSTR(port.DIST_DEPT,1,6) "DISTDEPTNO"
    , SUBSTR(port.DIST_DEPT,8) "DISTDEPTNAME"
    , SUBSTR(port.REPORT_TO_1,1,6) "REPORTTOONENUMBER"
    , SUBSTR(port.REPORT_TO_1,8) "REPORTTOONENAME"
    , SUBSTR(port.REPORT_TO_2,1,6) "REPORTTOTWONUMBER"
    , SUBSTR(port.REPORT_TO_2,8) "REPORTTOTWONAME"
    , SUBSTR(port.REPORT_TO_3,1,6) "REPORTTOTHREENUMBER"
    , SUBSTR(port.REPORT_TO_3,8) "REPORTTOTHREENAME"
    , past.user_status "EMPLOYEESTATUS"
    , hla.location_code "LOCATIONCODE"
    , ppx1.FIRST_NAME "SUPERVISORFIRSTNAME"
    , ppx1.middle_names "SUPERVISORMIDDLENAME"
    , ppx1.LAST_NAME "SUPERVISORLASTNAME"
    , ppx1.EMPLOYEE_NUMBER "SUPERVISORSSO"
    , ppx1.email_address "SUPERVISOREMAIL"
    FROM
    per_people_x ppx,
    per_people_x ppx1,
    per_assignments_x pax,
    hr_all_organization_units haou,
    hr_locations_all hla,
    penske_org_report_tbl port,
    per_positions pp,
    per_position_definitions ppd,
    per_periods_of_service pps,
    per_assignment_status_types past
    WHERE
    pax.organization_id = haou.ORGANIZATION_ID
    AND ppx.person_id = pax.person_id
    AND ppx1.person_id = pax.supervisor_id
    AND ppx.person_type_id IN (124, 145)
    AND pax.business_group_id = ppx.business_group_id
    AND pax.ASSIGNMENT_TYPE = 'E'
    AND hla.location_id = pax.location_id
    AND port.DIST_DEPT_ORG_ID = pax.organization_id
    AND SYSDATE BETWEEN pax.effective_start_date
    AND pax.Effective_end_date
    AND SYSDATE BETWEEN ppx.effective_start_date
    AND ppx.Effective_end_date
    AND pps.period_of_service_id = pax.period_of_service_id
    AND pps.date_start = (SELECT MAX(DATE_START) FROM PER_PERIODS_OF_SERVICE
    WHERE PERSON_ID=pax.person_id)
    AND pp.position_id = pax.position_id
    AND ppd.position_definition_id = pp.position_definition_id
    AND past.assignment_status_type_id = pax.assignment_status_type_id
    AND past.active_flag = 'Y';

    Thanks guys for all the help.

  • RELEVANCY SCORE 3.35

    DB:3.35:How To Avoid: Ora-01403 No Data Found And Ora-00001 17


    Hi,
    below my code:
    CREATE TABLE TAB_TO_EM
    (
    EM_NUMBER VARCHAR2(32),
    NAME_FIRST VARCHAR2(32),
    NAME_LAST VARCHAR2(32),
    MAILBOX VARCHAR2(32)
    );

    ALTER TABLE TAB_TO_EM
    ADD (CONSTRAINT PK_EM_NUMBER PRIMARY KEY (EM_NUMBER));

    CREATE TABLE EM
    (
    EM_ID VARCHAR2(32),
    EM_NUMBER VARCHAR2(32),
    NAME_FIRST VARCHAR2(32),
    NAME_LAST VARCHAR2(32),
    EMAIL VARCHAR2(32)
    );

    ALTER TABLE EM
    ADD (CONSTRAINT PK_EM_ID PRIMARY KEY (EM_ID));THE PRIMARY KEY EM_ID COMES FROM THE TAB_TO_EM TABLE LINKED IN THIS WAY:
    NAME_LAST||'_'||SUBSTR(NAME_FIRST,1,3)||'_'||SUBSTR(EM_NUMBER,-2)

    I created this procedure to insert a new EM_NUMBER into EM table:

    CREATE OR REPLACE PROCEDURE INS_NEW_RECORD IS
    ERR_NUM NUMBER;
    ERR_MSG VARCHAR2(300);
    V_COUNT NUMBER;
    V_EM_ID VARCHAR2(64);

    CURSOR A IS
    SELECT A.EM_NUMBER, A.NAME_FIRST, A.NAME_LAST, A.MAILBOX
    FROM TAB_TO_EM A;

    BEGIN
    FOR CUR_A IN A
    LOOP
    SELECT COUNT(*)
    INTO V_COUNT
    FROM EM2 B
    WHERE B.EM_NUMBER=CUR_A.EM_NUMBER;

    IF V_COUNT = 0 THEN

    -- here insert a new record

    INSERT INTO EM2 (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
    VALUES (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2),
    CUR_A.EM_NUMBER, CUR_A.NAME_FIRST,CUR_A.NAME_LAST, CUR_A.MAILBOX);

    END IF;
    END LOOP;
    END INS_NEW_RECORD;Example of my table:

    Insert into TAB_TO_EM
    (EM_NUMBER, NAME_FIRST, NAME_LAST, MAILBOX)
    Values
    ('22333', 'AAAA', 'BBBB', 'XXXX');
    Insert into TAB_TO_EM
    (EM_NUMBER, NAME_FIRST, NAME_LAST, MAILBOX)
    Values
    ('11222', 'AAAA', 'BBBB', 'XXXX');
    Insert into TAB_TO_EM
    (EM_NUMBER, NAME_FIRST, NAME_LAST, MAILBOX)
    Values
    ('00122', 'AAAA', 'BBBB', 'XXXX');
    commit;


    execute INS_NEW_RECORD;
    ORA-00001: ORA-00001: unique constraint violated (PK_EM_ID)
    ORA-06512: a "INS_NEW_RECORD", line 25
    ORA-06512: a line 2I tried to modify my procedure:
    CREATE SEQUENCE AFM.SEQ_EM_ID
    START WITH 1
    MAXVALUE 999999999999999999999999999
    MINVALUE 1
    NOCYCLE
    NOCACHE
    ORDER;
    IF V_COUNT = 0 THEN

    --verify duplicate pkey

    SELECT (NAME_LAST||'_'||SUBSTR(NAME_FIRST,1,3)||SUBSTR(EM_NUMBER,-2))
    INTO V_EM_ID
    FROM EM B
    WHERE (NAME_LAST||'_'||SUBSTR(NAME_FIRST,1,3)||SUBSTR(EM_NUMBER,-2)) = (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2))
    AND ROWNUM=1;

    IF V_EM_ID = (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2)) THEN

    INSERT INTO EM2 (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
    VALUES (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2)||'_'||SUBSTR ('000' || SEQ_EM_ID.NEXTVAL, -3),
    CUR_A.EM_NUMBER, CUR_A.NAME_FIRST,CUR_A.NAME_LAST, CUR_A.MAILBOX);
    ELSE

    INSERT INTO EM2 (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
    VALUES (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2),
    CUR_A.EM_NUMBER, CUR_A.NAME_FIRST,CUR_A.NAME_LAST, CUR_A.MAILBOX);

    END IF;
    END IF;execute INS_NEW_RECORD;
    ORA-01403 no data foundI'd like to create a stored procedure with these conditions:
    IF em_id is duplicate insert new em_id= (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2)||'_'||SUBSTR ('000' || SEQ_EM_ID.NEXTVAL, -3)
    ELSE em_id= (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2)

    How can I write my procedure correctly?

    Thanks in advance!

    DB:3.35:How To Avoid: Ora-01403 No Data Found And Ora-00001 17

    1) What are you expecting this piece of code to do?
    SELECT COUNT(*)
    INTO V_COUNT
    FROM EM B
    WHERE B.EM_NUMBER=CUR_A.EM_NUMBER;My answer would be that i expect it to do nothing (unless i've misunderstood what you're doing up until now). You are making a new type of key in the EM table by frankensteining data elements from your tab_to_em table, so i would expect that code to always return 0. By the way, that's what we have a dup_val_on_index catch for, no need to read the table, you try your insert, if you dup a value, you take appropriate action.

    I guess the best way to proceed based on what you've provided would be 2 SQL statements.

    1) insert records where you cannot find a match in the target table
    2) insert records where you CAN find a match in the target table

    INSERT INTO EM (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
    select
    A.NAME_LAST||'_'||SUBSTR(A.NAME_FIRST,1,3)||SUBSTR(A.EM_NUMBER,-2),
    A.EM_NUMBER,
    A.NAME_FIRST,
    A.NAME_LAST,
    A.MAILBOX
    from tab_to_em a
    where not exists
    (
    select null
    from em b
    where b.NAME_LAST||'_'||SUBSTR(b.NAME_FIRST,1,3)||SUBSTR(b.EM_NUMBER,-2) = a.em_number
    );

    INSERT INTO EM (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
    select
    A..NAME_LAST||'_'||SUBSTR(A..NAME_FIRST,1,3)||SUBSTR(A..EM_NUMBER,-2)'_'||SUBSTR ('000' || SEQ_EM_ID.NEXTVAL, -3),
    A.EM_NUMBER,
    A.NAME_FIRST,
    A.NAME_LAST,
    A.MAILBOX
    from tab_to_em a
    where exists
    (
    select null
    from em b
    where b.NAME_LAST||'_'||SUBSTR(b.NAME_FIRST,1,3)||SUBSTR(b.EM_NUMBER,-2) = a.em_number
    );This comes with the caveat that what you are doing is a REALLY bad idea. Really really really bad idea.

    The baddies are
    1) your choice for a 'primary key'
    2) using a sequence and then substring it
    3) this is from a business perspective, storing the same person multiple times!

    Now, i don't know your system or requirements, but i am speaking in general terms here, this seems like a all around bad idea and i would suggest you revisit the design.

  • RELEVANCY SCORE 3.34

    DB:3.34:Unity Webplayer Embed In Wordpress Page 1z



    I tried the Wordpress plugin for Unity 3 one more time and got it to work, although it does have an incorrect line of code that makes height=width, regardless of what you use for a height value. To fix that problem you need to replace:

    unityObject.embedUnity(unityPlayer, '.substr($tUOParams[0],5,-1).', '.substr($tUOParams[1],7,-1).', '.substr($tUOParams[1],7,-1).');



    with:

    unityObject.embedUnity(unityPlayer, '.substr($tUOParams[0],5,-1).', '.substr($tUOParams[1],7,-1).', '.substr($tUOParams[2],8,-1).');

    DB:3.34:Unity Webplayer Embed In Wordpress Page 1z


    http://forum.unity3d.com/threads/182372-UnityDog-Wordpress-Plugin/page2

  • RELEVANCY SCORE 3.34

    DB:3.34:How To Make An Substr And Instr Combination In Javascrip dc


    Dear all,

    I need to extract some information in a javascript function.

    In sql we can do like this substr(:P1_ITEM, 1, instr(:P1_ITEM,'.',1,4)-1)

    f.e.
    01.02.03.04.05 -- 01.02.03.04
    001.002.003.004.005 -- 001.002.003.004

    How I can do it in javascript.

    Thanks in Advance

    lukx

    DB:3.34:How To Make An Substr And Instr Combination In Javascrip dc

    Hi Sergio,
    i used your solution and all works fine.
    Many Thanks
    km

  • RELEVANCY SCORE 3.34

    DB:3.34: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:3.34: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 3.34

    DB:3.34:Stuck Trying To Get A Decode To Match Data j8


    I have this bit of SQL:

    WITH sampledata AS
    (SELECT '000000000000000000000000000000000010101' schd FROM DUAL
    union all
    SELECT '000000000000000000000000000000001111111' sch from DUAL
    union all
    SELECT '101000000000100000000000000000000000000' sch from DUAL
    union all
    SELECT '000000000000000000000000000000010000000' sch from DUAL)
    SELECT schd
    , sign(to_number(substr(schd, 33))) c0
    , substr(schd, 33) c01
    , substr(schd, 3, 1) c02
    , decode(sign(to_number(substr(schd, 33))),
    '1', 'Days of week: ' ||
    decode(substr(schd, 33, 1), '1', 'Su ') ||
    decode(substr(schd, 34, 1), '1', 'Mo ') ||
    decode(substr(schd, 35, 1), '1', 'Tu ') ||
    decode(substr(schd, 36, 1), '1', 'We ') ||
    decode(substr(schd, 37, 1), '1', 'Th ') ||
    decode(substr(schd, 38, 1), '1', 'Fr ') ||
    decode(substr(schd, 39, 1), '1', 'Sa ')) c1
    , decode(substr(schd, 32, 1),
    '1', 'Last day of month ',
    '0', decode(sign(to_number(substr(schd, 33))),
    '1','Days of week: ' ||
    decode(substr(schd, 33, 1), '1', 'Su ') ||
    decode(substr(schd, 34, 1), '1', 'Mo ') ||
    decode(substr(schd, 35, 1), '1', 'Tu ') ||
    decode(substr(schd, 36, 1), '1', 'We ') ||
    decode(substr(schd, 37, 1), '1', 'Th ') ||
    decode(substr(schd, 38, 1), '1', 'Fr ') ||
    decode(substr(schd, 39, 1), '1', 'Sa '),
    '0','Set Days of Month: ' ||
    decode(substr(schd, 1, 1), '1', '1st ') ||
    decode(substr(schd, 2, 1), '2', '2nd ') ||
    decode(substr(schd, 3, 1), '3', '3rd ') ||
    decode(substr(schd, 4, 4), '4', '4th ') ||
    decode(substr(schd, 5, 5), '5', '5th ') ||
    decode(substr(schd, 6, 1), '6', '6th ') ||
    decode(substr(schd, 7, 1), '7', '7th ') ||
    decode(substr(schd, 8, 1), '8', '8th ') ||
    decode(substr(schd, 9, 1), '9', '9th ') ||
    decode(substr(schd, 10, 1), '10', '10th ') ||
    decode(substr(schd, 11, 1), '11', '11th ') ||
    decode(substr(schd, 12, 1), '12', '12th ') ||
    decode(substr(schd, 13, 1), '13', '13th ') ||
    decode(substr(schd, 14, 1), '14', '14th ') ||
    decode(substr(schd, 15, 1), '15', '15th ') ||
    decode(substr(schd, 16, 1), '16', '16th ') ||
    decode(substr(schd, 17, 1), '17', '17th ') ||
    decode(substr(schd, 18, 1), '18', '18th ') ||
    decode(substr(schd, 19, 1), '19', '19th ') ||
    decode(substr(schd, 20, 1), '20', '20th ') ||
    decode(substr(schd, 21, 1), '21', '21st ') ||
    decode(substr(schd, 22, 1), '22', '22nd ') ||
    decode(substr(schd, 23, 1), '23', '23rd' ) ||
    decode(substr(schd, 24, 1), '24', '24th ') ||
    decode(substr(schd, 25, 1), '25', '25th ') ||
    decode(substr(schd, 26, 1), '26', '26th ') ||
    decode(substr(schd, 27, 1), '27', '27th ') ||
    decode(substr(schd, 28, 1), '28', '28th ') ||
    decode(substr(schd, 29, 1), '29', '29th ') ||
    decode(substr(schd, 30, 1), '30', '30th ') ||
    decode(substr(schd, 31, 1), '31', '31st ')
    )
    ) schedule
    FROM sampledata;The idea is that the 'schd' contains scheduling information, where the 1st 31 numbers represent days of the month.

    The 3rd line of the sample data contains a schedule for reports to be run on the 1st, 3rd and 13th of the month.

    The SQL returns a match for the 1st of the month, but does not pick up the schedule for the 3rd or 13th of the month.

    I thought from the SQL for the 'schedule' column, that it would return the 3rd, but it is not doing so, even though I can confirm in col "c02" that the value for the 3rd character along is a one, which I thought would then be recognised / matched by this line:

    decode(substr(schd, 3, 1), '3', '3rd ') ||Any advice much appreciated, thanks!

    PS - I know the code is probably very clunky with my big long list of decodes for the days of the month, but I'm not smart enough to use a slicker route!

  • RELEVANCY SCORE 3.34

    DB:3.34:Question About Oas Forms And Trigger Os Procedures Or Events p8


    Hi
    I have a huge problem here, I don't have a clue of how to do this I have a form created from the provideer's wizard based on a table, the thing is that I have an special index that I need to shape, so the code bellow should do the job, but I dont know where to put it and if how to bind the variables.

    the variable PERTENECEA and ID_DEPENDENCE would come from the form
    num and txt are auxiliar variables so that I can create the new index
    and
    id_unidad_admiva is the value that I want to insert in each row

    declare
    num number;
    txt varchar(10);
    begin
    if substr(PERTENECEA, 0,2)0 then
    if substr(PERTENECEA, 3,2)0 then
    if substr(PERTENECEA, 5,2)0 then
    if substr(PERTENECEA, 7,2)0 then
    if substr(PERTENECEA, 9,2)0 then
    num:= TO_NUMBER(select MAX(substr(id_unidad_admiva, 9,2)) from unidades_admivas where id_dependencia=id_dependencia and substr(id_unidad_admiva,0,8)=substr(PERTENECEA,0,8);
    num:=num+1;
    txt:= substr(PERTENECEA,0,8);
    id_unidad_admiva:=txt||num;
    else
    num:=TO_NUMBER(select MAX(substr(id_unidad_admiva, 9,2)) from unidades_admivas where id_dependencia=id_dependencia and substr(id_unidad_admiva,0,8)=substr(PERTENECEA,0,8));
    num:=num+1;
    txt:= substr(PERTENECEA,0,8);
    id_unidad_admiva:=txt||num;
    end if;
    else
    num:=TO_NUMBER(select MAX(substr(id_unidad_admiva, 7,2)) from unidades_admivas where id_dependencia=id_dependencia and substr(id_unidad_admiva,0,6)=substr(PERTENECEA,0,6));
    num:=num+1;
    txt:= substr(PERTENECEA,0,6);
    id_unidad_admiva:=txt||num||'00';
    end if;
    else
    num:=TO_NUMBER(select MAX(substr(id_unidad_admiva, 5,2)) from unidades_admivas where id_dependencia=id_dependencia and substr(id_unidad_admiva,0,4)=substr(PERTENECEA,0,4));
    num:=num+1;
    txt:= substr(PERTENECEA,0,4);
    id_unidad_admiva:=txt||num||'0000';
    end if;
    else
    num:=TO_NUMBER(select MAX(substr(id_unidad_admiva, 3,2)) from unidades_admivas where id_dependencia=id_dependencia and substr(id_unidad_admiva,0,2)=substr(PERTENECEA,0,2));
    num:=num+1;
    txt:= substr(PERTENECEA,0,2);
    id_unidad_admiva:=txt||num||'000000';
    end if;
    else
    id_unidad_admviva:='0100000000';
    end if;
    end;so I thought it could be a trigger in the data base or a event on the form or turn this code to a stored procedure, but either way I don't know how

    can you guide me please??

    DB:3.34:Question About Oas Forms And Trigger Os Procedures Or Events p8

    Glad that works.
    "Trigger" is a good friend !

    Patrick.

    Edited by: pmonaco on Apr 6, 2010 11:28 PM

  • RELEVANCY SCORE 3.33

    DB:3.33:Details: Ora-00911: Invalid Character On Crystal Reports as


    I am sorry i dont want to include a whole query but just for anybody willing to help me on this can see the whole picture.

    When i run following query on the crystal reports XI version I get error But the report works fine but if i run the same query in Oracle get no erro

    SELECT DISTINCT
    upper(n.atm_name) atm_name
    ,m.timestamp,nvl(n.ID,'') atm_id,nvl(b.branch,'') brn_code,nvl(upper(b.ename),'') brn_name,nvl(m.p15_date_set,'') bday, bws_gen.format_ddmm(SUBSTR(m.p07_trans_dt,1,4)) trn_date, bws_gen.format_hhmmss(SUBSTR(m.p07_trans_dt,5,6)) trn_time
    , bws_gen.format_ddmm(SUBSTR(m.p07_trans_dt,1,4))||' '||bws_gen.format_hhmmss(SUBSTR(m.p07_trans_dt,5,6 )) trn_dt
    , bws_gen.format_ddmm(m.p13_date_local_txn) local_date, bws_gen.format_hhmmss(m.p12_time_local_txn) local_time
    ,bws_gen.format_ddmm(m.p13_date_local_txn)||' '||bws_gen.format_hhmmss(m.p12_time_local_txn) local_dt, '' tseq,'' onl
    , nvl(substr(m.s102_acc_id1,1,12),'') s102_acc_id1, nvl(substr(m.s103_acc_id2,1,12),'') s103_acc_id2,nvl(SUBSTR(m.p02_pan,1,6),'') imd,nvl(SUBSTR(m.p02_pan,7,16),'') crd_no,nvl(TO_NUMBER(m.p23_crd_seq_num),0) crd_seq
    , nvl(m.p32_acq_inst_id_code,'') acquirer_code
    ,DECODE(bws_gen.raw_to_string(SUBSTR(mreq.p61_rese rved_prv, 3,4),4)
    ,'00', 'Not Tran','01', 'Unconfirmed Dispense','20', 'FastCash','29', 'TCheques', decode(substr(m.p03_pcode,1,2),'99',' - Loro')||

    DECODE(bws_gen.raw_to_string(SUBSTR(mreq.p61_reser ved_prv, 1,2),2),0,' Reversal',7,' Reversal',8,' Reversal') tx_type_s

    , nvl(m.p04_amt_txn,0) amount

    , bc.currency cur

    , m.p28_amt_txn_fee

    , SUBSTR(m.p41_crd_ac_trm_id,1,4) brn

    , SUBSTR(m.p41_crd_ac_trm_id,5,4) txna_atm_id

    , cd.branch_id Crd_Brn

    , m.p03_pcode proc_code

    , m.p04_amt_txn

    , m.p05_amt_set

    , m.p06_amt_crd_bil

    , nvl(m.p11_stan,'')

    , nvl(m.p17_date_capt,'') txna_bday

    , nvl(m.p20_pan_ext_cc,'')

    , decode(substr(m.p03_pcode,1,2),'99',to_number(SUBS TR(m.p37_rrn,9,4)) - 1,SUBSTR(m.p37_rrn,9,4)) seq

    , nvl(SUBSTR(m.p37_rrn,9,4),'') seq

    , nvl(m.p49_cc_txn,'')

    , nvl(m.p50_cc_set,'')

    , nvl(m.p51_cc_crd_bil,'')

    , decode(substr(m.p03_pcode,1,2),'99','599',bws_gen. raw_to_string(mreq.p61_reserved_prv,6)) fun

    , DECODE(m.c1_mti,'0210',decode(to_number(nvl(c.ext_ reason_code,'0')),3,'Offline','Online') ,'0230','Offline','0430','Reversal') txtAuthorization

    , nvl(m.s103_acc_id2,'')

    , nvl(cd.branch_id,999) Crd_Brn

    , nvl(to_char(cd.branch_id),'') Crd_Brnch

    , DECODE(m.p39_rsp_code,'00','','10','','11','','16' ,'','R') reject_reason

    FROM gw_iso_msg m

    inner join bws_atm_network n

    on substr(m.p41_crd_ac_trm_id,5,4) = n.id

    inner join bws_branches b

    on n.branch = b.brn_id

    inner join gw_txn_ctrl c

    on m.msg_num = c.rsp_num

    inner join gw_iso_msg mreq

    on mreq.msg_num = c.rq_num

    left outer join cms_card cd

    on cd.card_num = m.p02_pan

    AND cd.seq_num = to_number(m.p23_crd_seq_num)

    inner join bwcurrency bc

    on n.currency = bc.isocurrencycode

    WHERE bws_gen.raw_to_string(mreq.p61_reserved_prv,2) IN (0,5,6,7,8)

    AND m.c1_mti IN ('0210','0230','0430')

    AND m.p32_acq_inst_id_code = {?p_acquirer}

    AND n.id = {?p_atm_from}

    AND n.id = {?p_atm_to}

    AND m.p15_date_set = {?p_bday}

    ORDER BY nvl(substr(m.s102_acc_id1,1,12),''),m.timestamp

    When opening the crystal report following error occurs:

    Details: ORA-00911: invalid character

    (Database Vendor Code 911)

    Please help out..Thanks regards

    DB:3.33:Details: Ora-00911: Invalid Character On Crystal Reports as

    This is not the right forum for your question.

    Please go to the pl/sql or sql-forum. There you will have more chance to get an answer.

    Leo

  • RELEVANCY SCORE 3.33

    DB:3.33:How To Select 2 Digits Of A 4 Digit xc



    Hi,

    I have a macro reading the Yr in and the Yr is a four digit. How can I select the last 2 digit and put it in another variable like Yr2 that I want to use in the same macro. I tried SUBSTR but it doesnt work.

    Thank you.

    %macro DATAnSETS(Yr);

    /*Yr = 1993 , 1994 , 1995*/

    yr2 = SUBSTR(yr,3,2);

  • RELEVANCY SCORE 3.33

    DB:3.33:Checking The Resultant Is Numeric Or Not In Pl Sql ks


    Hi,I am doing this VB project where I am migrating codes from VB to PL SQL constructs. I have a doubt here, I want to know how to write the below piece of code in PL SQL construct.IF (ISNUMERIC(SUBSTR(RST2(3), 3, 1)) = TRUE AND ISNUMERIC(SUBSTR(RST2(3), 4, 1)) = TRUE) THEN GETCPL := '0' || SUBSTR(RST2(3), 4, 4);ELSIF (ISNUMERIC(SUBSTR(RST2(3), 3, 1)) = FALSE AND ISNUMERIC(SUBSTR(RST2(3), 4, 1)) = TRUE) THEN GETCPL := '0' || SUBSTR(RST2(3), 3, 1) || SUBSTR(RST2(3), 5, 3);ELSIF (ISNUMERIC(SUBSTR(RST2(3), 3, 1)) = FALSE AND ISNUMERIC(SUBSTR(RST2(3), 4, 1)) = FALSE) THEN GETCPL := '0' || SUBSTR(RST2(3), 3, 2) || SUBSTR(RST2(3), 6, 2);ELSIF (ISNUMERIC(SUBSTR(RST2(3), 3, 1)) = TRUE AND ISNUMERIC(SUBSTR(RST2(3), 4, 1)) = FALSE) THEN GETCPL = '0' || SUBSTR(RST2(3), 4, 4);END IF;In VB basically it means that the resultant is numeric, any such function to check the same in SQL construct ?ThanksMrinal (mridulmrinal@gmail.com)

    DB:3.33:Checking The Resultant Is Numeric Or Not In Pl Sql ks

    Frank, valid point but in practice I have rarely had to deal with numbers in character form that are other than integers or decimal in format. I cannot remember seeing ltrim used like this before. I am pretty sure I used the REPLACE function to convert the digits to null.- -I think Mike posted the best example as it provides the OP with an easier code conversion path.- -HTH -- Mark D Powell --

  • RELEVANCY SCORE 3.32

    DB:3.32:How To Add An Additional Where Clause To Coa Kff In Oa Framework 1x


    Dear all,

    In Oracle Form, we can add additional where clause to COA KFF by the following:

    FND_KEY_FLEX.DEFINE(
    BLOCK='D_SUM_FOLDER',
    FIELD='DIST_CODE_COMBINATION_DISP',
    DESCRIPTION='ACCOUNT_DESCRIPTION',
    ID='DIST_CODE_COMBINATION_ID',
    APPL_SHORT_NAME='SQLGL',
    CODE='GL#',
    NUM=':PARAMETER.CHART_OF_ACCOUNTS_ID',
    VDATE=':D_SUM_FOLDER.ACCOUNTING_DATE',
    VRULE='GL_GLOBAL\\nDETAIL_POSTING_ALLOWED\\nI\\nAPPL=SQLAP;NAME=AP_ALL_POSTING_NA\\nY\\0\\nSUMMARY_FLAG\\nI\\nAPPL=SQLAP;NAME=AP_ALL_PARENT_FLEX_NA\\nN',
    DERIVED='D_SUM_FOLDER.ACCOUNT_TYPE\\nGL_ACCOUNT_TYPE',
    REQUIRED='Y',
    where_clause_msg = 'APPL=XBOL;NAME=XXAP_INVALID_ACCOUNT_CODE',
    WHERE_CLAUSE = 'SUMMARY_FLAG != ''Y'' AND
    ACCOUNT_TYPE ''O'' AND
    segment1 not like ''%FCF'' AND
    segment1 not like ''%SUS'' AND
    NOT (substr(segment1,1,1) between ''0'' and ''9'' AND
    substr(segment1, -3) = ''EST'' ) AND
    NOT (substr(segment1,1,1) in (''2'', ''3'', ''4'', ''5'', ''6'', ''8'', ''9'') AND
    substr(segment1,12,1) ''0'') AND
    segment1 not in (''188L00001'', ''M88M11001'') AND
    (
    (length(segment1)=12 and substr(segment1,1,1)=''Y'' and substr(segment1,-1) != ''Z'') or
    (length(segment1)=13 and substr(segment1,1,1)=''W'' and substr(segment1,-1) != ''Z'') or
    (length(segment1)!=12 and substr(segment1,1,1)=''Y'' ) or
    (length(segment1)!=13 and substr(segment1,1,1)=''W'') or
    substr(segment1,1,1) not in (''W'',''Y'')
    ) '
    );

    Would anyone please advise how can archive this in OA Framework? We need to do a customization on the iProcurement web page, in order to restrict the selection of account range based on a selected PR header value.

    HY

    DB:3.32:How To Add An Additional Where Clause To Coa Kff In Oa Framework 1x

    HY,

    Refer http://oracle.anilpassi.com/oa-framework-extending-controller-steps-2.html

    Regards,
    Gyan
    www.gyanoracleapps.blogspot.com

  • RELEVANCY SCORE 3.32

    DB:3.32:Break Big String a3


    Hi

    How can I to print a big dynamic sql in Variable

    I tried DBMS_OUTPUT with substr but no work

    Tia

    DB:3.32:Break Big String a3

    If you meant how to print the big result of some sql than try using clob variable:

    set long 100000
    variable x clob

    begin
    dbms_lob.createtemporary(:x, true);
    for i in 1..100000 loop
    :x := :x ||to_char(i);--here add output from your query
    end loop;
    end;
    /

    print xBartek

    Edited by: brtk on 2009-05-13 15:14

  • RELEVANCY SCORE 3.32

    DB:3.32:Re: Variable To A Manipulative Text Sting kk


    Say I want to get the current dimstyle of a drawing.
    Well, I want to set that to a variable, so that I can take bits and pieces of the name by using "substr" and then connecting what I take with something else with "strcat." There are no entities to select. I thought this would work...

    (setq ssccurrent (getvar "dimstyle"))
    (setq length (strlen ssccurrent))

    (cond
    ((= length 13)(setq dimscale (substr 6 1)))
    ((= length 14)(setq dimscale (substr 6 2)))
    ((= length 15)(setq dimscale (substr 6 3)))
    );cond

    ...bloody hell

    DB:3.32:Re: Variable To A Manipulative Text Sting kk

    you should avoid using 'length' as a variable name, and also
    'dimscale'

    Kent, I sort of agree, in a general way. There's a difference between the two, though, in that length is a "reserved word" in lisp, whereas dimscale is an Acad variable. Using a symbol named dimscale doesn't stomp on the variable:

    Command: (setq dimscale 100)
    100
    Command: (getvar 'dimscale)
    48.0

    Whereas misusing the lisp function length does do harm:
    Command: (setq length 100)
    100
    Command: (length '(x y z))
    ; error: bad function: 100

    I don't think this would especially matter outside the present function if the variable length is declared local, but nevertheless it's bad practice to redefine built-in functions. I think it will triggger warnings in VLIDE and compiler errors.

    Some people think it's confusing to use local variables matching the names of system variables, but personally I don't have a problem with it. It just means that your local variable name is the same as the sysvar:

    Command: (setq dimscale (getvar 'dimscale))
    48.0

  • RELEVANCY SCORE 3.31

    DB:3.31: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:3.31: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 3.29

    DB:3.29:Exclude Range In Where Clause In Scripted Calc View x9



    Hi,

    We are trying to create a stored procedure or scripted calc view to join 2 tables. Our requirement is something like below:

    WHERE Substr(SDATA, dynamic_offset, dynamic_length) between range_low and range_high;

    The difficulty we are facing is that the range_low and range_high are coming from select options (it can be single value, multiplesingle values, range, excluding range, excluding outside range). We tried to do it with an internal table and = and = in the foll way:

    FROM:IT_RANGE as range

    WHERE

    /* Including Range*/

    (substr(A.SDATA, :i_offset, :i_length) = range.low

    AND substr(A.SDATA, :i_offset, :i_length) = range.high

    But the difficulty now is with the other options. How to make it work in a way that this could work for all the options that we have inthe SELECT-OPTIONS?

    We cannot fill the complete range table (and use it as a IN clause) already from ABAP because the field is dynamic (coming from substr(A.SDATA, :i_offset, :i_length)) and it is not possible to get the list in ABAP itself.

    We prefer to use a scripted calc view, because of the complexity of the above, we put this condition in calculation view itslef and then put the additional where conditions in the ABAP coding itself.

    Thanks a lot.

    DB:3.29:Exclude Range In Where Clause In Scripted Calc View x9


    Hi,

    We are trying to create a stored procedure or scripted calc view to join 2 tables. Our requirement is something like below:

    WHERE Substr(SDATA, dynamic_offset, dynamic_length) between range_low and range_high;

    The difficulty we are facing is that the range_low and range_high are coming from select options (it can be single value, multiplesingle values, range, excluding range, excluding outside range). We tried to do it with an internal table and = and = in the foll way:

    FROM:IT_RANGE as range

    WHERE

    /* Including Range*/

    (substr(A.SDATA, :i_offset, :i_length) = range.low

    AND substr(A.SDATA, :i_offset, :i_length) = range.high

    But the difficulty now is with the other options. How to make it work in a way that this could work for all the options that we have inthe SELECT-OPTIONS?

    We cannot fill the complete range table (and use it as a IN clause) already from ABAP because the field is dynamic (coming from substr(A.SDATA, :i_offset, :i_length)) and it is not possible to get the list in ABAP itself.

    We prefer to use a scripted calc view, because of the complexity of the above, we put this condition in calculation view itslef and then put the additional where conditions in the ABAP coding itself.

    Thanks a lot.

  • RELEVANCY SCORE 3.28

    DB:3.28: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 3.28

    DB:3.28:Re: How To Get Substr To Consider Line Feeds km


    Use combination of substr and ascii to work out exactly what character(s) are your line feeds.Then use replace to change them into spaces.Then your logic is a lot simpler....

    DB:3.28:Re: How To Get Substr To Consider Line Feeds km

    If you take text with newline characters on Linux and then copy/paste that text (or FTP it) to windows to put it in an editor and count characters there, then all chr(10) newline character from Linux will typically be converted to chr(13)||chr(10) pairs on Windows meaning you gain characters as part of that process. That's not a good way to check for the count of characters.As already mentioned you need to provide an example of some data and code to demonstrate the issue, so we can see for ourselves exactly what you are doing.

  • RELEVANCY SCORE 3.27

    DB:3.27:How To Specify A Column Larger Than 4000 Characters In Data Template? zs


    How to create XML from data template if a column in the query has more than 4000 characters (restriction of the SELECT statement is 4000)? E.g.

    select length(col) from
    (select lpad('.',5000,'.') col from dual)

    returns only 4000.

    The obvious solution would be to use substr, e.g.

    select substr(col,1,4000), substr(col,4001,4000) .... (ugly!)

    Is it possible to include CLOB or varchar24000 in data template?

    DB:3.27:How To Specify A Column Larger Than 4000 Characters In Data Template? zs

    How to create XML from data template if a column in the query has more than 4000 characters (restriction of the SELECT statement is 4000)? E.g.

    select length(col) from
    (select lpad('.',5000,'.') col from dual)

    returns only 4000.

    The obvious solution would be to use substr, e.g.

    select substr(col,1,4000), substr(col,4001,4000) .... (ugly!)

    Is it possible to include CLOB or varchar24000 in data template?

  • RELEVANCY SCORE 3.27

    DB:3.27:Using A Sum Query In Oracle Forms 31


    Greedings,

    I have the following query which works fine in PL/SQL but i cant get it working in Oracle forms as i get an error in SUM(SELECT...) . Any quidance on how i should fix my query to work in Forms?

    select
    Sum((SELECT kl.amount
    FROM S03_a_salfldg@oracle_to_sun kl
    WHERE Trim(kl.accnt_code)=Trim(a.acnt_code)
    AND kl.period between 2008001 AND 2008012 AND ROWNUM=1)) AS actual
    from so_budgets_cat a,a01_acnt@oracle_to_sun b,so_budgets_com c,so_budgets d
    where trim(a.acnt_code)=trim(b.acnt_code)
    AND a.cat=c.cat
    AND TRIM(d.acnt_code)=trim(a.acnt_code)
    AND d.business_object=10000103883
    AND d.business_object=c.bus_object
    AND d.business_object=a.business_object
    AND SubStr(d.period,1,4)=Trim(c.PERIOD_Y)
    AND C.period_Y BETWEEN substr(2008001,1,4) AND substr(2008001,1,4)
    GROUP BY a.cat,a.acnt_code,c.com,a.cat_desc,b.descr,d.acnt_code
    order by a.cat,a.acnt_code,c.com,a.cat_desc,b.descrThanks in advance

    DB:3.27:Using A Sum Query In Oracle Forms 31

    nice suggestion francois havn't thought of that.
    I will move the text item to a new block and just change the from clause there.
    Thanks for the help

  • RELEVANCY SCORE 3.26

    DB:3.26:Please Help Me : Substr Function In Oracle 6i cd


    Dear all people!
    I have a problem with SUBSTR as follow:
    my code:
    "
    declare
    string1 varchar2(300);
    string2 varchar2(65);
    begin
    string1 := ....
    string2 := substr(string1,1,60);
    end;
    "
    when i run program in debug
    at command "string2 := substr(string1,1,60);" it raise error ORA-06502;
    Please tell me how to assign substr(string1,1,60) to string2 (max length of string2 is 65);

    I'm looking to forward to receiving your response!
    Thank you very much;

    DB:3.26:Please Help Me : Substr Function In Oracle 6i cd

    Dear all people!
    I have a problem with SUBSTR as follow:
    my code:
    "
    declare
    string1 varchar2(300);
    string2 varchar2(65);
    begin
    string1 := ....
    string2 := substr(string1,1,60);
    end;
    "
    when i run program in debug
    at command "string2 := substr(string1,1,60);" it raise error ORA-06502;
    Please tell me how to assign substr(string1,1,60) to string2 (max length of string2 is 65);

    I'm looking to forward to receiving your response!
    Thank you very much;

  • RELEVANCY SCORE 3.26

    DB:3.26:Query Is Slow 78


    Hi All,
    I am facing a problem,the below query is taking time to get executed and it's cost is high

    SELECT TO_NUMBER(CT.CT_REFERENCE) INVOICE_NUMBER,
    CR.RECEIPT_NUMBER,
    CR.RECEIPT_DATE,
    PS.TRX_DATE ,
    PS.GL_DATE,
    RAP.APPLY_DATE,
    PS.AMOUNT_DUE_ORIGINAL ORIGNAL_BALANCE,
    PS.AMOUNT_DUE_REMAINING CURRENT_BALANCE,
    PS.AMOUNT_LINE_ITEMS_ORIGINAL INVOICE_AMOUNT,
    RAP.AMOUNT_APPLIED,
    CR.CONFIRMED_FLAG,
    CR.REVERSAL_CATEGORY
    FROM RA_CUSTOMER_TRX_ALL CT,
    AR_PAYMENT_SCHEDULES_ALL PS,
    AR_RECEIVABLE_APPLICATIONS_ALL RAP,
    AR_CASH_RECEIPTS_ALL CR
    WHERE CT.CUSTOMER_TRX_ID =PS.CUSTOMER_TRX_ID
    AND RAP.APPLIED_PAYMENT_SCHEDULE_ID=PS.PAYMENT_SCHEDULE_ID
    AND CR.CASH_RECEIPT_ID = RAP.CASH_RECEIPT_ID
    AND PS.CUSTOMER_TRX_ID =RAP.APPLIED_CUSTOMER_TRX_ID
    --AND CR.RECEIPT_NUMBER='7050'
    AND CT.BATCH_SOURCE_ID IN ('1067','1027','1087')
    AND SUBSTR(CT.CT_REFERENCE,1,4) '2004'
    AND SUBSTR(CT.CT_REFERENCE,1,4) '2005'
    AND SUBSTR(CT.CT_REFERENCE,1,4) '2006'
    AND SUBSTR(CT.CT_REFERENCE,1,4) '2007'
    AND SUBSTR(CT.CT_REFERENCE,1,4) '2008'
    AND SUBSTR(CT.CT_REFERENCE,1,4) '2009'
    AND SUBSTR(CT.CT_REFERENCE,1,4) '2010'
    AND cr.REVERSAL_CATEGORY! ='REV';
    please suggest ..

    DB:3.26:Query Is Slow 78

    First go thru' the questions/suggestions from earlier responses. They will most likely lead you to an answer.

    But in case they don't, here is just a guess. I don't know the data distribution at your client so I could very well be wrong.

    Typically, ra_customer_trx_all has a large number of records and typically. the batch_source_id and ct_reference columns are not indexed.

    You are querying against this table with non-indexed columns.
    Consider adding an index on batch_source_id and then rerun the query.
    If you have too many records in the batch, you may want to add an index on ct_reference. But most likely that won't be necessary.

    Don't forget to rerun stats after creating any new index.

    Sandeep Gandhi

  • RELEVANCY SCORE 3.24

    DB:3.24:Discoverer Condition Edit Problem 7a


    We are using the Discoverer 4.1 user edition and the database is 9i (9.2.0). In the user edition we have a query set up with conditions using substr function, when the query is executed the result comes up right( and the column name within the substr function is in double quotes at that time) , but if we go and edit the condition , I mean overwrite the substr function with the coulmn names we want the double quotes are changed to a single quote and the results are incorrect and sometimes we even get no records found. The only work around is to delete the substr condition and rewrite it again. Please let me know if you have any ideas. The user's were using the discoverer 3.1 before and didn't have this problem, they were able to easily edit the conditions.We are using the new Discoverer 4.1 on windows XP.

    Thanks,
    Nilima

    DB:3.24:Discoverer Condition Edit Problem 7a

    We are using the Discoverer 4.1 user edition and the database is 9i (9.2.0). In the user edition we have a query set up with conditions using substr function, when the query is executed the result comes up right( and the column name within the substr function is in double quotes at that time) , but if we go and edit the condition , I mean overwrite the substr function with the coulmn names we want the double quotes are changed to a single quote and the results are incorrect and sometimes we even get no records found. The only work around is to delete the substr condition and rewrite it again. Please let me know if you have any ideas. The user's were using the discoverer 3.1 before and didn't have this problem, they were able to easily edit the conditions.We are using the new Discoverer 4.1 on windows XP.

    Thanks,
    Nilima

  • RELEVANCY SCORE 3.24

    DB:3.24:Using (+) In A Substr Query fj


    Hi ,

    i have the original query as
    SELECT * FROM View1 A , View2 B
    WHERE A.ITEM_ID = B.ITEM_ID(+)

    values for ITEM_ID is ABC.01
    ABC.02 ... 99

    values for ITEM_NAME is ABC

    however, when i changed it to

    SELECT * FROM View1 A , View2 B
    WHERE SUBSTR(A.ITEM_ID ,1 ,INSTR(A.ITEM_ID) - 1) =
    SUBSTR(b.ITEM_ID ,1 ,INSTR(b.ITEM_ID) - 1)(+)

    It does not work

    how is it possible to use the substr together with the outer join clause besides , putting the ITEM_NAME as part of the source view ?

    please advise

    tks rgds

    DB:3.24:Using (+) In A Substr Query fj

    user517698 wrote:
    i have thought that the (+) operator if placed on the right side of the join is equivalent to a LEFT OUTER JOIN (which i seldom used)Yes, that is correct, however, the ANSI syntax is somewhat clearer and more flexible.

  • RELEVANCY SCORE 3.24

    DB:3.24:Sql Query To Get The Current Session Info 73


    I've a query in my application to view the all the sessions within database
    select
    substr(a.spid,1,9) pid,
    substr(b.sid,1,5) sid,
    substr(b.serial#,1,5) ser#,
    substr(b.machine,1,6) box,
    substr(b.username,1,10) username,
    -- b.server,
    substr(b.osuser,1,8) os_user,
    substr(b.program,1,30) program
    from
    v$session b,
    v$process a
    where
    b.paddr = a.addr
    and type='USER'
    order by spid;

    Can someone help me with a query to view the info of the session where I'm in currently?

    Thanks,
    Gabriel Stephen.

  • RELEVANCY SCORE 3.23

    DB:3.23: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:3.23:Defining View With Phantom Columns? 1z

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

  • RELEVANCY SCORE 3.23

    DB:3.23:Details: Ora-00911: Invalid Character In Crystal Report Xi 7f


    am sorry i dont want to include a whole query but just for anybody willing to help me on this can see the whole picture.

    When i run following query on the crystal reports XI version I get error But the report works fine but if i run the same query in Oracle get no erro

    SELECT DISTINCT
    upper(n.atm_name) atm_name
    ,m.timestamp,nvl(n.ID,'') atm_id,nvl(b.branch,'') brn_code,nvl(upper(b.ename),'') brn_name,nvl(m.p15_date_set,'') bday, bws_gen.format_ddmm(SUBSTR(m.p07_trans_dt,1,4)) trn_date, bws_gen.format_hhmmss(SUBSTR(m.p07_trans_dt,5,6)) trn_time
    , bws_gen.format_ddmm(SUBSTR(m.p07_trans_dt,1,4))||' '||bws_gen.format_hhmmss(SUBSTR(m.p07_trans_dt,5,6 )) trn_dt
    , bws_gen.format_ddmm(m.p13_date_local_txn) local_date, bws_gen.format_hhmmss(m.p12_time_local_txn) local_time
    ,bws_gen.format_ddmm(m.p13_date_local_txn)||' '||bws_gen.format_hhmmss(m.p12_time_local_txn) local_dt, '' tseq,'' onl
    , nvl(substr(m.s102_acc_id1,1,12),'') s102_acc_id1, nvl(substr(m.s103_acc_id2,1,12),'') s103_acc_id2,nvl(SUBSTR(m.p02_pan,1,6),'') imd,nvl(SUBSTR(m.p02_pan,7,16),'') crd_no,nvl(TO_NUMBER(m.p23_crd_seq_num),0) crd_seq
    , nvl(m.p32_acq_inst_id_code,'') acquirer_code
    ,DECODE(bws_gen.raw_to_string(SUBSTR(mreq.p61_rese rved_prv, 3,4),4)
    ,'00', 'Not Tran','01', 'Unconfirmed Dispense','20', 'FastCash','29', 'TCheques', decode(substr(m.p03_pcode,1,2),'99',' - Loro')||

    DECODE(bws_gen.raw_to_string(SUBSTR(mreq.p61_reser ved_prv, 1,2),2),0,' Reversal',7,' Reversal',8,' Reversal') tx_type_s

    , nvl(m.p04_amt_txn,0) amount

    , bc.currency cur

    , m.p28_amt_txn_fee

    , SUBSTR(m.p41_crd_ac_trm_id,1,4) brn

    , SUBSTR(m.p41_crd_ac_trm_id,5,4) txna_atm_id

    , cd.branch_id Crd_Brn

    , m.p03_pcode proc_code

    , m.p04_amt_txn

    , m.p05_amt_set

    , m.p06_amt_crd_bil

    , nvl(m.p11_stan,'')

    , nvl(m.p17_date_capt,'') txna_bday

    , nvl(m.p20_pan_ext_cc,'')

    , decode(substr(m.p03_pcode,1,2),'99',to_number(SUBS TR(m.p37_rrn,9,4)) - 1,SUBSTR(m.p37_rrn,9,4)) seq

    , nvl(SUBSTR(m.p37_rrn,9,4),'') seq

    , nvl(m.p49_cc_txn,'')

    , nvl(m.p50_cc_set,'')

    , nvl(m.p51_cc_crd_bil,'')

    , decode(substr(m.p03_pcode,1,2),'99','599',bws_gen. raw_to_string(mreq.p61_reserved_prv,6)) fun

    , DECODE(m.c1_mti,'0210',decode(to_number(nvl(c.ext_ reason_code,'0')),3,'Offline','Online') ,'0230','Offline','0430','Reversal') txtAuthorization

    , nvl(m.s103_acc_id2,'')

    , nvl(cd.branch_id,999) Crd_Brn

    , nvl(to_char(cd.branch_id),'') Crd_Brnch

    , DECODE(m.p39_rsp_code,'00','','10','','11','','16' ,'','R') reject_reason

    FROM gw_iso_msg m

    inner join bws_atm_network n

    on substr(m.p41_crd_ac_trm_id,5,4) = n.id

    inner join bws_branches b

    on n.branch = b.brn_id

    inner join gw_txn_ctrl c

    on m.msg_num = c.rsp_num

    inner join gw_iso_msg mreq

    on mreq.msg_num = c.rq_num

    left outer join cms_card cd

    on cd.card_num = m.p02_pan

    AND cd.seq_num = to_number(m.p23_crd_seq_num)

    inner join bwcurrency bc

    on n.currency = bc.isocurrencycode

    WHERE bws_gen.raw_to_string(mreq.p61_reserved_prv,2) IN (0,5,6,7,8)

    AND m.c1_mti IN ('0210','0230','0430')

    AND m.p32_acq_inst_id_code = {?p_acquirer}

    AND n.id = {?p_atm_from}

    AND n.id = {?p_atm_to}

    AND m.p15_date_set = {?p_bday}

    ORDER BY nvl(substr(m.s102_acc_id1,1,12),''),m.timestamp

    When opening the crystal report following error occurs:

    Details: ORA-00911: invalid character

    (Database Vendor Code 911)

    Please help out..Thanks regards
    I have been asked to post a question here so i am doing

    DB:3.23:Details: Ora-00911: Invalid Character In Crystal Report Xi 7f

    Hi,

    You're using ODP.NET? I dont believe I've ever seen this kind of syntax using ODP..

    {?p_atm_to}

    I'd probably run a client sqlnet trace to see exactly what the query sent to the database is and try to make sense of it that way.

    By far the most common cause of ora-911 is a semicolon at the end of the query, but doesnt look like thats the case here.

    Cheers,
    Greg

  • RELEVANCY SCORE 3.23

    DB:3.23:Substr For Numbers p8


    I am pulling data from a column that is Number(8) from one table into a column that is Number(5) in a different table. Is there a function like substr that can get the first 5 numbers an insert into the Number(5) column.

    or
    will substr work for numbers too?

    DB:3.23:Substr For Numbers p8

    None of the numbers are negative, right?

  • RELEVANCY SCORE 3.23

    DB:3.23:Regd;- Substr Function.Datatype. d1


    hi friends,
    how to get a sub string of the column value, for which the data type of column is Long.
    because substr only consider varchar datatype.
    and my string parameter getting more 4000 length. so varchar2 will not be work.

    which datatype suitable for substr to work?

    DB:3.23:Regd;- Substr Function.Datatype. d1

    You can refer to the below code for reference

    SQL create table lobtest(col_1 number, col_2 clob);

    Table created.

    SQL ed
    Wrote file afiedt.buf

    declare
    v_data varchar2(32767);
    begin
    delete lobtest;
    for i in 1..1260 loop
    v_data := v_data||'Testing dbms_lob.substr';
    end loop;
    insert into lobtest values (1,v_data);
    commit;
    end;
    /

    SQL /

    PL/SQL procedure successfully completed.

    SQL select dbms_lob.substr(col_2,4000,8001) val
    from lobtest
    /

    val
    --------------------------------------------------------------------------------
    bstrTesting dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob.substrTesting
    dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob.s
    ubstrTesting dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob.substrTestin
    g dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob.
    substrTesting dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob.substrTesti
    ng dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob
    .substrTesting dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob.substrTest
    ing dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob.substrTesting dbms_lo
    b.substrTesting dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob.substrTes
    ting dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob.substrTesting dbms_l
    ob.substrTesting dbms_lob.substrTesting dbms_lob.substrTesting dbms_lob.substrTe
    ..............

  • RELEVANCY SCORE 3.23

    DB:3.23:Extract From Comma Separated String 31


    Hi,

    I have a comma separated value coming in a column. I am able to extract the values separately using combination of substr, instr function.
    However I am not able to control the end point of the concatenated value.

    Any inputs would be appreciated.
    Here is my Eg:
    select table_name,
    table_column_names,
    substr(table_column_names, 1, instr(table_column_names,',',1,1)-1), -- first col
    substr(table_column_names, instr(table_column_names,',',1,1)+1,
    instr(table_column_names, ',', 1,2)
    - instr(table_column_names, ',', 1,1)-1), -- second col
    substr(table_column_names, instr(table_column_names,',',1,2)+1,
    instr(table_column_names, ',', 1,3)
    - instr(table_column_names, ',', 1,2)-1), -- third col

    from test_tab

    As you can see I can get the 1st, 2nd, 3rd column etc. How do i get the end point .

    Thanks,
    Premjit

    DB:3.23:Extract From Comma Separated String 31

    Note the name of this forum is SQL Developer *(Not for general SQL/PLSQL questions)* (so for issues with the SQL Developer tool). Please post these questions under the dedicated SQL And PL/SQL forum.

    Regards,
    K.

  • RELEVANCY SCORE 3.22

    DB:3.22:How To Align A Backspace Button In Sql Form pz


    hi all,how to make to work a backspace button in oracle form for virtual keyboard.DECLARE TEST number;BEGIN TEST:=length( :TEXT);-- :TEXT:=test||chr(8);:TEXT:=substr(:text,1,test-1);END;this won't work properly..

    DB:3.22:How To Align A Backspace Button In Sql Form pz

    just see the entire coding. its to develop a virtual keyboard for touch screens. the alphabets and numeric letters are working properly. i cant able to develop the 'backspace', 'delete', 'enter' buttons. is there any other ways to develop these buttons.,?

  • RELEVANCY SCORE 3.22

    DB:3.22:Help With Writing File k7


    Hi,In have the following piece of code where if I try to change the following string n8_rec.TELINK_8N_UPC_CODE:= '00'||RPAD(SUBSTR(TO_CHAR(NVL(TRIM(c_lin_rec.UPC_CODE_8N ),' ')),1,10),10,' ');to n8_rec.TELINK_8N_UPC_CODE:= '00'||RPAD(SUBSTR(TO_CHAR(NVL(TRIM(c_lin_rec.UPC_CODE_8N ),' ')),1,14),10,' ');I do not get any output in the file. I am trying to write all the 14 digits from the column UPC_CODE_8N into the file.FOR c_lin_rec IN c_lin(c_hdr_rec.inv_header_id) LOOP BEGIN Fnd_File.put_line(Fnd_File.LOG, 'WRITING 8N IN LINE DATA TO FILE - INVOICE NO :'||c_hdr_rec.INVOICE_NUMBER_8L ||' UPC CODE :'||c_lin_rec.UPC_CODE_8N); n8_rec.FILLER_1 := RPAD(' ',1,' '); n8_rec.TELINK_8N_QTY_INV := LPAD(SUBSTR(TO_CHAR(NVL(TRIM(c_lin_rec.QTY_INV_8N),' ')),1,11),11,' '); n8_rec.TELINK_8N_UNIT_MEAS := RPAD(SUBSTR(TO_CHAR(NVL(TRIM(c_lin_rec.UNIT_MEAS_8N),' ')),1,2),2,' '); n8_rec.FILLER_2 := RPAD(' ',1,' '); n8_rec.TELINK_8N_ITEM_COST := LPAD(SUBSTR(TO_CHAR(NVL(TO_NUMBER(TRIM(c_lin_rec.ITEM_COST_8N)),0),'999999.000'),2,10),10,' '); n8_rec.TELINK_8N_UPC_CODE := '00'||RPAD(SUBSTR(TO_CHAR(NVL(TRIM(c_lin_rec.UPC_CODE_8N ),' ')),1,10),10,' '); n8_rec.TELINK_8N_PRICE_BRK := RPAD(SUBSTR(TO_CHAR(NVL(TRIM(c_lin_rec.PRICE_BRK_8N),' ')),1,3),3,' '); n8_rec.FILLER_3 := RPAD(' ',1,' '); n8_rec.TELINK_8N_NO_SHIPPED := LPAD(SUBSTR(TO_CHAR(NVL(TRIM(c_lin_rec.NO_SHIPPED_8N),' ')),1,11),11,' '); n8_rec.TELINK_8N_NO_MEAS_CODE := RPAD(SUBSTR(TO_CHAR(NVL(TRIM(c_lin_rec.NO_MEAS_CODE_8N ),' ')),1,2),2,' '); n8_rec.TELINK_8N_PRC_LIST_NO := RPAD(SUBSTR(TO_CHAR(NVL(TRIM(c_lin_rec.PRC_LIST_NO_8N),' ')),1,16),16,' '); n8_rec.TELINK_8N_PRC_LIST_IS := RPAD(SUBSTR(TO_CHAR(NVL(TRIM(c_lin_rec.PRC_LIST_IS_8N),' ')),1,16),16,' '); n8_rec.FILLER_N := RPAD(' ',23,' '); UTL_FILE.put_line(l_file,G_8N_REC||l_vendor||n8_rec.FILLER_1||n8_rec.TELINK_8N_QTY_INV||n8_rec.TELINK_8N_UNIT_MEAS ||n8_rec.FILLER_2||n8_rec.TELINK_8N_ITEM_COST||n8_rec.TELINK_8N_UPC_CODE ||n8_rec.TELINK_8N_PRICE_BRK||n8_rec.FILLER_3||n8_rec.TELINK_8N_NO_SHIPPED||n8_rec.TELINK_8N_NO_MEAS_CODE ||n8_rec.TELINK_8N_PRC_LIST_NO||n8_rec.TELINK_8N_PRC_LIST_IS||n8_rec.FILLER_N ||l_rec_term); END;Any help would be appreciated.ThanksA/A

    DB:3.22:Help With Writing File k7

    Hi,
    379746 wrote:

    Hi,
    In have the following piece of code where if I try to change the following string

    n8_rec.TELINK_8N_UPC_CODE
    := '00'||RPAD(SUBSTR(TO_CHAR(NVL(TRIM(c_lin_rec.UPC_CODE_8N ),' ')),1,10),10,' ');

    to

    n8_rec.TELINK_8N_UPC_CODE
    := '00'||RPAD(SUBSTR(TO_CHAR(NVL(TRIM(c_lin_rec.UPC_CODE_8N ),' ')),1,14),10,' ');

    I do not get any output in the file.
    ...

    The 2nd argument to RPAD is 10; that means RPAD will always return a string that has exactly 10 characters. However, the 1st argument to RPAD can be 14 characters long. I would expect the 3rd argument to SUBSTR to be the same as the 2nd argument to RPAD, like they were in the original code.That might explain why you're getting the wrong result, but it wouldn't explain why you're not getting any results, right or wrong.Whenever you have a question, please post a little sample data (CREATE TABLE and INSERT statements) for all the tables involved (relevant columns only), so the people who want to help you can re-create the problem and test their ideas. Also post your complete code, and the results you want from that data, with an explanation of how you get those results from that data.Explain, using specific examples, how you get those results from that data.Simplify the problem as much as possible. Don't include the parts you're not having trouble with.Always say what version of Oracle you're using (e.g. 11.2.0.2.0).See the forum FAQ: https://forums.oracle.com/message/9362002I am trying to write all the 14 digits from the column UPC_CODE_8N into the file.Then don't use SUBSTR at all.

  • RELEVANCY SCORE 3.22

    DB:3.22:Re: Dont Understand Diesel 8s


    I am trying to place a field in a piece of text that gets the sheet number
    from the filename.

    My file name.... 05015-S4.dwg.

    $(SUBSTR,$(GETVAR,DWGNAME),7,2)

    Will return S4

    and if I have a filename of 05015-S15
    I know how to get S15

    $(SUBSTR,$(GETVAR,DWGNAME),7,3)

    I just cant figure out how to write an IF statement to work for both, here
    is what I have so far:

    $(IF,$(=,$(SUBSTR,$(GETVAR,DWGNAME),10,1),"."),$(S​UBSTR,$(GETVAR,DWGNAME),7,2),$(SUBSTR,$(GETVAR,DWG​NAME),7,3))

    it returns.... $(IF,??)

    Rick

    DB:3.22:Re: Dont Understand Diesel 8s

    Glad to help you...¦-)

    Cheers
    --
    Juerg Menzi
    MENZI ENGINEERING GmbH, Switzerland
    http://www.menziengineering.ch

  • RELEVANCY SCORE 3.22

    DB:3.22:Different Substr() Results From Two Databases ps


    I've got two separate databases on the same machine using the same version of Oracle (10.2.0.1.0). When I execute the exact same selection (below) in both databases I get different results.

    SQL select substr(ucx_key,1,12) from ucx;

    The ucx_key is defined as CHAR(36) in both databases. Below are the results of this selection in both databases. What can be going on here? The best I can figure is that the NLS_CHARACTERSET is impacting the results.

    Character Set: US7ASCII
    SQL select substr(ucx_key,1,12) from ucx;
    SUBSTR(UCX_KEY,1,12)
    ------------------------------------
    D20 BANNER
    D20 BLOCKP

    Character Set: WE8ISO8859P1
    SQL select substr(ucx_key,1,12) from ucx;
    SUBSTR(UCX_K
    ------------
    D20 BANNER
    D20 BLOCKP

    Notice that the WE8ISO8859P1 database spits out the results as expected. The US7ASCII version does not. Can someone explain this to me and give me a hint on where to go to get the US7ASCII database to do this?

    I have done a "COLUMN key FORMAT a12;" which does work but I'd just as soon not have to use that.

    Many thanks in advance for any help!

    DB:3.22:Different Substr() Results From Two Databases ps

    After checking some settings related to fixing another problem, I noticed that one of my scripts that worked this morning suddenly stopped working re: substr(). As it turns out, this problem is caused by setting cursor_sharing=FORCE. The default cursor_sharing setting allows substr() to behave as I expect it to. The FORCE setting causes problems for substr().

  • RELEVANCY SCORE 3.22

    DB:3.22:How To Use Substr Function On Long Data Type In Oracle 9i m3


    Hi,

    I have to pick some values from a long data type column , as substr functions does not work on long please help me out on this problem.

    Any suggestion is appreciated.

    DB:3.22:How To Use Substr Function On Long Data Type In Oracle 9i m3

    Tip for this question!!!

    set pagesize 200
    set linesize 220
    drop table temp_validacion;
    create global temporary table temp_validacion( table_owner varchar2(30),
    table_name varchar2(30), column_name varchar2(30), data varchar2(4000));

    declare
    cursor my_cursor is
    select table_owner, table_name, column_name, trigger_body
    from dba_triggers
    where table_owner='CEMACONAF';
    V_OWNER VARCHAR2(30);
    V_TABLE_NAME VARCHAR2(30);
    V_COLUMN_NAME VARCHAR2(30);
    my_var varchar2(32000);
    begin
    open my_cursor;
    loop
    fetch my_cursor into V_OWNER, V_TABLE_NAME, V_COLUMN_NAME,my_var;
    exit when my_cursor%notfound;
    my_var := substr(my_var,1,4000);
    insert into temp_validacion values (V_OWNER, V_TABLE_NAME, V_COLUMN_NAME, my_var);
    end loop;
    close my_cursor;
    end;
    /

  • RELEVANCY SCORE 3.22

    DB:3.22: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:3.22: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 3.22

    DB:3.22:Help With Sql Code 1x


    Hi having a slight problem with some SQL code -

    We store a number of actions they get given a date_done, a Y if we Met_Customer, a Y if we had an Upsell_Apps , a Y if we Upsell_Other, a Y if there was a reference and a Y if there was an issue. The action must have a date, but can have none to any of the Y's

    We want SQL to report back the number of actions (so the count) broken down into the months of the date_done - so Aug 07, Sep 07 etc etc. And this again broken down for Met_customer, Upsell_apps, upsell_other, reference and issue.

    We want it to look something like this...

    Action Type-------------------- Oct06 | Nov06 | Dec06 | Jan07
    Met Customer--------------------12--------8-----------4----------2
    Upsell App-------------------------21--------0-----------1----------3
    Upsell Other-----------------------0---------1-----------3----------1
    Reference---------------------------2---------6----------7----------3
    Issue---------------------------------0----------0----------1----------0

    So if an action on 12-Oc-06 had a Y in Met_customer and Y in Upsell_app it would be counted twice in the above - whereas below it does not work like that...

    At the moment the code is producing something like the following...

    MET_CUST | USPELL_APP | UPSELL_OTHER | REFERENCE | ISSUE | Oct06 | Nov06
    ------Y------------------------------------------------------------------------------------------------------12--------2
    ------Y-------------------Y---------------------------------------------------------------------------------11--------0
    ---------------------------Y----------------------------------------------------------------------------------1---------3
    ------------------------------------------------------Y-------------------------------------------Y----------6---------0
    --------------------------------------------------------------------------------Y-----------------------------2---------1
    ---------------------------------------------------------------------------------------------------Y----------0----------1
    ---------------------------------------------------------------------------------------------------------------1---------1

    This is the code we're using

    SELECT
    ACTION_MET_CUSTOMER,
    ACTION_UPSELL_APPS,
    ACTION_UPSELL_OTHER,
    ACTION_REFERENCE,
    ACTION_ISSUE,
    SUM ( decode( substr(DATE_DONE,-3,1), '-', cnt, null ) ) TOTAL,
    SUM ( decode( substr(DATE_DONE,-6,6), 'OCT-06', cnt, null ) ) OCT06,
    SUM ( decode( substr(DATE_DONE,-6,6), 'NOV-06', cnt, null ) ) NOV06,
    SUM ( decode( substr(DATE_DONE,-6,6), 'DEC-06', cnt, null ) ) DEC06,
    SUM ( decode( substr(DATE_DONE,-6,6), 'JAN-07', cnt, null ) ) JAN07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'FEB-07', cnt, null ) ) FEB07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'MAR-07', cnt, null ) ) MAR07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'APR-07', cnt, null ) ) APR07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'MAY-07', cnt, null ) ) MAY07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'JUN-07', cnt, null ) ) JUN07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'JUL-07', cnt, null ) ) JUL07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'AUG-07', cnt, null ) ) AUG07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'SEP-07', cnt, null ) ) SEP07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'OCT-07', cnt, null ) ) OCT07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'NOV-07', cnt, null ) ) NOV07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'DEC-07', cnt, null ) ) DEC07,
    SUM ( decode( substr(DATE_DONE,-6,6), 'JAN-08', cnt, null ) ) JAN08,
    SUM ( decode( substr(DATE_DONE,-6,6), 'FEB-08', cnt, null ) ) FEB08,
    SUM ( decode( substr(DATE_DONE,-6,6), 'MAR-08', cnt, null ) ) MAR08,
    SUM ( decode( substr(DATE_DONE,-6,6), 'APR-08', cnt, null ) ) APR08,
    SUM ( decode( substr(DATE_DONE,-6,6), 'MAY-08', cnt, null ) ) MAY08

    FROM
    (SELECT ACTION_MET_CUSTOMER, ACTION_UPSELL_APPS, ACTION_UPSELL_OTHER, ACTION_REFERENCE, ACTION_ISSUE, DATE_DONE, COUNT(*) CNT FROM ACTIONS, EMPLOYEE
    WHERE ACTION_OWNER = NAME

    GROUP BY ACTION_MET_CUSTOMER, ACTION_UPSELL_APPS, ACTION_UPSELL_OTHER, ACTION_REFERENCE, ACTION_ISSUE, DATE_DONE)

    GROUP BY
    ACTION_MET_CUSTOMER, ACTION_UPSELL_APPS, ACTION_UPSELL_OTHER, ACTION_REFERENCE, ACTION_ISSUE

    Any ideas to get it looking how id ideally like it?

    Cheers, would be a great help

    S

    DB:3.22:Help With Sql Code 1x

    i think i would have to do the count outside this statement as you cant group on the dates and the owner - as they can be different

  • RELEVANCY SCORE 3.21

    DB:3.21:How To Join To Column Details To Get Desired Output f3


    Kindly refer the attached queries namely
    1)REORDER
    2)PENDING WORKORDER

    I want to calculate the work order requirement on basis of
    Stock, Pending sales order, re-order level and already entered workorders. Now i want to add the first column of 2nd query in the report of 1st query. For that i tried the below statements

    AND ITEM_CODE = LCS_ITEM_CODE (+)
    AND ITEM_CODE = SOI_ITEM_CODE (+)
    AND ITEM_CODE = PWH_ITEM_CODE (+)

    LCS_ITEM_CODE is Stock table item_code,
    SOI_ITEM_CODE is Sales order item_code,
    PWH_ITEM_CODE is Production work order item_code,

    When the above statments used while combining the 2 queries does display the result, but the details comes only for the ietm_codes whose work orders are present.

    Kindly guide me how can i get the desired output.

    1)RE-ORDER QUERY :

    SELECT DISTINCT ITEM_CODE,
    ITEM_NAME,
    (CASE
    WHEN SUBSTR(ITEM_CODE,11,3) = '000' THEN 'LOOSE'
    ELSE SUBSTR(ITEM_CODE,11,4)
    END) PKG_SIZE,
    ((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)) STOCK,
    (CASE
    WHEN SUM(TO_NUMBER(SOI_QTY
    ||'.'
    ||SOI_QTY_LS) - (SOI_INVI_QTY_BU / IU_CONV_FACTOR / IU_MAX_LOOSE_1)) 0 THEN 0
    ELSE SUM(TO_NUMBER(SOI_QTY
    ||'.'
    ||SOI_QTY_LS) - (SOI_INVI_QTY_BU / IU_CONV_FACTOR / IU_MAX_LOOSE_1))
    END) PNDG,
    ((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)) - SUM(TO_NUMBER(SOI_QTY
    ||'.'
    ||SOI_QTY_LS) - (SOI_INVI_QTY_BU / IU_CONV_FACTOR / IU_MAX_LOOSE_1)) NETSTK,
    ITEM_RORD_LVL REORD_LVL,
    (CASE
    WHEN ((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)) - SUM(TO_NUMBER(SOI_QTY
    ||'.'
    ||SOI_QTY_LS) - (SOI_INVI_QTY_BU / IU_CONV_FACTOR / IU_MAX_LOOSE_1)) 0
    AND ITEM_RORD_LVL 0 THEN ((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)) - SUM(TO_NUMBER(SOI_QTY
    ||'.'
    ||SOI_QTY_LS) - (SOI_INVI_QTY_BU / IU_CONV_FACTOR / IU_MAX_LOOSE_1))
    ELSE NVL(ITEM_RORD_LVL,0) - (((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)) - SUM(TO_NUMBER(SOI_QTY
    ||'.'
    ||SOI_QTY_LS) - (SOI_INVI_QTY_BU / IU_CONV_FACTOR / IU_MAX_LOOSE_1)))
    END) REQ,
    DECODE(ITEM_RORD_QTY_LS,NULL,ITEM_RORD_QTY,
    (ITEM_RORD_QTY
    ||'.'
    ||ITEM_RORD_QTY_LS)) BTCHSZE
    FROM OM_ITEM,
    OT_SO_HEAD,
    OT_SO_ITEM,
    OM_ITEM_UOM,
    OS_LOCN_CURR_STK
    WHERE (ITEM_UOM_CODE = IU_UOM_CODE
    AND ITEM_CODE = IU_ITEM_CODE)
    AND ITEM_CODE = LCS_ITEM_CODE (+)
    AND ITEM_CODE = SOI_ITEM_CODE (+)
    AND LCS_LOCN_CODE = 'FG'
    AND LCS_ITEM_CODE = SOI_ITEM_CODE
    AND SOI_SOH_SYS_ID = SOH_SYS_ID
    AND SOH_TXN_CODE IN ('SORLLOC',
    'SORLCT3',
    'SORLNPL',
    'EXPFABLK')
    AND NVL(SOH_CLO_STATUS,0) = 0
    AND NVL(SOI_SHORT_CLO_STATUS,2) = 2

    GROUP BY ITEM_CODE,
    ITEM_NAME,
    LCS_STK_QTY_BU,
    LCS_RCVD_QTY_BU,
    LCS_ISSD_QTY_BU,
    IU_MAX_LOOSE_1,
    ITEM_RORD_LVL_LS,
    ITEM_RORD_LVL,
    ITEM_RORD_QTY_LS,
    ITEM_RORD_QTY,
    LCS_ITEM_CODE
    ORDER BY ITEM_CODE ASC

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

    2) WORK-ORDERS QUERY :

    SELECT DISTINCT PWH_NO PWO_NO,
    PWH_DT PWO_DT,
    (CASE
    WHEN PWFGPI_QTY = 0 THEN PWH_ITEM_CODE
    ELSE PWFGPI_ITEM_CODE
    END) ITEMCODE,
    ITEM_NAME PRODUCT_NAME,
    (CASE
    WHEN PWFGPI_QTY = 0 THEN SUM(PWH_QTY)
    ELSE PWFGPI_QTY * SUBSTR(PWFGPI_ITEM_CODE,11,3)
    END) PWO_QTY,
    PSD_PR_ACCP_QTY_BU / 1000 PROD_REP,
    PWH_PS_QTY_BU / 1000 PROD_SLIP_PENDING
    FROM OT_PWO_HEAD,
    OM_ITEM,
    OT_PWO_STAGE_DETAIL,
    OT_PWO_FG_PACKED_ITEM
    WHERE PWH_ITEM_CODE = ITEM_CODE
    AND PWFGPI_PWH_SYS_ID = PWH_SYS_ID
    AND NVL(PWH_CLO_STATUS,0) = 0
    AND PSD_PWH_SYS_ID = PWH_SYS_ID
    AND PWH_PS_QTY_BU / 1000 IS NULL
    GROUP BY PWH_NO,
    PWH_DT,
    PWH_ITEM_CODE,
    ITEM_NAME,
    PWFGPI_ITEM_CODE,
    PWFGPI_QTY,
    PSD_PR_ACCP_QTY_BU,
    PWH_PS_QTY_BU,
    ITEM_CODE
    ORDER BY PWH_NO

    DB:3.21:How To Join To Column Details To Get Desired Output f3

    That's a big query.

    Can I point out that
    (CASE
    WHEN SUM ( TO_NUMBER (soi_qty || '.' || soi_qty_ls)
    - ( soi_invi_qty_bu
    / iu_conv_factor
    / iu_max_loose_1
    )
    ) 0
    THEN 0
    ELSE SUM ( TO_NUMBER (soi_qty || '.' || soi_qty_ls)
    - ( soi_invi_qty_bu
    / iu_conv_factor
    / iu_max_loose_1
    )
    )
    ENDis just

    GREATEST(0, SUM ( TO_NUMBER (soi_qty || '.' || soi_qty_ls)
    - ( soi_invi_qty_bu
    / iu_conv_factor
    / iu_max_loose_1
    )and

    DECODE (item_rord_qty_ls,
    NULL, item_rord_qty,
    (item_rord_qty || '.' || item_rord_qty_ls
    )
    )is just

    RTRIM (item_rord_qty || '.' || item_rord_qty_ls,'.')

  • RELEVANCY SCORE 3.21

    DB:3.21:How To Force An Mv To Go Through A Full Table Scan... p8


    Hi all,

    I'm trying to put a HINT in to this query to have the table MV_CLNT_SCDIM_MRGE go through a full table scan. However, for some reason, the view specification I'm using doesn't seem to work. Can anyone tell me what I should be doing to force the full table scan?

    SELECT
    DISTINCT 1 "c1",
    t1."CALNDR_DT" "c2",
    t2."OFFR_CD_ID" "c3",
    t2."OFFR_COMM_CHNL_DESC" "c4",
    t3."TCLNT_DIM_AGE_BASED_SGMNT_CD" "c5",
    t3."TCLT_DM_CURR_CLNT_BUS_SGMNT_CD" "c6",
    t2."OFFR_NM" "c7",
    t2."CMPGN_NM" "c8",
    t3."TCLNT_DIM_CLNT_DIM_KEY" "c9",
    To_number(To_char(t1."CALNDR_DT", 'YYYY')) "c10", --only yyyy
    DECODE(Substr(t2."OFFR_NM", 1, 3), 'MKT', 'MKT',
    DECODE(Substr(t2."OFFR_NM", 1, 2), 'DP', 'DP',
    DECODE(Substr(t2."OFFR_NM", 1, 2), 'AP', 'DP',
    DECODE(Substr(t2."OFFR_NM", 1, 3), 'PRO','RRO',
    DECODE(Substr(t2."OFFR_NM", 1, 5), 'SCPRO','PRO',
    'NORPT'))))) "c11",
    t4."PGE_NM_SRC_ID" "c12",
    t4."WEB_PGE_NM" "c13",
    To_number(To_char(t1."CALNDR_DT", 'YYYY')) "c14",
    To_number(To_char(t1."CALNDR_DT", 'MM')) "c15",
    To_number(To_char(t1."CALNDR_DT", 'WW')) "c16"

    FROM "OCMADM"."VTRTMT_DIM" t2,
    "OCMADM"."TDT_DIM" t1,
    "OCMADM"."VR_OUTBND_CNTCT" t3,
    "OCMADM"."TWEB_PGE_DIM" t4
    WHERE t2."TRTMT_EFFTV_STRT_DT_DIM_KEY" = t1."DT_DIM_KEY"
    AND t3."TRTMT_DIM_KEY" = t2."TRTMT_DIM_KEY"
    AND t3."WEB_PGE_DIM_KEY" = t4."WEB_PGE_DIM_KEY"
    AND t2."CMPGN_SYS_CD" IN ( 'INT' )
    AND t2."TRTMT_STATUS_CD" = 'ACTV'
    AND To_number(To_char(t1."CALNDR_DT", 'YYYY')) = 2010
    and t3.outbnd_cntct_dt_dim_key 12455197 --recommended by Brian
    AND DECODE(Substr(t2."OFFR_NM", 1, 3), 'MKT', 'MKT',
    DECODE(Substr(t2."OFFR_NM", 1, 2),'DP', 'DP',
    DECODE(Substr(t2."OFFR_NM", 1, 2),'AP', 'DP',
    DECODE(Substr(t2."OFFR_NM", 1, 3),'PRO','RRO',
    DECODE(Substr(t2."OFFR_NM", 1, 5), 'SCPRO','PRO',
    'NORPT'))))) IN ( 'MKT', 'DP', 'PRO' )
    ORDER BY "c6" ASC,
    "c5" ASC,
    "c8" ASC,
    "c7" ASC,
    "c2" ASC,
    "c11" ASC,
    "c10" ASC,
    "c4" ASC,
    "c13" ASC,
    "c12" ASC,
    "c15" ASC,
    "c16" ASC,
    "c9" ASC,
    "c3" ASC

    Thanks, Pete

    DB:3.21:How To Force An Mv To Go Through A Full Table Scan... p8

    Here is the full query with the views and materialized views embedded. You can see the hints we gave this to work. I think it is one of two things... we just don't have the syntax correct or you cannot force the path of execution after a certain number of 'embedded' calls, for lack of a better term.

    SELECT DISTINCT 1 "c1",
    t1."CALNDR_DT" "c2",
    t2."OFFR_CD_ID" "c3",
    t2."OFFR_COMM_CHNL_DESC" "c4",
    t3."TCLNT_DIM_AGE_BASED_SGMNT_CD" "c5",
    t3."TCLT_DM_CURR_CLNT_BUS_SGMNT_CD" "c6",
    t2."OFFR_NM" "c7",
    t2."CMPGN_NM" "c8",
    t3."TCLNT_DIM_CLNT_DIM_KEY" "c9",
    To_number(To_char(t1."CALNDR_DT", 'YYYY')) "c10",
    DECODE(Substr(t2."OFFR_NM", 1, 3), 'MKT', 'MKT',
    DECODE(
    Substr(t2."OFFR_NM", 1, 2), 'DP', 'DP'
    ,
    DECODE(
    Substr(t2."OFFR_NM", 1, 2), 'AP', 'DP'
    ,
    DECODE(
    Substr(t2."OFFR_NM", 1, 3), 'PRO',
    'RRO',
    DECODE(
    Substr(t2."OFFR_NM", 1, 5), 'SCPRO',
    'PRO',
    'NORPT'))))) "c11",
    t4."PGE_NM_SRC_ID" "c12",
    t4."WEB_PGE_NM" "c13"
    FROM "OCMADM"."VTRTMT_DIM" t2,
    "OCMADM"."TDT_DIM" t1,
    ( SELECT /*+ FULL(mv_hhld_dim) FULL(clnt_scdim_mrge) */ tclnt_cmpgn_outbnd_cntct_fact.clnt_cmpgn_outbnd_cntct_key,
    tclnt_cmpgn_outbnd_cntct_fact.outbnd_cntct_dt_dim_key,
    tclnt_cmpgn_outbnd_cntct_fact.trtmt_dim_key,
    tclnt_cmpgn_outbnd_cntct_fact.clnt_scdim_key,
    tclnt_cmpgn_outbnd_cntct_fact.cmpgn_evnt_typ_dim_key,
    tclnt_cmpgn_outbnd_cntct_fact.web_pge_dim_key,
    tclnt_cmpgn_outbnd_cntct_fact.cmpgn_sys_cd,
    tclnt_cmpgn_outbnd_cntct_fact.cntct_tm_dim_key,
    tclnt_cmpgn_outbnd_cntct_fact.etl_procs_key,
    tclnt_cmpgn_outbnd_cntct_fact.etl_ld_ts,
    mv_clnt_dim.tclnt_dim_clnt_dim_key,
    mv_clnt_dim.tclnt_dim_po_id,
    mv_clnt_dim.tclnt_dim_po_typ_cd,
    mv_clnt_dim.tclnt_dim_best_age,
    mv_clnt_dim.tclnt_dim_age_based_sgmnt_cd,
    mv_clnt_dim.tclnt_dim_gendr_cd,
    mv_clnt_dim.tclnt_dim_prspct_incpt_dt,
    mv_clnt_dim.tclnt_dim_entry_dt,
    mv_clnt_dim.tclnt_dim_brth_dt,
    mv_clnt_dim.tclnt_dim_wealth_rnking_cd,
    mv_clnt_dim.tclt_dm_curr_clnt_bus_sgmnt_cd,
    mv_hhld_dim.hhld_dim_key,
    mv_hhld_dim.hhld_id,
    mv_hhld_dim.hhld_bus_sgmnt_cd
    FROM OCMADM.tclnt_cmpgn_outbnd_cntct_fact tclnt_cmpgn_outbnd_cntct_fact
    INNER JOIN OCMADM.mv_clnt_scdim_mrge clnt_scdim_mrge
    ON clnt_scdim_mrge.tclnt_scdim_clnt_scdim_key =
    tclnt_cmpgn_outbnd_cntct_fact.clnt_scdim_key
    INNER JOIN OCMADM.mv_clnt_dim mv_clnt_dim
    ON mv_clnt_dim.tclnt_dim_clnt_dim_key =
    clnt_scdim_mrge.tclnt_mrge_mrged_to_clnt_key
    INNER JOIN (SELECT /*+ FULL(mv) */ THHLD_CLNT_BRDG.HHLD_CLNT_BRDG_KEY AS THHLD_CLNT_BRDG_KEY,
    THHLD_CLNT_BRDG.HHLD_DIM_KEY AS THHLD_CLNT_BRDG_HHLD_DIM_KEY,
    THHLD_CLNT_BRDG.STRT_DT_DIM_KEY AS THHLD_CLT_BRDG_STRT_DT_DIM_KEY,
    THHLD_CLNT_BRDG.END_DT_DIM_KEY AS THHLD_CLT_BRDG_END_DT_DIM_KEY,
    MV.TCLNT_SCDIM_CLNT_SCDIM_KEY AS TCLNT_SCDIM_CLNT_SCDIM_KEY,
    MV.TCLNT_SCDIM_CLNT_DIM_KEY AS TCLNT_SCDIM_CLNT_DIM_KEY,
    MV.TCLNT_SCDIM_BUS_SGMNT_CD AS TCLNT_SCDIM_BUS_SGMNT_CD,
    MV.TCLNT_SCDIM_SGMNTN_RNK_NO AS TCLNT_SCDIM_SGMNTN_RNK_NO,
    MV.TCLNT_SCDIM_STRT_DT_DIM_KEY AS TCLNT_SCDIM_STRT_DT_DIM_KEY,
    MV.TCLNT_SCDIM_END_DT_DIM_KEY AS TCLNT_SCDIM_END_DT_DIM_KEY,
    MV.TCLNT_MRGE_MRGED_TO_CLNT_KEY AS TCLNT_MRGE_MRGED_TO_CLNT_KEY,
    MV.TCLNT_MRGE_MRGED_FR_CLNT_KEY AS TCLNT_MRGE_MRGED_FR_CLNT_KEY,
    MV.TCLNT_MRGE_STRT_DT_DIM_KEY AS TCLNT_MRGE_STRT_DT_DIM_KEY,
    MV.TCLNT_MRGE_END_DT_DIM_KEY AS TCLNT_MRGE_END_DT_DIM_KEY
    FROM OCMADM.MV_CLNT_SCDIM_MRGE MV,
    OCMADM.THHLD_CLNT_BRDG THHLD_CLNT_BRDG
    WHERE THHLD_CLNT_BRDG.CLNT_SCDIM_KEY = MV.TCLNT_SCDIM_CLNT_SCDIM_KEY
    AND MV.TCLNT_SCDIM_END_DT_DIM_KEY = 15373484
    AND MV.TCLNT_MRGE_END_DT_DIM_KEY = 15373484
    AND THHLD_CLNT_BRDG.END_DT_DIM_KEY = 15373484) v_hhld_clnt_brdg
    ON v_hhld_clnt_brdg.tclnt_mrge_mrged_to_clnt_key =
    mv_clnt_dim.tclnt_dim_clnt_dim_key
    INNER JOIN OCMADM.mv_hhld_dim mv_hhld_dim
    ON mv_hhld_dim.hhld_dim_key =
    v_hhld_clnt_brdg.thhld_clnt_brdg_hhld_dim_key
    WHERE v_hhld_clnt_brdg.thhld_clt_brdg_end_dt_dim_key = 15373484) t3,
    "OCMADM"."TWEB_PGE_DIM" t4
    WHERE t2."TRTMT_EFFTV_STRT_DT_DIM_KEY" = t1."DT_DIM_KEY"
    AND t3."TRTMT_DIM_KEY" = t2."TRTMT_DIM_KEY"
    AND t3."WEB_PGE_DIM_KEY" = t4."WEB_PGE_DIM_KEY"
    AND t2."CMPGN_SYS_CD" IN ( 'INT' )
    AND t2."TRTMT_STATUS_CD" = 'ACTV'
    AND To_number(To_char(t1."CALNDR_DT", 'YYYY')) = 2010
    AND DECODE(Substr(t2."OFFR_NM", 1, 3), 'MKT', 'MKT',
    DECODE(Substr(t2."OFFR_NM", 1, 2),
    'DP',
    'DP'
    ,
    DECODE
    (
    Substr(t2."OFFR_NM", 1, 2), 'AP', 'DP'
    ,
    DECODE(
    Substr(t2."OFFR_NM", 1, 3), 'PRO',
    'RRO',
    DECODE(
    Substr(t2."OFFR_NM", 1, 5), 'SCPRO',
    'PRO',
    'NORPT'))))) IN ( 'MKT', 'DP', 'PRO' )
    ORDER BY "c6" ASC,
    "c5" ASC,
    "c8" ASC,
    "c7" ASC,
    "c2" ASC,
    "c11" ASC,
    "c10" ASC,
    "c4" ASC,
    "c12" ASC,
    "c13" ASC,
    "c9" ASC,
    "c3" ASC

  • RELEVANCY SCORE 3.20

    DB:3.20:Substr Function To Extract An Specific Value xx


    I have data like this in a columnn
    RA(44)RC(44)RF(44)RJ(44)RN(44)RU
    RI(44)RQ(44)RR(44)RS
    RQ(44)RR(44)RS
    RG(44)RP

    I want to be able to ectract just the values RA,RC,RF ETC..ETC...

    I try substr does not work:

    SELECT SUBSTR(szcasup_activities,1,2),
    SUBSTR(szcasup_activities,8,9) ,
    SUBSTR(szcasup_activities,15,16)
    FROM szcasup
    {code}

    I also try
    {code}
    SELECT
    REGEXP_REPLACE (szcasup_activities,
    '(44)',
    NULL)
    FROM szcasup
    {code}

    to eliminate (44) does not work

    Any ideas?

    DB:3.20:Substr Function To Extract An Specific Value xx

    this will also do, why are people using regexp???

    with data as
    ( select 'RA(44)RC(44)RF(44)RJ(44)RN(44)RU' col1 from dual union all
    select 'RI(44)RQ(44)RR(44)RS' from dual union all
    select 'RQ(44)RR(44)RS' from dual union all
    select 'RG(44)RP' from dual
    )
    select replace(col1,'(44)',',') col1
    from data;

  • RELEVANCY SCORE 3.20

    DB:3.20:What To Do Replace Or Translate ? And How !! fc


    i am creating a report and it's sql is

    select lpad(vw_receipt_journal_year,2,0) || lpad(vw_receipt_journal_seq, 3,0) ||lpad(vw_receipt_rcpt_seq,4,0) Receipt_No,
    to_Date(vw_receipt_date,'mm/dd/yyyy') Receipt_Date,
    SUBSTR(TO_CHAR(VW_RECEIPT_COMMENT_2),-4) YEAR,
    SUBSTR(to_char(VW_RECEIPT_COMMENT_2),1,3) MSOURCE,
    VW_RECEIPT_TOTAL RECPTOT

    from receipt_view

    WHERE VW_RECEIPT_DISBURSEMENT_CODE = '08'
    AND SUBSTR(TO_CHAR(VW_RECEIPT_COMMENT_2),-4) = nvl(:P_YEAR,SUBSTR(TO_CHAR(VW_RECEIPT_COMMENT_2),-4))
    AND SUBSTR(to_char(VW_RECEIPT_COMMENT_2),1,3) =nvl(:P_SOURCE,SUBSTR(TO_CHAR(VW_RECEIPT_COMMENT_2),1,3))
    AND vw_receipt_date between nvl(:P_Start_Date, vw_receipt_date) and nvl(:P_End_Date, vw_receipt_date)
    order by Receipt_Date, Receipt_No ;

    this works perfect .

    but i have to pass parameter values like p_source = ABC. -- it retrives all correctly but
    i want to display all ''ABC' as 'IN' in ** msource** on my report .
    like wise
    if i enter p_source = 'DEF' - it works fine but need to display all 'DEF' as 'OUT'.
    ** someone please tell me how to do it.
    i tried REPLACE AND TRANSLATE fucntions and nothing works.

    thanks for all help.

  • RELEVANCY SCORE 3.20

    DB:3.20:Issue With Table Types. af


    Hi

    Actually There is a column by the name empno_result which is there in the packages

    Case 1:
    a_sachtype (j).empno_result:= empno_result ;
    Here a_output is an tabletype of objecttype

    l_empno_list .empno_result: :=empno_result ;
    l_empno_list is an table type of object type

    Now When I am adding substr function
    a_output(j).empno_result:=substr(empno_result,1,475);
    l_empno_list .empno_result: :=substr(empno_result,1,475) ;
    This is truncating my data to 475 characters.I dont want to truncate my data.

    and trying to run the wrapper with
    DBMS_OUTPUT.PUT_LINE('sachline(' || j || ') result ' ||substr( empno_result,4000,1));
    DBMS_OUTPUT.PUT_LINE( SUBSTR(empno_result,226,500));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,501,750));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,751,1000));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,1001,1250));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,1251,1500));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,1501,1750));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,1751,2000));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,2001,2250));
    This wrapper is giving data upto 475 characters.But empno_result is having very big data more than 32767 characters.This wrapper is running successfully.

    Case 2:

    for e.g
    If I increase the length of empno_result variable in the package It is giving me error when I am running the above wrapper

    empno_result is having clob datatype.

    a_sachtype(j).empno_result:= substr(empno_result ,1,500);
    Here a_output is a tabletype
    l_empno_list .empno_result:=substr(empno_result,1,500);
    Here l_empno_list is a tabletype

    When I am running the wrapper
    and trying to run the wrapper with
    DBMS_OUTPUT.PUT_LINE('sachline(' || j || ') result ' ||substr( empno_result,4000,1));
    DBMS_OUTPUT.PUT_LINE( SUBSTR(empno_result,226,500));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,501,750));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,751,1000));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,1001,1250));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,1251,1500));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,1501,1750));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,1751,2000));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,2001,2250));

    ORA-20000: ORU-10028: line length overflow, limit of 255 chars per line
    ORA-06512: at "SYS.DBMS_OUTPUT", line 35
    ORA-06512: at "SYS.DBMS_OUTPUT", line 133
    ORA-06512: at line 81

    Case 3:
    When I am simply writting in the package
    a_sachtype(j).empno_result:= empno_result;
    Here a_sachtype ios is also a tabletype.
    l_empno_list .empno_result:=empno_result;
    Here l_empno_list is a tabletype
    The package is compiling

    But When I am running the wrapper
    DBMS_OUTPUT.PUT_LINE('sachline(' || j || ') result ' ||substr( empno_result,4000,1));
    DBMS_OUTPUT.PUT_LINE( SUBSTR(empno_result,226,500));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,501,750));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,751,1000));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,1001,1250));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,1251,1500));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,1501,1750));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,1751,2000));
    DBMS_OUTPUT.PUT_LINE(SUBSTR(empno_result,2001,2250));

    It is also giving me error
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "manoj_pk line 461
    ORA-06512: at line 51

    Why I am getting error if I am increasing it to 500?.Even I am using for loop I am getting the same error since empno_result is having very big data having more than 4000 characters.I dont have access to dbms_lob access.

    Can you suggest me how to print empno_result data which is causing error and impacting my big applications?

    Appreciate your help on the above.

    Thanks Regards
    Thakur Manoj R

    DB:3.20:Issue With Table Types. af

    If your column tyep is the clob then better use the following method

    dbms_output.put_line(dbms_clob.substr(your_column,1,4000))kanish

  • RELEVANCY SCORE 3.19

    DB:3.19:Update Default_Folder In Dm_User With Dql 9f


    Hi,I want to update the default_folder in the table dm_user using substr-function with this statement:update dm_user object set default_folder = '...' + substr(user_os_name, 3, 1) + '...' + user_os_name where ...But this statement doesn't work. DQL does not support substr(). Now I want to create a inner sql-statement like this:update dm_user object set default_folder = (select ...)...but I can't find the way how to give the tables alias-names for a join-statement.Does someone know a solution??Thanks,Markus

    DB:3.19:Update Default_Folder In Dm_User With Dql 9f

    Hi Markus,As Abhijit said, if e-Content Serversion is 5.2 or above then substr function can be used in DQL but you can't use concatnate operator in DQL.Without concatnate it works:Ex: SELECT SUBSTR(user_os_name,3,1) as Osname from dm_user where user_os_name = 'osname'So the best way is raj's suggestion or write your own dfc code or docbasic code to do that.I wouldn't recomand this but you can do it in Database level too. If you are comfortable you can do it. http://forums.documentum.com/jive3/thread.jspa?forumID=23#38;threadID=18786#38;messageID=160216#160216For register/unregister a table, check this:http://support.documentum.com/support/resolutions/dmfrmresolutionview.asp?id=5335I hope it helps.Thanks,Gadiraju

  • RELEVANCY SCORE 3.19

    DB:3.19:Re: Format An Alpha Numeric String 8f


    We really need the rules to make sure it's accurate, however, based on what you put, this should work for those samples:
    with xx as ( select 'N432301' lat, 'W0844150' lon from dual )
    select substr(lat,1,1) || '-' || substr(lat,2,2) || '-' || substr(lat,4,2) || '-' || substr(lat,6,2) latitude,
    substr(lon,1,1) || '-' || substr(lon,3,2) || '-' || substr(lon,5,2) || '-' || substr(lon,7,2) longitude
    from xx;
    LATITUDE LONGITUDE---------- ----------N-43-23-01 W-84-41-501 row selected.Just adjust the substr #'s to better match your actual format.But be careful, I see your method of storing that data as getting potentially messy, and error prone.Consider storing it in 4 seperate fields:
    lat_dir varchar(1)
    lat_hr number
    lat_min number
    lat_sec number
    .. or something like that (you'd have less issues with it).Then you could make a view wrapped around it (or on 11g, a computed field):
    create view v_whatever as
    select lat_dir || '-' || lat_hr || '-' || lat_min || '-' || lat_sec latitude
    from my_table;

    DB:3.19:Re: Format An Alpha Numeric String 8f

    Hi,Good idea!Of course, if the longitude is less that 10 degrees, we'll want to remove 2 leading 0's, and the same for the latitude:SELECT REGEXP_REPLACE ( latitude , '(.)0*(.{1,2})(..)(..)' , '\1-\2-\3-\4' ) AS new_lat, REGEXP_REPLACE ( longitude , '(.)0*(.{1,3})(..)(..)' , '\1-\2-\3-\4' ) AS new_longFROM table_x;This assumes that the original latitude is always exactly 7 characters long, and the original longitude is exactly 8.

  • RELEVANCY SCORE 3.19

    DB:3.19:Expand Sql Query To Retrieve Items Of A Workbook 93


    Hi All,

    I have come across the forum a code to retrieve the items of a workbook.
    In the code it's retrieving up to 21 items.

    I would like to expand the code to retrieve 35 items.

    I don't really understand the parameters used so that i can expand it on my on.

    This is the code I am using now, which I got from this forum:

    SELECT
    QS.QS_DOC_OWNER USER_NAME,
    QS.QS_DOC_NAME WORKBOOK,
    QS.QS_DOC_DETAILS WORKSHEET,
    TRUNC(QS.QS_CREATED_DATE) DOC_DATE,
    (LENGTH(TO_CHAR(EUL5_GET_ITEM_NAME(QS.QS_ID)))+1)/9 ITEMS,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),1, 6)) ITEM1,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),10, 6)) ITEM2,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),19, 6)) ITEM3,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),28, 6)) ITEM4,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),37, 6)) ITEM5,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),46, 6)) ITEM6,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),55, 6)) ITEM7,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),64, 6)) ITEM8,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),73, 6)) ITEM9,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),82, 6)) ITEM10,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),91, 6)) ITEM11,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),100,6)) ITEM12,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),109,6)) ITEM13,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),118,6)) ITEM14,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),127,6)) ITEM15,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),136,6)) ITEM16,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),145,6)) ITEM17,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),154,6)) ITEM18,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),163,6)) ITEM19,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),172,6)) ITEM20
    FROM discoverer.EUL5_QPP_STATS QS
    WHERE
    (LENGTH(TO_CHAR(EUL5_GET_ITEM_NAME(QS.QS_ID)))+1)/9 21
    And QS.QS_DOC_OWNER = 'EP'
    and QS.QS_DOC_NAME like '%Prodoper%'Thanks,
    Diana

    DB:3.19:Expand Sql Query To Retrieve Items Of A Workbook 93

    For what it's worth, I just noticed that I've got an extra comma after ITEM35...

  • RELEVANCY SCORE 3.18

    DB:3.18:Convert Character To A Numeric Using Substr 87


    I have a CHARACTER columns which contains a NUMERIC value

    The value of the column is GBP00001750.00

    I have used SUBSTR(colName,1,3) to extract the currency and now
    have got the numeric by saying SUBSTR(colName,4)

    The output I get is 0001750.00

    How do I get rid of the 0's and convert this to a NUMERIC value?

    DB:3.18:Convert Character To A Numeric Using Substr 87

    SQL select to_number('0001750.00') from dual;

    TO_NUMBER('0001750.00')
    -----------------------
    1750

  • RELEVANCY SCORE 3.18

    DB:3.18:Tranwrd Substr sp



    hello, I want to replace a substr in a text to some else, somehow the following does not work. Any ideas? If I assign the string values to the temp_str and new_str, the F1 is updated as intended. Thank you,

    DATA TEST;

    F1 = "9999,'ABC', 110,2, 0.00, 0.00, 14, 17,1.02454, 27.9937,1";

    CALL SCAN(F1,5,POS,LEN,',');

    TEMP_STR = SUBSTR(F1,1,POS-2);

    NEW_STR = CAT(SUBSTR(F1,1,POS-3),'1');

    F1 = TRANWRD(F1,TEMP_STR,NEW_STR);

    RUN;

    DB:3.18:Tranwrd Substr sp


    The result of CAT, and many other string functions, is 200 unless you define the variable first. But even with a defined length you would likely have the comparison for some values with the trailing blanks. So it is a good idea to STRIP values. Though you need other approaches if you want leading blanks compared...

  • RELEVANCY SCORE 3.18

    DB:3.18:Ora-01722 Error fx


    Morning all,

    I have a bit of an issue - I hope you can help.

    I have a custom table containing a large number of account numbers which I am trying to join to one of our main tables. When I execute the query, I get:

    ORA-12801: error signaled in parallel qury server P034 ORA-01722: invalid number.

    Trawling through old threads relating to the error message - it suggests there may be a dodgy character in one or more of the account numbers in my custom table.

    The column in both tables are varchar2 (although my table is 17 bites - the other is 16). I have tried to identify the rogue account number the following ways:

    SELECT MAX(LENGTH(A.ACcOUNT_NUMBER))
    FROM MY_TABLE A;

    Length is the same as other table.

    SELECT A.ACcOUNT_NUMBER
    FROM "MY_TABLE A
    WHERE
    SUBSTR(MY_TABLE ,1,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,2,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,3,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,4,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,5,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,6,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,7,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,8,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,9,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,10,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,11,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,12,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,13,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,14,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,15,1) NOT BETWEEN 0 AND 9
    OR SUBSTR(MY_TABLE ,16,1) NOT BETWEEN 0 AND 9;

    Try to see if any account number has a didgit that is not between 0 - 9. again no results.

    Can anyone suggest any other way I could use to identify these account??

    Any help greatly appreciated.

    DB:3.18:Ora-01722 Error fx

    I have just written a small function:

    CREATE OR REPLACE FUNCTION f1(p_char VARCHAR2)
    RETURN VARCHAR2
    IS

    v_n1 NUMBER;
    v_return_char VARCHAR2(4000) := p_char;

    v_length NUMBER;
    v_trim_length NUMBER;

    BEGIN

    v_n1 := TO_NUMBER(p_char);
    v_length := LENGTH(p_char);
    v_trim_length := LENGTH(TRIM(p_char));

    IF( v_length = v_trim_length OR p_char IS NULL) THEN

    v_return_char := 'OK';

    END IF;

    RETURN(v_return_char);

    EXCEPTION

    WHEN OTHERS THEN
    RETURN(v_return_char);

    END f1;
    /

    Then execute the following SQL to retieve the invalid numbers:
    SELECT f1(n1)
    FROM abcd
    WHERE f1(n1) != 'OK' ;

  • RELEVANCY SCORE 3.17

    DB:3.17:Sql Output Different Between Oralce 8.0.5 And Oracle 8.1.7?? 9m


    Hi,
    I have the following SQL statement:
    SET ARRAYSIZE 100;
    SET FEEDBACK OFF ;
    SET HEADING OFF ;
    SET LINESIZE 274 ;
    SET PAGESIZE 0 ;
    SET SPACE 1 ;
    SET VERIFY OFF ;
    SET WRAP OFF ;
    SELECT
    SUBSTR(TO_CHAR( SEQNO , 99999990), 1),
    SUBSTR(TO_CHAR( DATECHG , 99999990), 2),
    SUBSTR( USERCHG ,1,8),
    SUBSTR(TO_CHAR( DATEOUT , 99999990), 2),
    SUBSTR( SERIAL ,1,10),
    SUBSTR( PRODNO ,1,18),
    SUBSTR(TO_CHAR( FGDATE , 99999990), 2),
    SUBSTR(TO_CHAR( MFGDATE , 99999990), 2),
    SUBSTR( MFTYPE ,1,1),
    SUBSTR( MFLOC ,1,3),
    SUBSTR( PALLETID ,1,18),
    SUBSTR( TOPID ,1,18),
    SUBSTR( CARTONID ,1,18),
    SUBSTR(TO_CHAR( SHIPDATE , 99999990), 2),
    SUBSTR( ORDTYPE ,1,6),
    SUBSTR( SHIPLOC ,1,3),
    SUBSTR( SHDOCNO ,1,10),
    SUBSTR( SHCUSTNO ,1,10),
    SUBSTR(TO_CHAR( WEDATE , 99999990), 2),
    SUBSTR(TO_CHAR( DATEIN , 99999990), 2),
    SUBSTR(TO_CHAR( DOFSEQNO , 99999990), 2),
    SUBSTR(TO_CHAR( DOFDATE , 99999990), 2),
    SUBSTR( PROBLEM ,1,6),
    SUBSTR( GPCODE ,1,1),
    SUBSTR(TO_CHAR( ATMSEQNO , 99999990), 2),
    SUBSTR( SHIPPERNO ,1,10),
    SUBSTR( INVOICENO ,1,10),
    SUBSTR(TO_CHAR( COMSEQNO , 99999990), 2)
    FROM SHIP;

    When I run this on Oracle 8.0.5 from SQL*Plus, it works fine. I get the data in the format that I specified.
    However, when I use the same statement in Oracle 8.1.7.3 RDBMS from SQL*Plus, it does not work. I get the following output.

    rows will be truncated

    rows will be truncated

    rows will be truncated

    rows will be truncated

    rows will be truncated

    rows will be truncated

    0
    20

    Any feedback will be greatly appreciated.

    Ramesh

    DB:3.17:Sql Output Different Between Oralce 8.0.5 And Oracle 8.1.7?? 9m

    I don't know.
    Have you tried shortening you SQL until it works. It would be nice for you to include more information so we could try this in our databases.
    Maybe something to do with the linesize or arraysize try changing them.

    Sorry I was of no help, perhaps someone else will be
    Eric Kamradt

  • RELEVANCY SCORE 3.17

    DB:3.17:Rounding Values Help cc


    I am converting a value while inserting it into a new table.
    starting value (example)col1: 122-18-35.89W
    I am using the following substr within an insert statement (example):
    translate(substr(col1,1,9)||substr(col1, -1),'x-.','x')

    Now I was hoping to round this figure to result in 1221836W, so is the following correct syntax?
    translate(substr(col1,1,9)||round(col1, 1234567.12)||substr(col1, -1),'x-.','x')

    thank you in advance
    Shawn

    DB:3.17:Rounding Values Help cc

    GO FRANCE!brYeap ! ;-)br
    br
    Any suggested reading for instr, substr, round? My class did not cover them well.brOur best friendbr
    br
    Nicolas.

  • RELEVANCY SCORE 3.17

    DB:3.17:Case Statement In Oracle Query. ca


    Hello Oracle Gurus,

    I need suggestion on whether I should use Case statement in Oracle queries.

    I have a sql statement which inserts the data by selecting data from other table. While selecting the data I have put a logic in the select statement for one column which is something like this and there are some more similar statements in the same query.

    CASE
    WHEN (b.ACCOUNT = 'FIN' or b.ACCOUNT ='FIN ACC' or b.ACCOUNT like '%Global Eq%' or b.ACCOUNT like '%Flexible Bond%')
    THEN
    'MTM'
    WHEN (substr(a.CTC,-3)='MTM')
    THEN
    'MTM'
    WHEN (substr(a.CTC,-3)='AFS' or substr(a.CTC,-3)='HTM' OR substr(a.CTC,-3)='ACC' OR substr(a.CTC,-3)='HFI' )
    THEN
    'ACC'
    ELSE
    'OTH'
    END,

    I wanted to get an suggestion about how much performance issue can I have due to this in my insert statement.

    Let me know if you need any other information.All comments are really appreciated.

    DB:3.17:Case Statement In Oracle Query. ca

    "Due to the proprietery nature of the logic I cannot put the complete query out here"

    LOL, anything you can write in SQL has most likely been done before many times. The data itself can be sensitive and you might want to mask the table names but there is nothing you can do in an insert/select that has not already been done.

    IMHO -- Mark D Powell --

  • RELEVANCY SCORE 3.16

    DB:3.16: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:3.16: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 3.16

    DB:3.16:Add Days To A Date - Bi Publisher pc


    Hello,

    I am trying to add 7 days to a date. The date starts as DD-MM-YY format, but I need it to display as DD.MM.YYYY.

    I can get the following to return the date in the correct format:

    ?xdofx: to_date(to_char('20'||substr(DUN_DATE,7,2)||'-'||substr(DUN_DATE,4,2)||'-'||substr(DUN_DATE,1,2)),'DD.MM.YYYY')?

    But I am unable to add 7 days to this date. I have tried using +7 in various places in the tag but no luck. Here are some things I've tried:

    Within the "to_char" function causes error "oracle.xdo.parser.v2.XPathException: Cannot convert 2010-11-30 to number"
    ?xdofx: to_date(to_char('20'||substr(DUN_DATE,7,2)||'-'||substr(DUN_DATE,4,2)||'-'||substr(DUN_DATE,1,2)+7),'DD.MM.YYYY')?

    Within the "to_date" function causes the same error "oracle.xdo.parser.v2.XPathException: Cannot convert 2010-11-30 to number."
    ?xdofx: to_date(to_char('20'||substr(DUN_DATE,7,2)||'-'||substr(DUN_DATE,4,2)||'-'||substr(DUN_DATE,1,2))+7,'DD.MM.YYYY')?

    Outside all functions itstill errors, but with a slightly different error: "Cannot convert 30.11.2010 to number"
    ?xdofx: to_date(to_char('20'||substr(DUN_DATE,7,2)||'-'||substr(DUN_DATE,4,2)||'-'||substr(DUN_DATE,1,2)),'DD.MM.YYYY')+7?

    Any ideas how to get the calculation to work correctly?

    Thanks in advance,

    JJ

    DB:3.16:Add Days To A Date - Bi Publisher pc

    yeah, its a pretty ugly business in BIP..

    ?format-date:xdoxslt:ora_format_date_offset(concat(xdoxslt:right(P_DATUM_VAN,4),-,xdoxslt:right(xdoxslt:left(P_DATUM_VAN,10),2),-,xdoxslt:left(P_DATUM_VAN,7)),1,+);dd-MM-yyyy?

    This code adds 1 day to P_DATUM_VAN (yyyy-MM-dd) and converts it to dd-MM-yyyy, for those who might ever need it.

  • RELEVANCY SCORE 3.16

    DB:3.16: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:3.16: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 3.15

    DB:3.15:Substr z8


    I have a table with ref_ids column like this:

    Ref_Ids

    x:L4EDft:1234
    YX:12NTVHKUTYRXD:acI would like to extract the information so that it is returned as:

    Ref_Ids

    L4EDft
    12NTVHKUTYRXDI have tried in many ways with substr and instr like the below

    Substr(Upper(test.Ref_Ids),
    Instr(Upper(test.Ref_Ids), ':') +1) test1which returned

    Ref_Ids

    L4EDft:1234
    12NTVHKUTYRXD:acBut I cannot get the bit after the second ":" to disappear, including ":"...any idea?

    Thanks

  • RELEVANCY SCORE 3.15

    DB:3.15:Delimiter In Parameter File p1



    Hi All,

    Is it possible to have a delimiter in the parameters?

    Example: $$CLIENT=1,2,3 (Comma ',' is the delimiter.

    I usually work with parameter like this:

    $$CLIENT1=1

    $$CLIENT2=2

    $$CLIENT3=3

    But never as $$CLIENT=1,2,3

    I was advised that I need to remove the delimiter and transfer it to a variable.

    Sample:

    var_CLIENT = $$CLIENT

    var_CLIENT1=SUBSTR(var_CLIENT,1,1)

    var_CLIENT2=SUBSTR(var_CLIENT,3,1)

    var_CLIENT3=SUBSTR(var_CLIENT,5,1)

    

  • RELEVANCY SCORE 3.15

    DB:3.15:Product Code - Substr zc


    Hi,

    I have a product code which is like this '12345P'.
    In the where clause I use substr to extract '12345' several times .
    For eg

    where (substr(prod_code,1,5) in('12345','23456')
    and substr (prod_code,1,5) in ('45678','23233'))
    or substr(prod_code,1,5) in('45678','22226')
    and substr (prod_code,1,5) in ('41234','23453'))......

    Is there a way I could use substr just once?

    TIA

    DB:3.15:Product Code - Substr zc

    You can refer to aliases in where clauses if you use an in-line view:

    select ...
    from (select substr(prod_code,1,50 subby
    from ... )
    where subby...
    and subby...)

    I still don't understand the where clauses in your original example which cannot return any rows. Is it just a bad example ?

  • RELEVANCY SCORE 3.14

    DB:3.14:How To Use Substr In Partitioning 8d


    HEY ALL,
    CAN I USE SUBSTR IN PARTITIONING
    LIKE DIS
    create table test
    (
    process_id number(19),
    name varchar2(15))
    partition by range(process_id)
    (
    partition p1 values less than (substr(process_oid,-1))
    tablespace test,
    partition p2 values less than (substr(process_oid,-1))
    tablespace test,
    partition p3 values less than (maxvalue)
    tablespace test
    )

    DB:3.14:How To Use Substr In Partitioning 8d

    partition p1 values less than (substr(process_oid,-1))
    partition p2 values less than (substr(process_oid,-1))

    These two conditions are identical. How do you expect Oracle to determine whether the row should go into partition P1 or P2? Coin toss?

  • RELEVANCY SCORE 3.14

    DB:3.14:Need Help With Substr 3z


    Hi All,
    Cane we used nested SUBSTR functions? The reason is i have records like "VDAT-ADistrict1","VDAT-BDist2"......................"VDAT-FDistrict6". What i want is just 'A','B','C','D','E','F'. The problem here is in some case it is "District" and in some cases its "Dist", also how to get rid of VDAT and the trailing part after A,B,C,D,E and F? Please any advice is greatly appreciated.

    Thanks

    DB:3.14:Need Help With Substr 3z

    Hi
    Yes you can get it on amazon. The easiest way to get to the right title is to go to my website: http://ascbi.com/10g-handbook.htm

    Then in the first paragraph you should see a link called AMAZON.COM. There's also a link on the right-hand below the cover picture.

    Best wishes
    Michael

  • RELEVANCY SCORE 3.14

    DB:3.14:List Of Users Who Were Granted Particular Function In Oracle Apps R12 Db? 17


    Hi
    I need to list all users who were granted particular function (suppliers) from oracle apps R12 database. User --Resp --Menu -- Submenu/function. I have two queries like the following

    --Below sql query give all users those
    having Purchasing and Payables application access.
    SELECT UNIQUE u.user_id, SUBSTR (u.user_name, 1, 30) user_name,
    SUBSTR (r.responsibility_name, 1, 60) responsiblity,
    SUBSTR (a.application_name, 1, 50) application
    FROM fnd_user u,
    fnd_user_resp_groups g,
    fnd_application_tl a,
    fnd_responsibility_tl r
    WHERE g.user_id(+) = u.user_id
    AND g.responsibility_application_id = a.application_id
    AND a.application_id = r.application_id
    AND g.responsibility_id = r.responsibility_id
    AND a.application_name in ('Puchasing','Payables')
    ORDER BY SUBSTR (user_name, 1, 30),
    SUBSTR (a.application_name, 1, 50),
    SUBSTR (r.responsibility_name, 1, 60);

    --Below sql query gives function name.
    SELECT function_id, user_function_name, creation_date, description
    FROM applsys.fnd_form_functions_tl where function_id=1348;

    What other tables to join to get all users having this function (suppliers) granted?

    Regards

    DB:3.14:List Of Users Who Were Granted Particular Function In Oracle Apps R12 Db? 17

    You cannot move a post to another forum.

    You can repost your entire text as another post in the other forum.
    You can then mark this thread as "answered" -- just to close it.

    Hemant K Chitale

    Edited by: Hemant K Chitale on Jan 16, 2011 5:11 PM

  • RELEVANCY SCORE 3.14

    DB:3.14:Substr In Reports 7c


    Hi Guyz,

    I want to use substr in reports i have the below number where i want to subtitute id_no in 9 column in reports.

    When user run the report the id_no will insert into ID_1.....ID_9 columns as below and then print.

    ID_NO
    ----------
    2180758419ID_1, ID_2, ID_3.......ID_9 how can i use substr in this with single digit in every id_1 from id_no.

    (Ex: ID_1:=2, ID_2:=1.......till last digit.)

    as we can use in forms.

    :BLK.ID_1:=SUBSTR(':BLK.ID_NO', 1,1);
    :BLK.ID_1:=SUBSTR(':BLK.ID_NO', 2,1);
    :BLK.ID_1:=SUBSTR(':BLK.ID_NO', 3,1);
    ....
    :BLK.ID_1:=SUBSTR(':BLK.ID_NO', 9,1);

    I'm using reports 6i oracle 9i.

    Regards

    DB:3.14:Substr In Reports 7c

    thanks for your replies....i solve with the below code..

    i create a formula and put the below code.

    return substr(:id_no, 1, 1);
    return substr(:id_no, 2, 1);
    ....Regards

    Moazam

  • RELEVANCY SCORE 3.14

    DB:3.14:Select Value In Last Row Of Results In Query 9d


    With some help in a previous post, I've been able to get my hands on code to perform a hierachical query. Based on the results of the query, I need to be able to select the values in that last row.

    I am not sure what the best way is to do this and would appreciate some advice on how to get this done.

    Here's my query and the resutls:

    select substr(path,1,1) as bottom_level, min(substr(path,-1,1)) as vp, ftvorgn_orgn_code, ftvorgn_orgn_code_pred, ftvorgn_user_id from (

    select ftvorgn_orgn_code, ftvorgn_orgn_code_pred, ftvorgn_user_id, substr(sys_connect_by_path(ftvorgn_orgn_code,'-'),2) as path
    from ftvorgn
    connect by ftvorgn_orgn_code = prior ftvorgn_orgn_code_pred
    start with ftvorgn_orgn_code = '330800' and ftvorgn_user_id 'CONVERT')
    where ftvorgn_user_id = 'MERROSS' OR FTVORGN_ORGN_CODE_PRED = 'A00002'
    group by substr(path,1,1),ftvorgn_orgn_code, ftvorgn_orgn_code_pred, ftvorgn_user_id

    BOTTOM_LEVEL VP FTVORGN_ORGN_CODE FTVORGN_ORGN_CODE_PRED FTVORGN_USER_ID
    3 2 B00032 A00002 MERROSS
    3 2 B00032 A00002 PPADGETT
    3 2 C00132 B00032 MERROSS

    DB:3.14:Select Value In Last Row Of Results In Query 9d

    I used the following query and almost have the results that I need. I need to check for when RN = MAX_RNN. But my results come back null. Can someone please look at this and let me know what is wrong with my where clause:

    select Rownum rn,MAX (Rownum) over (Partition By ftvorgn_orgn_code Order By ftvorgn_orgn_code_pred) max_rNn,substr(path,1,1) as bottom_level, min(substr(path,-1,1)) as vp, ftvorgn_orgn_code, ftvorgn_orgn_code_pred, ftvorgn_user_id
    from
    (select ftvorgn_orgn_code, ftvorgn_orgn_code_pred, ftvorgn_user_id, substr(sys_connect_by_path(ftvorgn_orgn_code,'-'),2) as path
    from ftvorgn
    connect by ftvorgn_orgn_code = prior ftvorgn_orgn_code_pred
    start with ftvorgn_orgn_code = '450001' and ftvorgn_user_id 'CONVERT')
    where ftvorgn_user_id 'CONVERT' AND :RN = :MAX_RNN
    group by substr(path,1,1),ftvorgn_orgn_code, ftvorgn_orgn_code_pred, ftvorgn_user_id, Rownum

  • RELEVANCY SCORE 3.13

    DB:3.13:Re: The Substr Syntax... 3a


    using the substr syntax how could i use it in a lisp to make a dwg name 7 digits if its anything less?
    for example if my dwg name was
    b-1234
    and i need it to be
    ab-1234

    would i use the (if (= b-1234)
    (progn blah blah))

    sorry for the dumb questions

    DB:3.13:Re: The Substr Syntax... 3a

    Sure,
    This was just a syntax example.
    Which he was asking for.

    Bill

  • RELEVANCY SCORE 3.13

    DB:3.13:Substr The Last Few Letters sk



    I would like to know how to get the final few letters of a string?

    DB:3.13:Substr The Last Few Letters sk


    If you want last n letters then you should start from length(of your variable)-n+1.

    data want_last_2;

    input AA $;

    newaa=substr(aa,length(aa)-1);

    cards;

    sdfgh

    nhdsadfg

    cedsas

    oiugdbah

    ;

    proc print;

    run;

  • RELEVANCY SCORE 3.13

    DB:3.13:How To Requce Query. 3m


    I want to increment time +1 , I have create one function it's working but is there
    any other way to reduce below code with same output. if possible i want only single
    query to increment time plush 1 without use to_date dunction.

    DECLARE

    V_TIME VARCHAR2(5);
    V_TIME_PRINT VARCHAR2(5);

    BEGIN

    -- FIRST EXAMPLE

    V_TIME := '17:18';

    --- Is there any another way to reduce below quey.

    select decode(substr(V_TIME, -2), '59',
    decode(substr(V_TIME,0, 2) ,'23','00',
    lpad(substr(V_TIME,0, 2) + 1,2,'0') ) || ':' || '00',
    lpad(substr(V_TIME,0, 2) ,2,'0') || ':' ||
    lpad(substr(V_TIME, -2) + 1,2,'0')) INTO V_TIME_PRINT from dual;

    DBMS_OUTPUT.PUT_LINE(V_TIME || ' IN 1 MINUTE INCREMENTAL TIME IS : ' || V_TIME_PRINT);

    -- SECOND EXAMPLE

    V_TIME := '23:59';

    select decode(substr(V_TIME, -2), '59',
    decode(substr(V_TIME,0, 2) ,'23','00',
    lpad(substr(V_TIME,0, 2) + 1,2,'0') ) || ':' || '00',
    lpad(substr(V_TIME,0, 2) ,2,'0') || ':' ||
    lpad(substr(V_TIME, -2) + 1,2,'0')) INTO V_TIME_PRINT from dual;

    DBMS_OUTPUT.PUT_LINE(V_TIME || ' IN 1 MINUTE INCREMENTAL TIME IS : ' || V_TIME_PRINT);

    -- SECOND EXAMPLE

    V_TIME := '17:59';

    select decode(substr(V_TIME, -2), '59',
    decode(substr(V_TIME,0, 2) ,'23','00',
    lpad(substr(V_TIME,0, 2) + 1,2,'0') ) || ':' || '00',
    lpad(substr(V_TIME,0, 2) ,2,'0') || ':' ||
    lpad(substr(V_TIME, -2) + 1,2,'0')) INTO V_TIME_PRINT from dual;

    DBMS_OUTPUT.PUT_LINE(V_TIME || ' IN 1 MINUTE INCREMENTAL TIME IS : ' || V_TIME_PRINT);

    END;

    DB:3.13:How To Requce Query. 3m

    You can do it in a very simple way. I have added 2 mins here.
    SQL select to_char(to_date('23:59','HH24:MI') + numtodsinterval(2,'MINUTE'),'HH24:MI') time from dual;

    TIME
    -----
    00:01

    SQL ed
    Wrote file afiedt.buf

    1* select to_char(to_date('17:58','HH24:MI') + numtodsinterval(2,'MINUTE'),'HH24:MI') time from dual
    SQL /

    TIME
    -----
    18:00

  • RELEVANCY SCORE 3.13

    DB:3.13:Re: Select Substr From 2 Tables For Filtering. jd


    Thanks Ksridhar69:

    I will try your idea but I 'm not there yet.
    My database layout is such table a is the parent of table b. If table a has 2 rows of info and table b have 2 rows extended from table a with inherited info in culumn 'fdn' where I tried to parse the string. If I do:

    select substr(a.fdn,INSTR(a.fdn,'-',1,1)+INSTR(a.fdn,'-',1,2)-INSTR(a.fdn,'-',1,1)-1), a.userlabel, b.userlabel, b.portid
    from ont a, ontdataport b
    where (substr(a.fdn,INSTR(a.fdn,'-',1,1)+INSTR(a.fdn,'-',1,2)-INSTR(a.fdn,'-',1,1)-1)=
    substr(b.fdn,INSTR(b.fdn,'-',1,1)+INSTR(b.fdn,'-',1,2)-INSTR(b.fdn,'-',1,1)-1);

    I would get query result of 4 rows in which 2 rows are duplicated to be 4 rows..What want is 2 rows only. So how can I recode the above statement! Many thanks. HMai.

    DB:3.13:Re: Select Substr From 2 Tables For Filtering. jd

    Maxim:

    You are right, I reproduce duplicates by cutting up the string!

    table a
    fdn ontid
    NETWORK-192.168.150.115"/216="TERMINAL-1"/743 ont-1

    table b
    fdn ontportid
    NETWORK-192.168.150.115"/216="TERMINAL-1"/743="ONT-1 ontdata-1

    Just an example from the 2 tables. Now, I need come up with more filtering criteria as you said. Thanks, HM

  • RELEVANCY SCORE 3.12

    DB:3.12:Convert 02-Ott-08 To 02/10/2008 8s


    Hi to all.
    I have two date type fields (filed1 and field2) in a table in which i have the value 02/10/2008.
    When I select field value (select field from table) i get value 02-OTT-2008.
    I would like to get 02/10/2008. How could i do this?
    Here is the code:

    open cur2 for select TO_CHAR(field1),TO_CHAR(field2) from table;

    loop
    FETCH cur2 INTO entry;
    EXIT WHEN cur2%NOTFOUND;
    if field1 is not null then
    procedure(substr(to_char(to_date(entry.field1,'dd/mm/yyyy')),7,4),substr(to_char(to_date(field1,'dd/mm/yyyy')),4,2));
    else
    procedure(substr(to_char(to_date(entry.field2,'dd/mm/yyyy')),7,4),substr(to_char(to_date(field2,'dd/mm/yyyy')),4,2));
    end if;
    end loop;
    END IF;
    +...+
    +...+

    thanks in advance.

    Edited by: user635881 on 26-Nov-2008 12:34

  • RELEVANCY SCORE 3.12

    DB:3.12:Substr Concatenation xa


    I have a social security like this
    602-32-XXXX

    xxxx(Security reasons)
    I need to get rid off the -

    so I run this query
    select substr(szsmapp_ssn,1,3)||substr(szsmapp_ssn,5,6)||substr(szsmapp_ssn,8,11)
    from szsmapp and I am getting this result
    60232-054XXXX

    I need to be able to get only 9 digits...

    DB:3.12:Substr Concatenation xa

    Essentially the same but with regexp_replace function
    select REGEXP_REPLACE(szsmapp_ssn,'-')
    from szsmapp Elapsed: 00:00:00.01
    SQL select '602-32-XXXX' , regexp_replace('602-32-XXXX','-') from dual ;

    '602-32-XXX REGEXP_RE
    ----------- ---------
    602-32-XXXX 60232XXXX

  • RELEVANCY SCORE 3.11

    DB:3.11:Re: How To Tokenize A Column With Variable Length String jz


    withtest as(select 1 rid, 'i love dogs' str from dual union all select 2 rid, 'i like cats and dogs' from dual),word_to_row(rid,item,rest,step) as(select rid,substr(str,1,instr(str,' ') - 1),substr(str,instr(str,' ') + 1)||' ',1 from test union all select rid,substr(rest,1,instr(rest,' ') - 1),substr(rest,instr(rest,' ') + 1),step + 1 from word_to_row where rest is not null)select item from word_to_row order by rid,stepITEMilovedogsilikecatsanddogsRegardsEtbinselect substr(str, instr(str,' ',1,level) + 1, instr(str,' ',1,level + 1) - instr(str,' ',1,level) ) item from (select rid,' ' || str || ' ' str from test )connect by level = length(str) - length(replace(str,' ')) - 1 and prior rid = rid and prior dbms_random.random is not nullshould work in way lower versionsMessage was edited by: Etbin maybe the most classic version added

    DB:3.11:Re: How To Tokenize A Column With Variable Length String jz

    Yes, it can be a little confusing.You're wanting to create a recursive loop, but you need it to apply to just the row of data you're working on at that point in the query, so you have to include the connect by clause on the key of the record (in your example "rid = prior rid"). However, doing that makes the connect by clause believe that it's cycling and you'd get a connect by loop error. If you try and use NOCYCLE, you stop it recursing as you want, so you cannot use that... but by including the "prior sys_guid() is not null" line effectively let's the connect by clause see each recursive step as a new unique 'row' (using that term loosely here), so it no longer thinks it's cycling. Essentially you are forcing the query to cycle on your key because you know that you have another condition in the connect by clause that will prevent infinite recursion (your level = clause).

  • RELEVANCY SCORE 3.11

    DB:3.11:Ikm Multi Table Insert And Using Rownum In Source Datastore 81


    I have question how to use the Multi Table Insert IKM to leverage rownum in the source table/datastore, which is an external table.

    I need to insert the data from the file into different targets depending on the value from a fixed position in the single string, using substr. I also MUST store the original order of the data from the file in the target tables.

    Source (external table)_

    create table ext_tbl
    (str varchar2(4000) )
    Organization external....

    * external table *

    Targets_

    create table trg1
    (rowseq number
    ,c1 varchar2(3)
    ,c2 varchar2(5))

    create table trg2
    (rowseq number
    ,c1 varchar2(3)
    ,c2 varchar2(10))

    create table trg3
    (rowseq number
    ,c1 varchar2(3)
    ,c2 varchar2(15))

    Interfaces

    As recommended from Oracle (http://download.oracle.com/docs/cd/E14571_01/integrate.1111/e12644/oracle_db.htm) that the first interface should have a temp target and then use this as the source for all the target interfaces.

    The problem is how to leverage rownum from the external table and have it filtered into all of the target tables. I have attempted to add an additional column in temp target from the first interface which has a source of 'rownum'. Once running the entire process from a package I get the following:

    Error_

    ODI-1228: Task Multi_Table_2c (Integration) fails on the target ORACLE connection ora_claims1.
    Caused By: java.sql.SQLSyntaxErrorException: ORA-00976: LEVEL, PRIOR, or ROWNUM not allowed here

    ODI is attempting to 'rownum' as apart of the values in the top of the insert statement:

    insert /*+ APPEND */ all

    when 1=1 then
    into EXT
    (STR, RN)
    values
    (STR, rownum)

    when 1=1 And (SUBSTR(STR,3,1) = '1') then
    into TRG1
    (ROWSEQ, C1, C2)
    values
    (RN, SUBSTR(STR,1,3), SUBSTR(STR,4,5))

    when 1=1 And (SUBSTR(STR,3,1) = '2') then
    into TRG2
    (ROWSEQ, C1, C2)
    values
    (RN, SUBSTR(STR,1,3), SUBSTR(STR,4,5))

    when 1=1 And (SUBSTR(STR,3,1) = '3') then
    into TRG3
    (ROWSEQ, C1, C2)
    values
    (RN, SUBSTR(STR,1,3), SUBSTR(STR,4,15))

    select
    STR STR,
    rownum RN
    fromEXT_TBL EXT_TBL
    where(1=1)

    Any suggestions to get the rownum to work?

    DB:3.11:Ikm Multi Table Insert And Using Rownum In Source Datastore 81

    Hi,

    The row_number () over () does not work... ORA-30483: window functions are not allowed here.

    I am attempting to capture the order number from the file and translate to into the 3 target tables.

    For example from data file:

    '3_data...'
    '1_data...'
    '1_data...'
    '2_data...'

    Now the target tables:

    Trg1 (select * from trg1)
    rowseq c1
    2 data
    3 data

    Trg2 (select * from trg2)
    rowseq c1
    4 data

    Trg3 (select * from trg3)
    rowseq c1
    1 data

  • RELEVANCY SCORE 3.11

    DB:3.11:Instr Ans Substr Functions 7k



    Hi Friends

    In expresseion how to use the instr and substr to decode a field from the source.

    Suppose I have to get the digit which comes after a colon(:) from the source.

    Field1

    abc:1

    xyz:5

    abcd:8

    xyxyz:4

    Please help on this.

    Thanks,

    Pavan

    DB:3.11:Instr Ans Substr Functions 7k


    Try this:

    substr(

    'abcd:8',instr('abcd:8',':',1,1)+1,instr('abcd:8',':',1,1)+5
    )

    -- This gets the 5 characters after the ':' .. just incase if your requirement is not confined to single digit.

    ~~PK

  • RELEVANCY SCORE 3.11

    DB:3.11:Substr Without Instr 71


    Hi,

    Given a string, I want to get the same string EXCEPT the last character.

    Eg: 'Rahul' My output should be 'Rahu'.

    XXDAN@CRP1 select substr('Rahul',1,??) from dual;

    I know how to do it using 'instr', but, can we do it using just 'substr'?

    Thank you,
    Rahul.

    DB:3.11:Substr Without Instr 71

    Michael and Chaitanya,

    Thank you. I don't know how I missed that.

    Rahul

  • RELEVANCY SCORE 3.11

    DB:3.11:Ora-00911: Invalid Character In Crystal Reports s8


    I am sorry i dont want to include a whole query but just for anybody willing to help me on this can see the whole picture.

    When i run following query on the crystal reports XI version I get error But the report works fine but if i run the same query in Oracle get no erro

    SELECT DISTINCT
    upper(n.atm_name) atm_name
    ,m.timestamp,nvl(n.ID,'') atm_id,nvl(b.branch,'') brn_code,nvl(upper(b.ename),'') brn_name,nvl(m.p15_date_set,'') bday, bws_gen.format_ddmm(SUBSTR(m.p07_trans_dt,1,4)) trn_date, bws_gen.format_hhmmss(SUBSTR(m.p07_trans_dt,5,6)) trn_time
    , bws_gen.format_ddmm(SUBSTR(m.p07_trans_dt,1,4))||' '||bws_gen.format_hhmmss(SUBSTR(m.p07_trans_dt,5,6 )) trn_dt
    , bws_gen.format_ddmm(m.p13_date_local_txn) local_date, bws_gen.format_hhmmss(m.p12_time_local_txn) local_time
    ,bws_gen.format_ddmm(m.p13_date_local_txn)||' '||bws_gen.format_hhmmss(m.p12_time_local_txn) local_dt, '' tseq,'' onl
    , nvl(substr(m.s102_acc_id1,1,12),'') s102_acc_id1, nvl(substr(m.s103_acc_id2,1,12),'') s103_acc_id2,nvl(SUBSTR(m.p02_pan,1,6),'') imd,nvl(SUBSTR(m.p02_pan,7,16),'') crd_no,nvl(TO_NUMBER(m.p23_crd_seq_num),0) crd_seq
    , nvl(m.p32_acq_inst_id_code,'') acquirer_code
    ,DECODE(bws_gen.raw_to_string(SUBSTR(mreq.p61_rese rved_prv, 3,4),4)
    ,'00', 'Not Tran','01', 'Unconfirmed Dispense','20', 'FastCash','29', 'TCheques', decode(substr(m.p03_pcode,1,2),'99',' - Loro')||

    DECODE(bws_gen.raw_to_string(SUBSTR(mreq.p61_reser ved_prv, 1,2),2),0,' Reversal',7,' Reversal',8,' Reversal') tx_type_s

    , nvl(m.p04_amt_txn,0) amount

    , bc.currency cur

    , m.p28_amt_txn_fee

    , SUBSTR(m.p41_crd_ac_trm_id,1,4) brn

    , SUBSTR(m.p41_crd_ac_trm_id,5,4) txna_atm_id

    , cd.branch_id Crd_Brn

    , m.p03_pcode proc_code

    , m.p04_amt_txn

    , m.p05_amt_set

    , m.p06_amt_crd_bil

    , nvl(m.p11_stan,'')

    , nvl(m.p17_date_capt,'') txna_bday

    , nvl(m.p20_pan_ext_cc,'')

    , decode(substr(m.p03_pcode,1,2),'99',to_number(SUBS TR(m.p37_rrn,9,4)) - 1,SUBSTR(m.p37_rrn,9,4)) seq

    , nvl(SUBSTR(m.p37_rrn,9,4),'') seq

    , nvl(m.p49_cc_txn,'')

    , nvl(m.p50_cc_set,'')

    , nvl(m.p51_cc_crd_bil,'')

    , decode(substr(m.p03_pcode,1,2),'99','599',bws_gen. raw_to_string(mreq.p61_reserved_prv,6)) fun

    , DECODE(m.c1_mti,'0210',decode(to_number(nvl(c.ext_ reason_code,'0')),3,'Offline','Online') ,'0230','Offline','0430','Reversal') txtAuthorization

    , nvl(m.s103_acc_id2,'')

    , nvl(cd.branch_id,999) Crd_Brn

    , nvl(to_char(cd.branch_id),'') Crd_Brnch

    , DECODE(m.p39_rsp_code,'00','','10','','11','','16' ,'','R') reject_reason

    FROM gw_iso_msg m

    inner join bws_atm_network n

    on substr(m.p41_crd_ac_trm_id,5,4) = n.id

    inner join bws_branches b

    on n.branch = b.brn_id

    inner join gw_txn_ctrl c

    on m.msg_num = c.rsp_num

    inner join gw_iso_msg mreq

    on mreq.msg_num = c.rq_num

    left outer join cms_card cd

    on cd.card_num = m.p02_pan

    AND cd.seq_num = to_number(m.p23_crd_seq_num)

    inner join bwcurrency bc

    on n.currency = bc.isocurrencycode

    WHERE bws_gen.raw_to_string(mreq.p61_reserved_prv,2) IN (0,5,6,7,8)

    AND m.c1_mti IN ('0210','0230','0430')

    AND m.p32_acq_inst_id_code = {?p_acquirer}

    AND n.id = {?p_atm_from}

    AND n.id = {?p_atm_to}

    AND m.p15_date_set = {?p_bday}

    ORDER BY nvl(substr(m.s102_acc_id1,1,12),''),m.timestamp

    When opening the crystal report following error occurs:

    Details: ORA-00911: invalid character

    (Database Vendor Code 911)

    Please help out..Thanks regards

    DB:3.11:Ora-00911: Invalid Character In Crystal Reports s8

    1. If i use without "?" it will not prompt me for inputs
    2. I want to insert Null if the value is not there
    3. I have checked the brackets throughly look like they are ok
    4. I have removed WHERE clause but same issue
    5. I have removed reserved word from the query but still same error
    6. There is no space bw package and function name.

    This error look like it try to convert some char-num or some char ASCII code.

  • RELEVANCY SCORE 3.11

    DB:3.11:How To Align A Backspace Button In Sql Form mm


    hi all,how to make to work a backspace button in oracle form for virtual keyboard.DECLARE TEST number;BEGIN TEST:=length( :TEXT);-- :TEXT:=test||chr(8);:TEXT:=substr(:text,1,test-1);END;this won't work properly..

    DB:3.11:How To Align A Backspace Button In Sql Form mm

    Code is attached to some Forms trigger. Which trigger is that?And what is this "virtual keyboard" you are using?Also, always include your Forms and Java version, browser, etc.

  • RELEVANCY SCORE 3.11

    DB:3.11:Re: Where Clause With Substr For A Update Statement 37


    Hi,According to the SUBSTR function that you have written,it fetches 3 characters starting from position 2.
    So how come 3 characters be equal to '1'.
    Moreever you also need to correct the syntax:
    UPDATE TABLE.STATUS_FLAGS
    SET TABLE.STATUS_FLAGS = 1 || substr(TABLE.STATUS_FLAGS,1,4)
    WHERE SUBSTR(TABLE.STATUS_FLAGS,2,3)= you string;

    DB:3.11:Re: Where Clause With Substr For A Update Statement 37

    Thanks so much for your help.

    I made a small error in my if else statements causing the initial second problem.

    Now all is fine and resolved.

  • RELEVANCY SCORE 3.11

    DB:3.11:Working Of Substr/Instr In Oracle fa


    Hi All,How to achieve the following targert through SUBSTR and INTR :Text/field is 'ABCD MUMBAI 123456 MH'I want to get MUMBAI OR MH only from the string. So, can anyone tell me proper combinations of substr and instr to get the result.Thanks,KJ

    DB:3.11:Working Of Substr/Instr In Oracle fa

    OK, how about parameterizing it then:
    SQL -- generating sample string
    SQL with t as ( select 'ABCD MUMBAI 123456 MH' text from dual )
    2 --
    3 -- actual query:
    4 --
    5 select text
    6 , substr( text
    7 , instr(text, :searchstring)
    8 , instr(text, :searchstring)-instr(text, :searchstring)+length(:searchstring)
    9 ) col1
    10 from t;

    TEXT COL1
    --------------------- ---------------------
    ABCD MUMBAI 123456 MH MUMBAI

    1 row selected.

    SQL exec :searchstring := 'MH'

    PL/SQL procedure successfully completed.

    SQL /

    TEXT COL1
    --------------------- ---------------------
    ABCD MUMBAI 123456 MH MH

    1 row selected.

  • RELEVANCY SCORE 3.11

    DB:3.11:Will This Query Work? s8


    Email id in one of my tables A is stored in the format -- email://XXXX@XXXX.XXX
    If I want this to get displayed as just XXXX@XXXX.XXX where X is any address and its value is varying for eg -- abd@domain.com or abcdefghi@domain.com etc
    Can I give my query like this?

    insert into A values(select trim(substr(email,1,9)); -- I am trying to trim email://
    Will trim(substr) work?

    Please advise

    DB:3.11:Will This Query Work? s8

    user6440749 wrote:
    So does trim(substr) work?Why not :) ?

    SQL ed
    Wrote file afiedt.buf

    1* select trim(substr('EMAIL:// XXXX@XXXX.XXX ',9)) from dual
    SQL /

    TRIM(SUBSTR('
    -------------
    XXXX@XXXX.XXXNote the space after // and after .xxx are trimmed in the result.

    -Arun

  • RELEVANCY SCORE 3.10

    DB:3.10:Use Group By On Oracle 77


    We have to use a group by into a request from an oracle database :
    SELECT SUBSTR(ETETAFI,0,6)
    ||'0'
    ||' '
    ||' '
    ||MAX(SUBSTR(ETETAFI,13,35))
    ||RPAD(TO_CHAR(SUM(TO_NUMBER(SUBSTR(ETETAFI,48,16)))),16,' ')
    ||RPAD(TO_CHAR(SUM(TO_NUMBER(SUBSTR(ETETAFI,64,16)))),16,' ')
    ||RPAD(TO_CHAR(SUM(TO_NUMBER(SUBSTR(ETETAFI,80,16)))),16,' ')
    ||RPAD(TO_CHAR(SUM(TO_NUMBER(SUBSTR(ETETAFI,96,16)))),16,' ')
    FROM JDEDATA900.F7409FOW GROUP BY SUBSTR(ETETAFI,0,6)
    Do you know how to do that as the table JDEDATA900.F7409FOW is our source.

    Thanks.

    DB:3.10:Use Group By On Oracle 77

    Thanks.

    could you give an example please.

  • RELEVANCY SCORE 3.10

    DB:3.10: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:3.10: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 3.09

    DB:3.09:Modulus 10 Check fp



    Problem Description:

    Problem occurs when doing a modulus 10 check on ID Numbers.

    I have ID numbers (eg: 1999999999999 and 9999999999999), and the month and day is calculated as 99 and 99 respectively. The problem occurs in the alogrithm.

    I have inserted a step: If sum (EvenTot + OddTot) = 99 Then IdAlgoX = -1; this is to say it is invalid, however the error message still appears??

    Can anyone help pls...

    /Fields for valid date testing/

    month = input(substr(temp,3,2),2.);

    day = input(substr(temp,5,2),2.);

    /Fields for Modulus 10 check/;

    OddTot= Sum(input(Substr(temp, 1,1),1.),

    input(Substr(temp, 3,1),1.),

    input(Substr(temp, 5,1),1.),

    input(Substr(temp, 7,1),1.),

    input(Substr(temp, 9,1),1.),

    input(Substr(temp,11,1),1.));

    EvenTot=Sum(input(Substr(Put(input(Substr(temp, 2,1),1.)2,z2.),1,1),1.), / Two1 */

    input(Substr(Put(input(Substr(temp, 2,1),1.)2,z2.),2,1),1.), / Two2 */

    input(Substr(Put(input(Substr(temp, 4,1),1.)2,z2.),1,1),1.), / Fou1 */

    input(Substr(Put(input(Substr(temp, 4,1),1.)2,z2.),2,1),1.), / Fou2 */

    input(Substr(Put(input(Substr(temp, 6,1),1.)2,z2.),1,1),1.), / Six1 */

    input(Substr(Put(input(Substr(temp, 6,1),1.)2,z2.),2,1),1.), / Six2 */

    input(Substr(Put(input(Substr(temp, 8,1),1.)2,z2.),1,1),1.), / Eig1 */

    input(Substr(Put(input(Substr(temp, 8,1),1.)2,z2.),2,1),1.), / Eig2 */

    input(Substr(Put(input(Substr(temp,10,1),1.)2,z2.),1,1),1.), / Ten1 */

    input(Substr(Put(input(Substr(temp,10,1),1.)2,z2.),2,1),1.), / Ten2 */

    input(Substr(Put(input(Substr(temp,12,1),1.)2,z2.),1,1),1.), / Twe1 */

    input(Substr(Put(input(Substr(temp,12,1),1.)2,z2.),2,1),1.)); / Twe2 */

    IdAlgoX=10-input(Substr(Put(Sum(EvenTot,OddTot),z2.),2,1),1.);

    If sum (EvenTot + OddTot) = 99 Then IdAlgoX = -1;

    IdAlgoY=input(Substr(temp,13,1),1.);

    If IdAlgoX = 10 then IdAlgoX = 0;

    DB:3.09:Modulus 10 Check fp


    Hi sas-learner2

    I was honestly too lazy in trying to understand your code to the last bit.

    May be the following is anyway of some help to you as it implements a modulo10 check as described in http://en.wikipedia.org/wiki/Luhn_algorithm for any string with digits only.

    There might be more elaborate ways to do it and I'm almost sure this wheel is already invented in the SAS world. The code below is what I can come up with right now.

    HTH

    Patrick

    data null;

    input id $ 1-30;

    length AddIt $2;

    ChkStr=left(reverse(id));

    do pos=1 to length(ChkStr);

    if mod(pos,2) then /* odd positions */

    do;

    AddIt=substr(ChkStr,pos,1);

    end;

    else /* even positions: digit*2 */

    do;

    AddIt=put(2*input(substr(ChkStr,pos,1),2.),2.);

    end;

    /* add digits */

    do i=1 to length(AddIt);

    ChkSum+input(substr(AddIt,i,1),2.);

    end;

    end;

    /* Check if ID is valid or not (if ChkSum ends with Zero) */

    if mod(ChkSum,10)=0 then

    do;

    put 'This is a valid ID: ' ID= ChkSum=;

    end;

    else

    if mod(ChkSum,10) ne 0 then

    do;

    put 'This is a invalid ID: ' ID= ChkSum=;

    end;

    datalines;

    123456789

    3847592

    48573726264859560

    2843759

    00028434305834

    442308239586

    ;

    run;

  • RELEVANCY SCORE 3.09

    DB:3.09:Invalid Number Issue In Where Clause zf


    Hi,

    I have the below code snippet that's failing with a ORA-01722, Invalid Number.
    select a.po_id, b.rb_mkstr_cd, a.insp_dt
    from Table1 a, Table2 b
    where DECODE(SUBSTR(UPPER(a.PO_ID),1,1),'S','SP','U','SU','F','FA','H','HO') = b.Xse_Sesn_Cd (+)
    and SUBSTR(LPAD(TRUNC((TO_CHAR(a.INSP_DT,'YY')+ 5 - SUBSTR(a.PO_ID,2,1))/10),2,'0'),2,1)||SUBSTR(a.PO_ID,2,1) = SUBSTR(CodeMsc.Xsn_Sesn_Yr_Rng(+),3,2)SUBSTR(a.PO_ID,2,1))/10 The above portion of the code where the arithmetic operation occurs has a null/blank character in the a.po_id field, causing the select to fail.

    I tried using the NVL function on the substr(a.po_id,2,1))/10 but that did not work.
    Is there a work around to resolve the error?

    DB:3.09:Invalid Number Issue In Where Clause zf

    Thanks for you help Christian. This worked !!!

  • RELEVANCY SCORE 3.09

    DB:3.09:Any Clues Why The Procedure Taking So Long. md


    Hi

    When I am running a query on the schema which has the VPD on it its returning in like 1min and 24 sec out of which 43 seconds the VPD APPLY_PRED is taking. The following is the part output from TKPROF of that session .

    declare p varchar2(32767); begin p :=
    ABC.APPLY_PREDICATE(:sn, :on); :v1
    := substr(p,1,4000); :v2 := substr(p,4001,4000); :v3 :=
    substr(p,8001,4000); :v4 := substr(p,12001,4000); :v5 :=
    substr(p,16001,4000); :v6 := substr(p,20001,4000); :v7 :=
    substr(p,24001,4000); :v8 := substr(p,28001,4000); :v9
    := substr(p,32001,767); :v10 := substr(p, 4000, 1); :v11
    := substr(p,8000,1); :v12 := substr(p, 12000, 1); :v13 :=
    substr(p,16000,1); :v14 := substr(p, 20000, 1); :v15 :=
    substr(p,24000,1); :v16 := substr(p, 28000, 1); :v17 :=
    substr(p,32000,1); end;

    call count cpu elapsed disk query current rows
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------
    Parse 33326 9.13 8.84 0 0 0 0
    Execute 33326 36.38 35.13 0 299502 0 33326
    Fetch 0 0.00 0.00 0 0 0 0
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------
    total 66652 45.51 43.97 0 299502 0 33326

    Any help how to decrease the time.
    The same thing executed for other user is taking 306 seconds.

    Thanks in advance

    DB:3.09:Any Clues Why The Procedure Taking So Long. md

    Look at the parse count: 33326, which is as much as the number of executes. Somewhere in the ABC.APPLY_PREDICATE function you are probably not using bind variables. Could you please paste the code of that function here ?

    Also, what was the number of "Misses in library cache" in the tkprof file ?

    Regards,
    Rob.

  • RELEVANCY SCORE 3.09

    DB:3.09:Re: Macro To Insert Drawing Border xd



    I am trying to make a macro that uses the file name to call the appropriate script file to set some preferences and insert our company's title block. We have our drawings saved by this naming convention: "6digit_p/n"_"bordersize" (e.g. 549395_D.dwg) I put it in a button so it would be easily accessible. I broke the macro at the if statements to make it easier to read.
    ^C^C_script;$M=$(eval,$(if,$(eq,$(upper,$(substr,$​(getvar,dwgname),6,1)),D),dblock,$(if,$(eq,$(upper,$(substr,$(getvar,dwgname),8,1))​,C),cblock,$(if,$(eq,$(upper,$(substr,$(getvar,dwgname),8,1))​,B),bblock,$(if,$(eq,$(upper,$(substr,$(getvar,dwgname),8,1))​,A),ablock,invalid_dwg_file_name))))).scr;

    What is weird is that doesn't work, but it displays this in the command line:

    

    However, if I change it to this it works (only for the file names with D, d, C, or c in the file name though)
    ^C^C_script;$M=$(if,$(eq,$(substr,$(getvar,dwgname​),6,1),D),dblock,$(if,$(eq,$(substr,$(getvar,dwgname),8,1),d),dbloc​k,$(if,$(eq,$(substr,$(getvar,dwgname),8,1),C),cbloc​k,$(if,$(eq,$(substr,$(getvar,dwgname),8,1),c),cbloc​k,invalid_dwg_file_name)))).scr;
    Anyone know how to make this work, or have a better way?

    I did post this in the "Visual LISP, AutoLISP and General Customization" forum, but have not gotten any responses yet.




    ─────────────────────────────────────────────────────────────────────────────────────────────Brandon Gingerich

    DB:3.09:Re: Macro To Insert Drawing Border xd


    DIESEL macro length limits have been around forever, no workaround except to reduce the amount of DIESEL expressions in your code (in LT that is, or go with Lisp in full AutoCAD and verticals).




    Dean Saadallah Blog | Facebook | Google+ | Twitter | PINS*I am NOT a paid Autodesk/Forum Consultant*