Query required for below situation.

Hi All,
I have two table
T1 --> deal_site_id, subsection_id
T2 --> deal_site_id, subsection_id, catalog_id
requirement is first I need to check all the subsection_id in table T1 depending upon one deal_site_id.
Then what ever subsection_id I get from table T1 I need to check if those are available in table T2. If they are available then do nothing but if they are not available in table T2 then delete the row from table T1.
I've tried to write the query like below but stuck with exception.
DELETE FROM (SELECT * FROM T1 lid inner join T2 ld
ON LID.DEAL_SITE_ID = LD.DEAL_SITE_ID
WHERE lid.deal_site_id = 3070
AND LD.SUBSECTION_ID NOT IN (SELECT DISTINCT liod.subsection_id from T1 liod where liod.deal_site_id = 3070 )
this is giving me an exception like ORA-01752: cannot delete from view without exactly one key-preserved table
Please help me to write this query. Thanks in advance.
Regards,
Subhadeep
Edited by: sumajumd on Feb 2, 2012 3:08 AM

Hi, Subhadeep,
That sounds like:
DELETE FROM     t1
WHERE     deal_site_id     = 3070     -- or whatever
AND     subsection_id   NOT IN (
                      SELECT  subsection_id
                      FROM    t2
                      WHERE   deal_site_id     = t1.deal_site_id
                      AND       subsection_id     IS NOT NULL     -- If necessary
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
In the case of a DML operation (such as DELETE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
Explain, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using.

Similar Messages

  • Query Required for FMS

    Dear Expert
               I want the Query for to convert Value in to words,the value is  the document total value.

    HI,
    Try This It may help you
    ->> Create 1 UDF in Header on Requrie Documents (ex. Marketing Documents).
    ->> Create 3 Function in MSSQL Server Management.
    ->> Create 1 FMS in Query Generator and save as Query Manager then Assign to UDF for Amount in Words.
    for example:
    Create UDF in Header on Marketing Documents.
    ->> Choose Tools on Top menu.
    ->> User - Defined Fields. -> User Manage Fields.
    ->> Open the User Manage Fields Widnow.
    ->> Marketing Documents. -> Title.
    ->> Select Title and Click Add button in Bottom on User Manage Fields Window.
    ->> Create Amount in Words UDF(Code, Discription and Type - Character) and Add the UDF.
    Create Function in MSSQL Server Management.
    Check this Link, (have 3 Functions in Link).
    http://techcreeze.blogspot.com/2008/11/convert-amount-into-words-according-to_15.html
    1st Funciton - to Convert one Digit Number to words
    2nd Funciton - to convert 2 digit number to words.
    3rd Funciton - to convert amt in numbers to words.
    ->> Open the MSSQL Server Management Window.
    ->> Choose your Company database and Create NEW Query.
    ->> Create 3 Function Queries one by one.
    ->> Create 3 NEW Query Tab and 1st one put the 1st Function then Run the Function. and
    2nd New Query tab put the 2nd Function then Run the Function.
    3rd New Query tab put the 3rd Function then Run the Function.
    Create FMS in Query Generator and Save as Query Manager.
    ->> Adminstration.
    ->> Reports. -> Query Generator.
    ->> Open the Query Generator and put the below FMS query.
    for example : Purchase Order Doc. Toal(in wrods).
    declare @Doc_total numeric (19,6)
    set @Doc_total=$http://OPOR.DocTotal
    select dbo.fNumToWords (@Doc_total)
    ->> Assign the FMS in UDF on Purchase Order.
    ->> Auto Refresh of Document Total.
    Ex.
    1. Goto the UDF and Clcik Shift+Alt+F2.
    2. Select the SEARCH BY SAVED QUERY.
    3. Assign the FMS Query.
    4. Select the AUTO REFRESH WHEN FIELD CHENGES.
    5. Select Document Total.
    6. Check the Display Saved Values
    I am including here, source code of functions required for converting Number into words according to Indian or Nepali Numbering style. In Indian or Nepali Numbering style, 100000 is 1 Lakh and 100 Lakhs or 10000000 is 1 Crore. This makes the numbering style different from English and International Numbering Style.
    1. Function to Convert one Digit Number to words.
    CREATE    Function dbo.fConvertDigit(@decNumber decimal)
    returns varchar(6)
    as
    Begin
    declare
    @strWords varchar(6)
    Select @strWords = Case @decNumber
         When '1' then 'One'
         When '2' then 'Two'
         When '3' then 'Three'
         When '4' then 'Four'
         When '5' then 'Five'
         When '6' then 'Six'
         When '7' then 'Seven'
         When '8' then 'Eight'
         When '9' then 'Nine'
         Else ''
    end
    return @strWords
    end
    2. Function to convert 2 digit number to words.
    CREATE    Function dbo.fConvertTens(@decNumber varchar(2))
    returns varchar(30)
    as
    Begin
    declare @strWords varchar(30)
    --Is value between 10 and 19?
    If Left(@decNumber, 1) = 1
    begin
    Select @strWords = Case @decNumber
         When '10' then 'Ten'
         When '11' then 'Eleven'
         When '12' then 'Twelve'
         When '13' then 'Thirteen'
         When '14' then 'Fourteen'
         When '15' then 'Fifteen'
         When '16' then 'Sixteen'
         When '17' then 'Seventeen'
         When '18' then 'Eighteen'
         When '19' then 'Nineteen'
    end
    end
    else  -- otherwise it's between 20 and 99.
    begin
    Select @strWords = Case Left(@decNumber, 1)
         When '0' then '' 
         When '2' then 'Twenty '
         When '3' then 'Thirty '
         When '4' then 'Forty '
         When '5' then 'Fifty '
         When '6' then 'Sixty '
         When '7' then 'Seventy '
         When '8' then 'Eighty '
         When '9' then 'Ninety '
    end
    Select @strWords = @strWords + dbo.fConvertDigit(Right(@decNumber, 1))
    end
    --Convert ones place digit.
    return @strWords
    end
    3. Function to convert amt in numbers to words. (Built with the help of above 2 functions)
    CREATE function dbo.fNumToWords (@decNumber decimal(12, 2))
    returns varchar(300)
    As
    Begin
    Declare
    @strNumber varchar(100),
    @strRupees varchar(200),
    @strPaise varchar(100),
    @strWords varchar(300),
    @intIndex integer,
    @intAndFlag integer
    Select @strNumber = Cast(@decNumber as varchar(100))
    Select @intIndex = CharIndex('.', @strNumber)
    if(@decNumber>99999999.99)
    BEGIN
    RETURN ''
    END
    If @intIndex > 0
    begin
    Select @strPaise = dbo.fConvertTens(Right(@strNumber, Len(@strNumber) - @intIndex))
    Select @strNumber = SubString(@strNumber, 1, Len(@strNumber) - 3)
    If Len(@strPaise) > 0 Select @strPaise = @strPaise + ' paise'
    end
    Select @strRupees = ''
    Select @intIndex=len(@strNumber)
    Select @intAndFlag=2
    while(@intIndex>0)
    begin
    if(@intIndex=8)
    begin
      Select @strRupees=@strRupees+dbo.fConvertDigit(left(@decNumber,1))+' Crore '
      Select @strNumber=substring(@strNumber,2,len(@strNumber))
      Select @intIndex=@intIndex-1
    end
    else if(@intIndex=7)
    begin
      if(substring(@strNumber,1,1)='0')
      begin
       if substring(@strNumber,2,1)<>'0'
       begin
        if (@strRupees<>NULL and substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and substring(@strNumber,6,1)='0' and substring(@strNumber,7,1)='0' and @intAndFlag=2 and @strPaise=NULL)
        begin
         Select @strRupees=@strRupees+' and ' +dbo.fConvertDigit(substring(@strNumber,2,1))+' Lakh '
         Select @intAndFlag=1
        end
        else
        begin
         Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,2,1))+' Lakh '
        end
        Select @strNumber=substring(@strNumber,3,len(@strNumber))
        Select @intIndex=@intIndex-2
       end
       else
       begin
        Select @strNumber=substring(@strNumber,3,len(@strNumber))
        Select @intIndex=@intIndex-2
       end
      end
      else
      begin
       if(substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and substring(@strNumber,6,1)='0' and substring(@strNumber,7,1)='0'  and @intAndFlag=2 and @strPaise='')
       begin  
        Select @strRupees=@strRupees+' and ' + dbo.fConvertTens(substring(@strNumber,1,2))+' Lakhs '
        Select @intAndFlag=1
       end
       else
       begin
        Select @strRupees=@strRupees+dbo.fConvertTens(substring(@strNumber,1,2))+' Lakhs '
       end
       Select @strNumber=substring(@strNumber,3,len(@strNumber))
       Select @intIndex=@intIndex-2
      end
    end
    else if(@intIndex=6)
      begin
       if(substring(@strNumber,2,1)<>'0' or substring(@strNumber,3,1)<>'0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and substring(@strNumber,6,1)='0' and @intAndFlag=2 and @strPaise='')
       begin
        if len(@strRupees) <= 0
        begin
         if convert(int,substring(@strNumber,1,1)) = 1
         begin
          Select @strRupees=@strRupees+'' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakh '
          Select @intAndFlag=2
         end
         else
         begin
          Select @strRupees=@strRupees+'' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakhs '
          Select @intAndFlag=2
         end
        end
        else
        begin
         if convert(int,substring(@strNumber,1,1)) = 1
         begin
          Select @strRupees=@strRupees+' and' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakh '
          Select @intAndFlag=1
         end
         else
         begin
          Select @strRupees=@strRupees+' and' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakhs '
          Select @intAndFlag=1
         end
        end
       end
       else
       begin
        if convert(int,substring(@strNumber,1,1)) = 1
        begin
         Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakh '
        end
        else
        begin
         Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,1,1))+' Lakhs '
        end
       end
       Select @strNumber=substring(@strNumber,2,len(@strNumber))
       Select @intIndex=@intIndex-1
      end
    else if(@intIndex=5)
      begin
       if(substring(@strNumber,1,1)='0')
       begin
        if substring(@strNumber,2,1)<>'0'
        begin
         if(substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and @intAndFlag=2 and @strPaise='')
         begin
          Select @strRupees=@strRupees+' and ' +dbo.fConvertDigit(substring(@strNumber,2,1))+' Thousand '
          Select @intAndFlag=1
         end
         else
         begin
          Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,2,1))+' Thousand '
         end
         Select @strNumber=substring(@strNumber,3,len(@strNumber))
         Select @intIndex=@intIndex-2
        end
        else
        begin
         Select @strNumber=substring(@strNumber,3,len(@strNumber))
         Select @intIndex=@intIndex-2
        end
       end
       else
       begin
        if(substring(@strNumber,3,1)='0' and substring(@strNumber,4,1)='0' and substring(@strNumber,5,1)='0' and @intAndFlag=2 and @strPaise='')
        begin
         Select @strRupees=@strRupees+' and '+dbo.fConvertTens(substring(@strNumber,1,2))+' Thousand '
         Select @intAndFlag=1
        end
        else
        begin
         Select @strRupees=@strRupees+dbo.fConvertTens(substring(@strNumber,1,2))+' Thousand '
        end
        Select @strNumber=substring(@strNumber,3,len(@strNumber))
        Select @intIndex=@intIndex-2
       end
      end
    else if(@intIndex=4)
      begin
       if ( (substring(@strNumber,3,1)<>'0' or substring(@strNumber,4,1)<>'0') and substring(@strNumber,2,1)='0' and  @intAndFlag=2 and @strPaise='')
       begin
        Select @strRupees=@strRupees+' and' + dbo.fConvertDigit(substring(@strNumber,1,1))+' Thousand '
        Select @intAndFlag=1
       end
       else
       begin
       Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,1,1))+' Thousand '
       end
       Select @strNumber=substring(@strNumber,2,len(@strNumber))
       Select @intIndex=@intIndex-1
      end
    else if(@intIndex=3)
      begin
       if  substring(@strNumber,1,1)<>'0'
       begin
        Select @strRupees=@strRupees+dbo.fConvertDigit(substring(@strNumber,1,1))+' Hundred '
        Select @strNumber=substring(@strNumber,2,len(@strNumber))
        if( (substring(@strNumber,1,1)<>'0' or  substring(@strNumber,2,1)<>'0') and @intAndFlag=2 )
        begin
         Select @strRupees=@strRupees+' and '
         Select @intAndFlag=1
        end
        Select @intIndex=@intIndex-1
       end
       else
       begin
        Select @strNumber=substring(@strNumber,2,len(@strNumber))
        Select @intIndex=@intIndex-1
       end
      end
    else if(@intIndex=2)
      begin
       if substring(@strNumber,1,1)<>'0'
       begin
        Select @strRupees=@strRupees+dbo.fConvertTens(substring(@strNumber,1,2))
        Select @intIndex=@intIndex-2
       end
       else
       begin
        Select @intIndex=@intIndex-1
       end
      end
    else if(@intIndex=1)
      begin
       if(@strNumber<>'0')
       begin
        Select @strRupees=@strRupees+dbo.fConvertDigit(@strNumber)
       end
       Select @intIndex=@intIndex-1
      end
    continue
    end
    if len(@strRupees)>0 Select @strRupees=@strRupees+ ' rupees '
    IF(len(@strPaise)<>0)
    BEGIN
    if len(@strRupees)>0 Select @strRupees=@strRupees + ' and '
    END
    Select @strWords = IsNull(@strRupees, '') + IsNull(@strPaise, '')
    select @strWords = @strWords + ' only'
    Return @strWords
    End
    Regards
    Balaji Sampath

  • Query required for the below result format:

    Table(DATA):
    Bank_id Device_type Status date Station_status               
    1011     N          Y     3/23/2012           DOWN
    1011          N          Y     3/23/2012          up
    1011          N          y     3/23/2012          up
    1011          E          Y     3/23/2012          down
    1011          E          I     3/23/2012          down
    1011          W          Y     3/23/2012          up
    1012     N          Y     3/23/2012           DOWN
    1012          N          Y     3/23/2012          up
    1012          N          y     3/23/2012          up
    1012          E          Y     3/23/2012          down
    1012          E          I     3/23/2012          down
    1012          W          Y     3/23/2012          up
    1013     N          Y     3/23/2012           DOWN
    1013          N          Y     3/23/2012          up
    1013          N          y     3/23/2012          up
    1013          E          Y     3/23/2012          down
    1013          E          I     3/23/2012          down
    1013          W          Y     3/23/2012          up
    (SELECT QUERY RESULT SHOULD BE LIKE THIS):Report result:
    Bank_id----Date-----TOTAL---UP_STATUS--DOWN_STATUS-----DEVICE
    1011 3/23/2012 6 3 3 N<2>N<1>,E<0>E<2>,W<1>W<0>
    1012 3/23/2012 6 3 3 N<2>N<1>,E<0>E<2>,W<1>W<0>
    1013 3/23/2012 6 3 3 N<2>N<1>,E<0>E<2>,W<1>W<0>
    N<2>N<1>,E<0>E<2>,W<1>W<0> this mean(INDICATES)
    In N 2 UP 1 DOWN
    IN E 0 up 2 down
    In W 1 up 0 down
    SCRIPTS:
    CREATE TABLE FIMS_TEST
    BANK_ID VARCHAR2(10 BYTE),
    DEVICE_TYPE VARCHAR2(10 BYTE),
    STATUS VARCHAR2(1 BYTE),
    DATE_TS DATE,
    STATION_STATUS VARCHAR2(10 BYTE)
    INSERT SCRIPT:
    SET DEFINE OFF;
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1011', 'N', 'Y', TO_DATE('03/26/2012 16:30:48', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1011', 'N', 'Y', TO_DATE('03/26/2012 16:32:26', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1011', 'N', 'Y', TO_DATE('03/26/2012 16:32:55', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1011', 'E', 'Y', TO_DATE('03/26/2012 16:33:51', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1011', 'I', 'Y', TO_DATE('03/26/2012 16:34:15', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1011', 'W', 'Y', TO_DATE('03/26/2012 16:34:39', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1012', 'N', 'Y', TO_DATE('03/26/2012 16:35:13', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1012', 'N', 'Y', TO_DATE('03/26/2012 16:35:56', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1012', 'N', 'Y', TO_DATE('03/26/2012 16:36:48', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1012', 'E', 'Y', TO_DATE('03/26/2012 16:37:17', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1012', 'E', 'I', TO_DATE('03/26/2012 16:37:42', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1012', 'W', 'Y', TO_DATE('03/26/2012 16:38:10', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1013', 'N', 'Y', TO_DATE('03/26/2012 16:38:37', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN ');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1013', 'N', 'Y', TO_DATE('03/26/2012 16:39:23', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1013', 'N', 'Y', TO_DATE('03/26/2012 16:39:54', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1013', 'E', 'Y', TO_DATE('03/26/2012 16:40:19', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1013', 'E', 'I', TO_DATE('03/26/2012 16:40:53', 'MM/DD/YYYY HH24:MI:SS'), 'DOWN');
    Insert into TEST.FIMS_TEST
    (BANK_ID, DEVICE_TYPE, STATUS, DATE_TS, STATION_STATUS)
    Values
    ('1013', 'W', 'Y', TO_DATE('03/26/2012 16:41:17', 'MM/DD/YYYY HH24:MI:SS'), 'UP');
    COMMIT;

    thanks in advance
    can any one help me please

  • Query required for JE posted with the customer

    Dear Experts,
                   Following is the scenario - Accountant passes Journal Entries once in a while with regard to customers also, i would require a alert for the scenario.
                    Whenever the user posts a JE with regard to a customer alert has to generate to the manager else a query report is required would do.
    Saravanan

    Hi,
    You can use the below as an alert for Manual Journal Entries that has been created the last 2 days with posting to Business Partner account.
    SELECT t0.transid, t0.shortname
    FROM JDT1 T0 INNER JOIN OJDT T1 ON T0.TransId = T1.TransId
    WHERE shortname <> account and  T1.createdate > getdate()-2 and t0.transtype = 30
    If you want to have a different date range just change the '-2' to the amount of days you want, if you only want entries created today, just remore it. If you prefer it to be by posting date rather than by creaation (system) date, just change createdate to refdate.
    Hope it helps,
    Jesper

  • Query required for rule

    Below is the condition for which a query is to be written.
    as of now this the query i have written. am getting the orderids which satisfy this rule but the output should include all those orderids which already satisfy the rule.(i.e the current o/p contains those orderids which share a common circuitid and have same start and end dates. the output required should include this as well as those orderids tat do not share circuitids.
    or
    the o/p should contain those orderids which do not fall into any of these categories)
    The Rule:
    For the Entity Circuit Orders if the Circuit Id is same for two different order IDs then the Order Start Date for the Order Id having Order Status as Installed should be same as the Order End Date for the Order Id having Order Status as Retired.
    Tthe query:
    select order_id from managed_element1 where order_status = 'I' and order_start_date in
    (select order_end_date from managed_element1 where circuit_id in
    (SELECT circuit_id FROM managed_element1 where order_status='R' GROUP BY circuit_id))

    The data is as below
    Order_id circuit_id start_date end_date order_status
    ORDER_67 BORDER_2 03/05/06 05/09/06 R
    ORDER_7 BORDER_6 10/26/06 I
    ORDER_11 BORDER_7 12/05/06 12/06/07 I
    ORDER_1 BORDER_2 05/09/06 05/19/06 R
    ORDER_2 BORDER_2 05/19/06 I
    ORDER_3 BORDER_3 04/03/06 05/20/06 R
    ORDER_4 BORDER_3 05/20/06 I
    ORDER_5 BORDER_4 02/05/06 05/06/06 R
    ORDER_6 BORDER_4 05/05/06 I
    ORDER_7 BORDER_5 10/22/02 02/23/03 R
    ORDER_8 BORDER_5 02/23/03 I
    ORDER_9 BORDER_6 03/12/06 09/26/06 R
    ORDER_10 BORDER_6 09/26/0610/26/06 R

  • What are the Master Table validations required for below fields

    Hi,
    I have created a selection screen with following fields.
    Can anybody tell me what are the exact master table vaidation i can do for the same!
    <b>Order Type[VBAK-AUART],
    Order Number[VBAK-VBELN],
    Customer PO #[VBKD-BSTKD],
    Sold-to Party No[VBPA-PARVW - SP as key],
    Ship-to Party No[VBPA-PARVW - SH as key],
    Division[VBAK-SPART].</b>
    Agaist which master tables i need to vaidate above fields!
    Also please clarify what is meant by [SP as Key] & [SH as key]! Is it needs to be defaulted!
    Thanks in advance.
    Thanks,
    Prasad.

    Hi Prasad,
    For your another Query
      SH- Ship To Party,
      SP - Sold To party.
    You can set anyone of them as Default depending on ur Bsuiness requirement ie. You are Forwarding ur Invoice to ship to or sold to Party.
    Regards,
    Leo

  • Query required for xml processing.

    This data is present in clob i need to extract the below mentioned field.
    expected query is
    select
    extractvalue( xmltype(table1.column1), '/UserProfileSnapshot/UserInfo/Attribute[@name="Users.Display Name"]' )
    from table1
    first line is incorrect <?xml version = '1.0' encoding = 'UTF-8'?>
    Can anyone please help me in making a query for this incorrect clob data.
    As we cannot change this first line in data.
    "<?xml version = '1.0' encoding = 'UTF-8'?>
    <UserProfileSnapshot key="224" version="1.0">
    <UserInfo>
    <Attribute name="Users.Display Name">testfuturedate102, Mr. user</Attribute>
    <Attribute name="USR_UDF_HR_ORG_ID">202</Attribute>
    <Attribute name="Users.Xellerate Type">End-User</Attribute>
    <Attribute name="Users.Role">Employee</Attribute>
    <Attribute name="Users.First Name">user</Attribute>
    <Attribute name="Users.Status">Active</Attribute>
    <Attribute name="USR_UDF_LOCATION_ID">1737</Attribute>
    <Attribute name="Users.Provisioned Date">2013-04-23 10:04:48 -0400</Attribute>
    <Attribute name="Title">MR.</Attribute>
    <Attribute name="USR_UDF_LOCATION_CODE">HR- New York</Attribute>
    <Attribute name="Country">US</Attribute>
    <Attribute name="State">NY</Attribute>
    <Attribute name="Users.Password Reset Attempts Counter">0</Attribute>
    <Attribute name="Users.Disable User">0</Attribute>
    <Attribute name="Users.Change Password At Next Logon">1</Attribute>
    <Attribute name="USR_CN_GENERATED">0</Attribute>
    <Attribute name="USR_UDF_EFFECTIVE_START_DATE">2013-03-08 00:00:00 -0500</Attribute>
    <Attribute name="Postal Code">10001</Attribute>
    <Attribute name="Users.Update Date">2013-04-23 10:04:48 -0400</Attribute>
    <Attribute name="Employee Number">2335</Attribute>
    <Attribute name="USR_UDF_DEPARTMENT_NAME">Vision Corporation</Attribute>
    <Attribute name="Users.Last Name">testfuturedate102</Attribute>
    <Attribute name="Users.End Date">4712-12-31 00:00:00 -0500</Attribute>
    <Attribute name="Hire Date">2013-02-28 00:00:00 -0500</Attribute>
    <Attribute name="USR_UDF_PERSON_ID">31967</Attribute>
    <Attribute name="USR_UDF_IS_MANAGER">N</Attribute>
    <Attribute name="Users.Creation Date">2013-04-23 10:04:48 -0400</Attribute>
    <Attribute name="Street">500 Madison Ave</Attribute>
    <Attribute name="Users.User ID">31967</Attribute>
    <Attribute name="USR_UDF_CITY">New York</Attribute>
    <Attribute name="Users.Lock User">0</Attribute>
    <Attribute name="Users.Updated By Login" key="4">OIMINTERNAL</Attribute>
    <Attribute name="Users.Created By Login" key="4">OIMINTERNAL</Attribute>
    <Attribute name="Users.Login Attempts Counter">0</Attribute>
    <Attribute name="Organizations.Organization Name" key="4">Integra</Attribute>
    </UserInfo>
    </UserProfileSnapshot>"

    As said in {thread:id=2545133}, the quotes are certainly not the issue.
    This works fine for me on 11.2.0.2 :
    SQL> insert into table1 (column1)
      2  values (
      3  '<?xml version = ''1.0'' encoding = ''UTF-8''?>
      4  <UserProfileSnapshot key="224" version="1.0">
      5  <UserInfo>
      6  <Attribute name="Users.Display Name">testfuturedate102, Mr. user</Attribute>
      7  <Attribute name="USR_UDF_HR_ORG_ID">202</Attribute>
      8  <Attribute name="Users.Xellerate Type">End-User</Attribute>
      9  <Attribute name="Users.Role">Employee</Attribute>
    10  <Attribute name="Users.First Name">user</Attribute>
    11  <Attribute name="Users.Status">Active</Attribute>
    12  <Attribute name="USR_UDF_LOCATION_ID">1737</Attribute>
    13  <Attribute name="Users.Provisioned Date">2013-04-23 10:04:48 -0400</Attribute>
    14  <Attribute name="Title">MR.</Attribute>
    15  <Attribute name="USR_UDF_LOCATION_CODE">HR- New York</Attribute>
    16  <Attribute name="Country">US</Attribute>
    17  <Attribute name="State">NY</Attribute>
    18  <Attribute name="Users.Password Reset Attempts Counter">0</Attribute>
    19  <Attribute name="Users.Disable User">0</Attribute>
    20  <Attribute name="Users.Change Password At Next Logon">1</Attribute>
    21  <Attribute name="USR_CN_GENERATED">0</Attribute>
    22  <Attribute name="USR_UDF_EFFECTIVE_START_DATE">2013-03-08 00:00:00 -0500</Attribute>
    23  <Attribute name="Postal Code">10001</Attribute>
    24  <Attribute name="Users.Update Date">2013-04-23 10:04:48 -0400</Attribute>
    25  <Attribute name="Employee Number">2335</Attribute>
    26  <Attribute name="USR_UDF_DEPARTMENT_NAME">Vision Corporation</Attribute>
    27  <Attribute name="Users.Last Name">testfuturedate102</Attribute>
    28  <Attribute name="Users.End Date">4712-12-31 00:00:00 -0500</Attribute>
    29  <Attribute name="Hire Date">2013-02-28 00:00:00 -0500</Attribute>
    30  <Attribute name="USR_UDF_PERSON_ID">31967</Attribute>
    31  <Attribute name="USR_UDF_IS_MANAGER">N</Attribute>
    32  <Attribute name="Users.Creation Date">2013-04-23 10:04:48 -0400</Attribute>
    33  <Attribute name="Street">500 Madison Ave</Attribute>
    34  <Attribute name="Users.User ID">31967</Attribute>
    35  <Attribute name="USR_UDF_CITY">New York</Attribute>
    36  <Attribute name="Users.Lock User">0</Attribute>
    37  <Attribute name="Users.Updated By Login" key="4">OIMINTERNAL</Attribute>
    38  <Attribute name="Users.Created By Login" key="4">OIMINTERNAL</Attribute>
    39  <Attribute name="Users.Login Attempts Counter">0</Attribute>
    40  <Attribute name="Organizations.Organization Name" key="4">Integra</Attribute>
    41  </UserInfo>
    42  </UserProfileSnapshot>'
    43  );
    1 row inserted
    SQL>
    SQL> select x.*
      2  from table1 t
      3     , xmltable(
      4         '/UserProfileSnapshot/UserInfo'
      5         passing xmltype(t.column1)
      6         columns userdisplay_name varchar2(30) path 'Attribute[@name="Users.Display Name"]'
      7               , user_role        varchar2(30) path 'Attribute[@name="Users.Role"]'
      8       ) x ;
    USERDISPLAY_NAME               USER_ROLE
    testfuturedate102, Mr. user    Employee

  • Query Requirement for Stock on hand.

    Hi All,
    Actually I am have written a query for showing a running total for an Item with all Sales Order and Purchase Order order by ship date (due date).
    SELECT T0.[ItemCode], T0.[ShipDate],t2.[CardCode],t4.[OnHand],-T0.[OpenQty]*t4.[NumInSale] as StockMovt FROM RDR1 T0 INNER JOIN ORDR T2 ON T0.DocEntry = T2.DocEntry INNER JOIN OITM T4 ON T0.[ItemCode]=t4.[ItemCode] WHERE T0.[ItemCode] =[%0] and T2.[DocStatus] ='o'
    UNION
    SELECT T1.[ItemCode], T1.[ShipDate],t3.[CardCode], t5.[OnHand], T1.[OpenQty] as StockMovt FROM POR1 T1 INNER JOIN OPOR T3 ON T1.DocEntry = T3.DocEntry INNER JOIN oitm t5 ON T1.[ItemCode]=t5.[ItemCode] WHERE T1.[ItemCode]=[%0] and T3.[DocStatus] = 'o' ORDER BY [ShipDate]
    What i require is the additional field which shows the cumulative or running total for each record. Can anyone please help in how it can be achived.
    Thanks & Regards
    Shiva

    Hi Prasanna,
    I made some modification to ur query and its perfectly working. I still have the other query...can you please help me.
    The out put that you have asked for is as follows
    #     ItemCode     ShipDate     CardCode     OnHand     StockMovt
    1     BAS3B     04.06.09     AUCHRA     14,320.00     -108
    2     BAS3B     04.06.09     BLUMER     14,320.00     0
    3     BAS3B     04.06.09     GREENTsup     14,320.00     0
    4     BAS3B     05.06.09     bizzy     14,320.00     -12
    5     BAS3B     05.06.09     BROWNT     14,320.00     -120
    6     BAS3B     18.06.09     GOODVI     14,320.00     0
    7     BAS3B     26.06.09     COLMAN     14,320.00     -15,000.00
    8     BAS3B     30.06.09     GREENTsup     14,320.00     3,000.00
    9     BAS3B     21.07.09     GREENTsup     14,320.00     5,000.00
    10     BAS3B     03.08.09     BEALES     14,320.00     -12
    11     BAS3B     05.08.09     ACORN     14,320.00     -6
    12     BAS3B     16.08.09     JLEWBS     14,320.00     -120
    13     BAS3B     22.08.09     GREENTsup     14,320.00     1,000.00
    14     BAS3B     22.08.09     GREENTsup     14,320.00     2,000.00
    15     BAS3B     25.08.09     BEALES     14,320.00     -6
    16     BAS3B     25.08.09     GREENTsup     14,320.00     2,000.00
    17     BAS3B     27.08.09     BEALES     14,320.00     -6
    18     BAS3B     27.08.09     ELIZAS     14,320.00     -24
    19     BAS3B     01.10.09     GATES     14,320.00     -120
    20     BAS3B     15.01.10     GREENTsup     14,320.00     2,000.00
    Further  to this I need a running total for the stock movement. Basically it nothing but the difference between the last two columns.
    Regards
    Shiva

  • Looking for a proper analytical query/solution for below data

    I have data as shown below:
    mob_id     status_code     status_text     media_date
    39585     600     Online     04-Aug-09
    54988     600     Online     05-Aug-09
    39585     600     Online     05-Aug-09
    39585     600     Online     06-Aug-09
    39585     600     Online     07-Aug-09
    39585     600     Online     08-Aug-09
    39585     600     Online     09-Aug-09
    39585     600     Online     10-Aug-09
    39585     600     Online     11-Aug-09
    39585     600     Online     12-Aug-09
    39585     600     Online     13-Aug-09
    39585     600     Online     14-Aug-09
    39585     600     Online     15-Aug-09
    39585     600     Online     16-Aug-09
    39585     700     Deinstall     17-Aug-09
    54988     600     Online     06-Aug-09
    54988     600     Online     07-Aug-09
    54988     600     Online     08-Aug-09
    54988     600     Online     09-Aug-09
    54988     600     Online     10-Aug-09
    54988     600     Online     11-Aug-09
    54988     600     Online     12-Aug-09
    54988     600     Online     13-Aug-09
    54988     600     Online     14-Aug-09
    54988     600     Online     15-Aug-09
    54988     600     Online     16-Aug-09
    39585     600     Online     20-Aug-09
    39585     600     Online     21-Aug-09
    39585     600     Online     22-Aug-09
    39585     600     Online     23-Aug-09
    39585     600     Online     24-Aug-09
    39585     600     Online     25-Aug-09
    39585     700     Deinstall     26-Aug-09
    39585     600     Online     27-Aug-09
    39585     600     Online     28-Aug-09
    39585     600     Online     29-Aug-09
    39585     600     Online     30-Aug-09
    39585     600     Online     31-Aug-09
    39585     600     Online     01-Sep-09
    39585     700     Deinstall     02-Sep-09
    54988     600     Online     17-Aug-09
    54988     600     Online     18-Aug-09
    54988     600     Online     19-Aug-09
    54988     600     Online     20-Aug-09
    54988     600     Online     21-Aug-09
    54988     600     Online     22-Aug-09
    54988     600     Online     23-Aug-09
    54988     600     Online     24-Aug-09
    54988     600     Online     25-Aug-09
    54988     700     Deinstall     26-Aug-09
    69875     600     Online     20-Aug-09
    69875     600     Online     21-Aug-09
    69875     600     Online     22-Aug-09
    69875     600     Online     23-Aug-09
    69875     600     Online     24-Aug-09
    69875     600     Online     25-Aug-09
    69875     600     Online     26-Aug-09
    Using the above data I need to find out the below result set. Can any one help in this?
    occurrnace_seq     mob_id     start_media_date     end_media_date     no_of_days
    1     39585     04-Aug-09     17-Aug-09     13
    2     39585     20-Aug-09     26-Aug-09     6
    3     39585     27-Aug-09     02-Sep-09     6
    1     54988     05-Aug-09     26-Aug-09     21
    1     69875     20-Aug-09          null null
    Here start_media_date can be found with status_code=600 & end_media_date can be found with status_code=700.
    Please look that the mobility_id is starting multiple times.
    Any one can help me in producing this result using SQL or PL/SQL.
    Many thanks in advance.
    Thanks
    Guttiwas

    guttis wrote:
    Can I run this query on a 70 million records? Does it raise any performance problems. If you have any idea, just thorough some possible suggestions to protect such isses.Well, you can certailny run it on 70 million records. How long it will run depends on your hardware, Oracle and OS settings. Said that, there is a simpler solution:
    select  occurrenace_seq,
            mob_id,
            min(case grp when 'start-of-group' then media_date end) start_media_date,
            max(case grp when 'end-of-group' then media_date end) end_media_date,
            max(case grp when 'end-of-group' then media_date end) - min(case grp when 'start-of-group' then media_date end) no_of_days
      from  (
             select  t.*,
                     case
                       when status_text = 'Deinstall' then 'end-of-group'
                       when lag(status_text,1,'Deinstall') over(partition by mob_id order by media_date) = 'Deinstall' then 'start-of-group'
                     end grp,
                     sum(case status_text when 'Deinstall' then 1 else 0 end) over(partition by mob_id order by media_date) +
                     case lag(status_text,1,'Deinstall') over(partition by mob_id order by media_date) when 'Deinstall' then 1 else 0 end occurrenace_seq
               from  your_table t
      where grp in ('start-of-group','end-of-group')
      group by mob_id,
               occurrenace_seq
      order by mob_id,
               occurrenace_seq
    /With your sample:
    with t as (
               select 39585 mob_id,600 status_code,'Online' status_text, to_date('04-Aug-09','dd-mon-yy') media_date from dual union all
               select 54988,600,'Online',to_date('05-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('05-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('06-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('07-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('08-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('09-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('10-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('11-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('12-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('13-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('14-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('15-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('16-Aug-09','dd-mon-yy') from dual union all
               select 39585,700,'Deinstall', to_date('17-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('06-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('07-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('08-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('09-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('10-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('11-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('12-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('13-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('14-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('15-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('16-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('20-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('21-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('22-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('23-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('24-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('25-Aug-09','dd-mon-yy') from dual union all
               select 39585,700,'Deinstall', to_date('26-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('27-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('28-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('29-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('30-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('31-Aug-09','dd-mon-yy') from dual union all
               select 39585,600,'Online',to_date('01-Sep-09','dd-mon-yy') from dual union all
               select 39585,700,'Deinstall', to_date('02-Sep-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('17-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('18-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('19-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('20-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('21-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('22-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('23-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('24-Aug-09','dd-mon-yy') from dual union all
               select 54988,600,'Online',to_date('25-Aug-09','dd-mon-yy') from dual union all
               select 54988,700,'Deinstall', to_date('26-Aug-09','dd-mon-yy') from dual union all
               select 69875,600,'Online',to_date('20-Aug-09','dd-mon-yy') from dual union all
               select 69875,600,'Online',to_date('21-Aug-09','dd-mon-yy') from dual union all
               select 69875,600,'Online',to_date('22-Aug-09','dd-mon-yy') from dual union all
               select 69875,600,'Online',to_date('23-Aug-09','dd-mon-yy') from dual union all
               select 69875,600,'Online',to_date('24-Aug-09','dd-mon-yy') from dual union all
               select 69875,600,'Online',to_date('25-Aug-09','dd-mon-yy') from dual union all
               select 69875,600,'Online',to_date('26-Aug-09','dd-mon-yy') from dual
    select  occurrenace_seq,
            mob_id,
            min(case grp when 'start-of-group' then media_date end) start_media_date,
            max(case grp when 'end-of-group' then media_date end) end_media_date,
            max(case grp when 'end-of-group' then media_date end) - min(case grp when 'start-of-group' then media_date end) no_of_days
      from  (
             select  t.*,
                     case
                       when status_text = 'Deinstall' then 'end-of-group'
                       when lag(status_text,1,'Deinstall') over(partition by mob_id order by media_date) = 'Deinstall' then 'start-of-group'
                     end grp,
                     sum(case status_text when 'Deinstall' then 1 else 0 end) over(partition by mob_id order by media_date) +
                     case lag(status_text,1,'Deinstall') over(partition by mob_id order by media_date) when 'Deinstall' then 1 else 0 end occurrenace_seq
               from  t
      where grp in ('start-of-group','end-of-group')
      group by mob_id,
               occurrenace_seq
      order by mob_id,
               occurrenace_seq
    OCCURRENACE_SEQ     MOB_ID START_MED END_MEDIA NO_OF_DAYS
                  1      39585 04-AUG-09 17-AUG-09         13
                  2      39585 20-AUG-09 26-AUG-09          6
                  3      39585 27-AUG-09 02-SEP-09          6
                  1      54988 05-AUG-09 26-AUG-09         21
                  1      69875 20-AUG-09
    SQL> SY.

  • Query Required For sort

    CREATE TABLE COUNTRIES(CID INT,CNAME VARCHAR(100))
    INSERT INTO COUNTRIES VALUES(1,'AUSTRALIA')
    INSERT INTO COUNTRIES VALUES(2,'INDIA')
    INSERT INTO COUNTRIES VALUES(3,'FRANCE')
    INSERT INTO COUNTRIES VALUES(4,'BERLIN')
    SELECT * FROM COUNTRIES
    o/p
    CID CNAME
    2 INDIA
    1 AUSTRALIA
    4 BERLIN
    3 FRANCE
    here India should be always first position remaining countries values should be in sorted order

    You can use a conditional sorting =>
    SELECT *
    FROM COUNTRIES
    ORDER BY CASE WHEN CNAME = 'INDIA'
    THEN 0
    ELSE 1 END,
    CNAME
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Sugestion required for Fiscal Year scenario

    Hi Gurus,
    I  need your suggestion for the below scenario
    One of our client going to  change the Fiscal period  from  (Jan -  dec ) to (Sep - Oct). We have nearly 5 years of records as on date based on the (Jan-Dec) fiscal period.
    Requirement: If new fiscal peirod will come in active , they want to view all the data ( Including  historical records)based on the both the fiscal period based on the selection in the query.
    Technical requirement: Dynamic switching is requried for Fiscal Year Variant in the query level. 
    Suggestion Required for below point:
    1. Is it required to maintain two Fiscal year variant ?
    2.How do we maintain the new fiscal year period for historical record ?
    3. Is it any posibilities their with out major disturbance of the existing query ?
    4. Is it possible to do in query level with minor impact of performance ?
    5. Is it possible to do in back end side with out redundancy of the records ?
    6.I have a solution to use multiprovider on top of two infoprovides which are maintain the fiscal period based on two fiscal year variant. If I realize this it would lead major back end work.
    7. I have another solution to add another two fields in the existing structure to hold new variant and fiscal period. If I do this How dynamically I can change the structure of the query for to view the different fiscal period information.
    Anticipate your reply eagerly
    With Regards
    Siva

    Hi,
    1. Is it required to maintain two Fiscal year variant ?
    Yes,  You will need to  have another Fiscal Year variant for Sep to Oct.
    2.How do we maintain the new fiscal year period for historical record ?
    To do this at the BI Level, You can have a routine to convert the Fiscal Year Period according to the new Variant.
    You will have to get the help of a functional consultant in order to understand the logic of opening and closing balance. According to the new variant the current Fisc Period 009.2009(Sep 2009) will become 001.2010 and so on. Apart form just converting the period, you will also have to take care of carrying over the balances.
    3. Is it any posibilities their with out major disturbance of the existing query ?
    Once you implement the above logic, you can just include the New Fiscal variant into the query.
    4. Is it possible to do in query level with minor impact of performance ?
    Yes, as mentioned above.
    5. Is it possible to do in back end side with out redundancy of the records ?
    Not sure about this.
    6.I have a solution to use multiprovider on top of two infoprovides which are maintain the fiscal period based on two fiscal year variant. If I realize this it would lead major back end work.
    This seems to be the best way. You will not have to touch the existing cube. Only your reports will have to be copied to the New MultiCube. The logic in the 2nd Q above will be for the new cube.
    Regards,
    Gaurav

  • How to write sql query for below example.

    Hi,
    I have requirement.
    There are number of rows and I need the result through query as follows.Please help me to proved sql query for below mentioned requirement.
    example: table TEST.
    COLA COLB COLC COLD
    MANAGER 5 NULL null
    SR.MANAGE 6 3 NULL
    VP 5 5 4
    I have to write the sql query if COLA IS MANAGER THEN CONSIDER MANGER RECORD,AND IF ANY COLUMN FILED IS NULL FOR MANGER THEN CONSIDER COLA IS SR.MANGER, AND IF ANY COLUMN FILED IS NULL FOR SR,MANGER THEN CONSIDER VP records.
    I need output as below.
    COLB COLC COLD
    5(MANGER) 3(sr.manger) 5(vp)
    Please provide the for above mentioned output.
    Thanks

    <<if COLA IS MANAGER THEN CONSIDER MANGER RECORD>>
    What does this sentence means? COLA does not cnatin a single record but the number of records with diffrent values.
    Regards
    Arun

  • How to write sql query for below mentioned eaxmple.

    Hi,
    I have requirement.
    There are number of rows and I need the result through query as follows.Please help me to proved sql query for below mentioned requirement.
    example: table TEST.
    COLA COLB COLC COLD COLE COLF MANAGER 5 NULL NULL 3 NULL
    SR.MANAGER 6 3 NULL NULL NULL
    VP 5 5 4 5 5
    I have to write the sql query if COLA IS MANAGER THEN CONSIDER MANGER RECORD,AND IF ANY COLUMN FILED IS NULL FOR MANGER THEN CONSIDER COLA IS SR.MANGER, AND IF ANY COLUMN FILED IS NULL FOR SR,MANGER THEN CONSIDER VP records.
    I need output as below.
    COLB COLC COLD COLE COLF
    5(manager) 3(sr.manger) 4(vp) 3(manger) 3(vp)
    Please provide the for above mentioned output.
    Thanks

    Duplicate thread. please view the answer posted in your first thread.
    how to write sql query.
    And, please don't post any duplicate thread.
    Regards.
    Satyaki De.

  • Query for calculating raw material requirements for the remaining quantities in sale order.

    Dear SAP Experts,
    Clients requirement :
                                         Client wish to know the quantities of raw materials needs to run the production order inorder to complete the remaining quantities in sale order.
    Need Clarification:
                                  I"m using the below query for this requirement. I wish to know whether this query suits for my clients requirement or not. If its so, I need to know how to group by T4.[Code] (Raw material Name)   and need to get the sum of    T4.[Quantity]  (BOM quantity)      and  (T1.[OpenQty]*T4.[Quantity]) as TOTALQTY under each raw material group
    SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode],T0.[CardName], T1.[ItemCode], T1.[Dscription], T1.[Quantity] as salesorderQty , T1.[OpenQty], T2.onhand, T4.[Code] as Raw material Name,T4.[Quantity] as BOMQTY,  (T1.[OpenQty]*T4.[Quantity]) as TOTALQTY FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry] INNER JOIN OITM T2 ON T1.[ItemCode] = T2.[ItemCode] INNER JOIN OITT T3 ON T2.[ItemCode] = T3.[Code] INNER JOIN ITT1 T4 ON T3.[Code] = T4.[Father] WHERE  T0.[DocStatus] ='o' 

    You're posting in the Portuguese B1 space.
    You might want to post in the English one: SAP Business One Application

  • How to search in BI 7.1 query designer for the required key figures & chars

    Hi All,
         Can anyone plz tell me how to search in BI 7.1 query designer for the required key figures & characteristics. I have the query being built on a multiprovider which has many cubes.
    So, i have a huge list of key figures and characteristics. I am not able to search for the required one by the name or the technical name.
    How can we search and pick the required object from the enormous list of the Mutliprovider in the Bex Query Designer??
    Thanks
    Phani

    There is not a search feature available. You have to do an educated guess under what dimension your infoobject could be and select.

Maybe you are looking for

  • How do I buy a T.V. in the 21st century?

    My 15 year old rear projection tv has finally died.  So I began researching tv's and home theaters about a week ago.   My problem is this... when I Google different brands of tv's to find out about their quality issues, the reviews make it sound like

  • Are there two different Core i7 2.0 Ghz CPU's for the 15" MBP?

    I noticed on Geekbench that some people are getting Intel Core i7-2635QM @ 2.00 GHz CPU's and some are getting Intel Core i7-2620QM @ 2.00 GHz CPU's. Same clock speed but different performance outcomes. The 2620 chip comes in around 6800-7000 in perf

  • Photoshop elements update 9.0.3 and raw update 6.5 cannot be installed

    error message just says " an error occured ..., try again later", I am using Mac OS 10.10.1 and a rather old elements version of photoshop elements (9.0), and I tried several times

  • Scale factor change in 11g?

    This is what i do on Oracle 10g R2 and 11g. select wktext from cs_srs where srid = 28992; On 10g R2 I get: PROJCS["Amersfoort / RD New",           GEOGCS [ "Amersfoort",                DATUM ["Amersfoort (EPSG ID 6289)",                     SPHEROID

  • Please let me know if Java.exe and Javaw.exe is embedded in Oracle.

    What versions of Java.exe or Javaw.exe is embedded in Oracle. If java executables are embedded, then please inform what versions of Oracle have Java executables embedded.