Query to retrieve encumbrance details

Please, I'll loose my job if I can't retrieve encumbrance details from the oracle financials 11i GL. I don't know where these figures are in the GL database. i need details per cost center per account code/number....
Please help me

Thank you Octavio
I got 53 rows. that means 53 tables have Encumbrances column. So, what next? do I have to start looking at each table for the details I'm looking for?
Thanks

Similar Messages

  • SQL query to retrieve totals from "supporting Details"

    We've had a strange issue where the totals from the supporting details aren't adding up to the value submitted in essbase.
    In effect our RDMS is out of sync with Planning.
    In order to remedy this, I'm trying to build a SQL query to retrieve the value of the supporting details.
    Here is my Sql statement so far :
    SELECT
    HO1.OBJECT_NAME SCENARIO,
    HO2.OBJECT_NAME ACCOUNT,
    HO3.OBJECT_NAME ENTITY,
    HO4.OBJECT_NAME Month,
    HO5.OBJECT_NAME Version,
    HO6.OBJECT_NAME Currency,
    HO7.OBJECT_NAME Year,
    HO8.OBJECT_NAME Project,
    HO10.OBJECT_NAME CC,
    HO12.OBJECT_NAME Grplcl,
    HO13.OBJECT_NAME Product,
    HO15.OBJECT_NAME SalesRegion,
    HO16.OBJECT_NAME ContractAnalysis,
    HO17.OBJECT_NAME IC,
    SUM(NVL(HCDI.VALUE,0)) AMOUNT
    FROM hsp_column_detail HCD,
    hsp_column_detail_ITEM HCDI,
    HSP_OBJECT HO1,
    HSP_OBJECT HO2,
    HSP_OBJECT HO3,
    HSP_OBJECT HO4,
    HSP_OBJECT HO5,
    HSP_OBJECT HO6,
    HSP_OBJECT HO7,
    HSP_OBJECT HO8,
    HSP_OBJECT HO10,
    HSP_OBJECT HO12,
    HSP_OBJECT HO13,
    HSP_OBJECT HO15,
    HSP_OBJECT HO16,
    HSP_OBJECT HO17
    WHERE hcd.detail_id = hcdi.detail_id
    AND hcd.dim1 = ho1.object_id
    AND hcd.dim2 = ho2.object_id
    AND hcd.dim3 = ho3.object_id
    AND hcd.dim4 = ho4.object_id
    AND hcd.dim5 = ho5.object_id
    AND hcd.dim6 = ho6.object_id
    AND hcd.dim7 = ho7.object_id
    AND hcd.dim8 = ho8.object_id
    AND hcd.dim10 = ho10.object_id
    AND hcd.dim12 = ho12.object_id
    AND hcd.dim13 = ho13.object_id
    AND hcd.dim15 = ho15.object_id
    AND hcd.dim16 = ho16.object_id
    AND hcd.dim17 = ho17.object_id
    and hcdi.generation = 0
    GROUP BY HO1.OBJECT_NAME, HO2.OBJECT_NAME, HO3.OBJECT_NAME, HO4.OBJECT_NAME,
    HO5.OBJECT_NAME,
    HO6.OBJECT_NAME,
    HO7.OBJECT_NAME,
    HO8.OBJECT_NAME,
    HO10.OBJECT_NAME,
    HO12.OBJECT_NAME,
    HO13.OBJECT_NAME,
    HO15.OBJECT_NAME,
    HO16.OBJECT_NAME,
    HO17.OBJECT_NAME
    ORDER BY HO1.OBJECT_NAME, HO3.OBJECT_NAME, HO2.OBJECT_NAME

    This query works using PL SQL and has been used on Oracle 9.2.3.
    Cheers,
    Jeremie
    Here is the Query:
    set serveroutput on;
    set serveroutput on size 1000000;
    --set buffer_size 10000000;
    --set line_size 2000;
    --DBMS_OUTPUT.size = 2000000;
    DECLARE
    CURSOR BUDGET_HEADERS_CU IS
    SELECT
    hcd.detail_id,
    HO1.OBJECT_NAME SCENARIO,
    HO2.OBJECT_NAME ACCOUNT,
    HO3.OBJECT_NAME ENTITY,
    HO4.OBJECT_NAME Month,
    HO5.OBJECT_NAME Version,
    HO6.OBJECT_NAME Currency,
    HO7.OBJECT_NAME Year,
    HO8.OBJECT_NAME Project,
    HO10.OBJECT_NAME CC,
    HO12.OBJECT_NAME Grplcl,
    HO13.OBJECT_NAME Product,
    HO15.OBJECT_NAME SalesRegion,
    HO16.OBJECT_NAME ContractAnalysis,
    HO17.OBJECT_NAME IC,
    hcd.dim1 SCENARIO_id,
    hcd.dim2 ACCOUNT_id,
    hcd.dim3 ENTITY_id,
    hcd.dim4 Month_id,
    hcd.dim5 Version_id,
    hcd.dim6 Currency_ID,
    hcd.dim7 Year_ID,
    hcd.dim8 Project_ID,
    hcd.dim10 CC_ID,
    hcd.dim12 Grplcl_ID,
    hcd.dim13 Product_ID,
    hcd.dim15 SalesRegion_ID,
    hcd.dim16 ContractAnalysis_ID,
    hcd.dim17 IC_ID
    FROM hsp_column_detail HCD, /*hsp_column_detail_item HCDi,*/
    HSP_OBJECT HO1,
    HSP_OBJECT HO2,
    HSP_OBJECT HO3,
    HSP_OBJECT HO4,
    HSP_OBJECT HO5,
    HSP_OBJECT HO6,
    HSP_OBJECT HO7,
    HSP_OBJECT HO8,
    HSP_OBJECT HO10,
    HSP_OBJECT HO12,
    HSP_OBJECT HO13,
    HSP_OBJECT HO15,
    HSP_OBJECT HO16,
    HSP_OBJECT HO17
    WHERE /*hcd.detail_id = hcdi.detail_id
    AND*/ hcd.dim1 = ho1.object_id
    AND hcd.dim2 = ho2.object_id
    AND hcd.dim3 = ho3.object_id
    AND hcd.dim4 = ho4.object_id
    AND hcd.dim5 = ho5.object_id
    AND hcd.dim6 = ho6.object_id
    AND hcd.dim7 = ho7.object_id
    AND hcd.dim8 = ho8.object_id
    AND hcd.dim10 = ho10.object_id
    AND hcd.dim12 = ho12.object_id
    AND hcd.dim13 = ho13.object_id
    AND hcd.dim15 = ho15.object_id
    AND hcd.dim16 = ho16.object_id
    AND hcd.dim17 = ho17.object_id
    and HO5.OBJECT_NAME = 'Working'
    --and hcdi.generation != 0
    --and hcdi.label like 'JRTEST-%'
    --and hcd.detail_id = 253102
    /*GROUP BY HCD.Dim1, HCD.Dim2, HCD.Dim3, HCD.Dim4,
    HCD.Dim5,
    HCD.Dim6,
    HCD.Dim7,
    HCD.Dim8,
    HCD.Dim10,
    HCD.Dim12,
    HCD.Dim13,
    HCD.Dim15,
    HCD.Dim16,
    HCD.Dim17*/;
    CURSOR BUDGET_DETAILS_CU(
    /*scenario_p in varchar2,
    account_p in varchar2,
    entity_p in varchar2,
    month_p in varchar2,
    version_p in varchar2,
    currency_p in varchar2,
    year_p in varchar2,
    project_p in varchar2,
    cc_p in varchar2,
    grplcl_p in varchar2,
    product_p in varchar2,
    salesregion_p in varchar2,
    contractanalysis_p in varchar2,
    ic_p in varchar2*/
    detail_id_p in number
    IS
    SELECT
    /* HO1.OBJECT_NAME SCENARIO,
    HO2.OBJECT_NAME ACCOUNT,
    HO3.OBJECT_NAME ENTITY,
    HO4.OBJECT_NAME Month,
    HO5.OBJECT_NAME Version,
    HO6.OBJECT_NAME Currency,
    HO7.OBJECT_NAME Year,
    HO8.OBJECT_NAME Project,
    HO10.OBJECT_NAME CC,
    HO12.OBJECT_NAME Grplcl,
    HO13.OBJECT_NAME Product,
    HO15.OBJECT_NAME SalesRegion,
    HO16.OBJECT_NAME ContractAnalysis,
    HO17.OBJECT_NAME IC, */
    label,
    NVL(HCDI.VALUE,0) AMOUNT,
    HCDI.Position,
    HCDI.operator,
    HCDI.generation
    FROM /*hsp_column_detail HCD,*/
    hsp_column_detail_ITEM HCDI
    /* HSP_OBJECT HO1,
    HSP_OBJECT HO2,
    HSP_OBJECT HO3,
    HSP_OBJECT HO4,
    HSP_OBJECT HO5,
    HSP_OBJECT HO6,
    HSP_OBJECT HO7,
    HSP_OBJECT HO8,
    HSP_OBJECT HO10,
    HSP_OBJECT HO12,
    HSP_OBJECT HO13,
    HSP_OBJECT HO15,
    HSP_OBJECT HO16,
    HSP_OBJECT HO17*/
    --WHERE hcd.detail_id = hcdi.detail_id
    WHERE hcdi.detail_id = detail_id_p
    /*AND hcd.dim1 = ho1.object_id
    AND hcd.dim2 = ho2.object_id
    AND hcd.dim3 = ho3.object_id
    AND hcd.dim4 = ho4.object_id
    AND hcd.dim5 = ho5.object_id
    AND hcd.dim6 = ho6.object_id
    AND hcd.dim7 = ho7.object_id
    AND hcd.dim8 = ho8.object_id
    AND hcd.dim10 = ho10.object_id
    AND hcd.dim12 = ho12.object_id
    AND hcd.dim13 = ho13.object_id
    AND hcd.dim15 = ho15.object_id
    AND hcd.dim16 = ho16.object_id
    AND hcd.dim17 = ho17.object_id*/
    --and hcdi.generation != 0
    --and label like 'JRTEST-%'
    /*AND HCD.Dim1 = scenario_p
    AND HCD.Dim2 = account_p
    AND HCD.Dim3 = entity_p
    AND HCD.Dim4 = month_p
    AND HCD.Dim5 = version_p
    AND HCD.Dim6 = currency_p
    AND HCD.Dim7 = year_p
    AND HCD.Dim8 = project_p
    AND HCD.Dim10 = cc_p
    AND HCD.Dim12 = grplcl_p
    AND HCD.Dim13 = product_p
    AND HCD.Dim15 = salesregion_p
    AND HCD.Dim16 = contractanalysis_p
    AND HCD.Dim17 = ic_p*/
    ORDER BY hcdi.position;
    -- Variable Declaration
    running_total_ln number :=0;
    prev_running_total_ln number :=0;
    add_amount number :=0;
    multiply_amount number :=1;
    prev_generation number :=0;
    prev_add_amount number :=0;
    prev_multiply_amount number :=1;
    running_total_gen0 number :=0;
    running_gen0_op number :=0;
    running_total_gen1 number :=0;
    running_gen1_op number :=0;
    running_total_gen2 number :=0;
    running_gen2_op number :=0;
    running_total_gen3 number :=0;
    running_gen3_op number :=0;
    running_total_gen4 number :=0;
    running_gen4_op number :=0;
    running_total_gen5 number :=0;
    running_gen5_op number :=0;
    output_file utl_file.file_type;
    -- Begin PL/SQL processing
    BEGIN
    --DBMS_OUTPUT.
    DBMS_OUTPUT.ENABLE(1000000);
    DBMS_OUTPUT.PUT_LINE('Begin Processing');
    output_file := utl_file.fopen ('C:\temp', 'test.txt', 'W');
    -- Begin Header For Loop
    FOR BUDGET_HEADERS_CV IN BUDGET_HEADERS_CU
    LOOP
    --Reset Running Totals
    running_total_ln:=0;
    prev_running_total_ln:=0;
    add_amount:=0;
    multiply_amount:=1;
    prev_generation:=0;
    prev_add_amount:=0;
    prev_multiply_amount:=1;
    running_total_gen0:=0;
    running_gen0_op:=0;
    running_total_gen1:=0;
    running_gen1_op:=0;
    running_total_gen2:=0;
    running_gen2_op:=0;
    running_total_gen3:=0;
    running_gen3_op:=0;
    running_total_gen4:=0;
    running_gen4_op:=0;
    running_total_gen5:=0;
    running_gen5_op:=0;
    -- Begin Detail For Loop
    FOR BUDGET_DETAILS_CV IN BUDGET_DETAILS_CU(
    BUDGET_HEADERS_CV.Detail_ID
    /*BUDGET_HEADERS_CV.SCENARIO_ID,
    BUDGET_HEADERS_CV.ACCOUNT_ID,
    BUDGET_HEADERS_CV.ENTITY_ID,
    BUDGET_HEADERS_CV.Month_ID,
    BUDGET_HEADERS_CV.Version_ID,
    BUDGET_HEADERS_CV.Currency_ID,
    BUDGET_HEADERS_CV.Year_ID,
    BUDGET_HEADERS_CV.Project_ID,
    BUDGET_HEADERS_CV.CC_ID,
    BUDGET_HEADERS_CV.Grplcl_ID,
    BUDGET_HEADERS_CV.Product_ID,
    BUDGET_HEADERS_CV.SalesRegion_ID,
    BUDGET_HEADERS_CV.ContractAnalysis_ID,
    BUDGET_HEADERS_CV.IC_ID*/
    LOOP
    -- Null;
    add_amount :=0;
    multiply_amount :=1;
    IF BUDGET_DETAILS_CV.OPERATOR = 1 THEN
    add_amount := BUDGET_DETAILS_CV.Amount;
    End if;
    IF BUDGET_DETAILS_CV.OPERATOR = 2 THEN
    add_amount := BUDGET_DETAILS_CV.Amount * -1;
    End if;
    IF BUDGET_DETAILS_CV.OPERATOR = 3 THEN
    multiply_amount := BUDGET_DETAILS_CV.Amount;
    End if;
    IF BUDGET_DETAILS_CV.OPERATOR = 4 THEN
    multiply_amount := 1/BUDGET_DETAILS_CV.Amount;
    End if;
    IF BUDGET_DETAILS_CV.Position = 0 then
    running_total_gen0 := add_amount*multiply_amount;-- we are dealing with the first line
    Else
    if BUDGET_DETAILS_CV.GENERATION = prev_generation then
    -- run whatever total we are on up
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 2 then
    running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 3 then
    running_total_gen3 := (running_total_gen3 + add_amount)*multiply_amount;
    end if;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation +1 then
    -- we are going up a generation
    -- (we cannot go up to gen0
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    running_total_gen1:=0;-- reset gen1 counter
    running_gen0_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
    running_total_gen0 := running_total_gen0/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 0 total
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 2 then
    running_total_gen2:=0;-- reset gen1 counter
    running_gen1_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
    running_total_gen1 := running_total_gen1/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 1 total
    running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 3 then
    running_total_gen3:=0;-- reset gen1 counter
    running_gen2_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
    running_total_gen2 := running_total_gen2/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 2 total
    running_total_gen3 := (running_total_gen3 + add_amount)*multiply_amount;
    end if;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation - 1 then
    -- we are Down a generation
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    --we need to "add" back the previous gen 1 parent
    IF running_gen0_op = 1 THEN
    running_total_gen0 := running_total_gen0 + running_total_gen1;
    End if;
    IF running_gen0_op = 2 THEN
    running_total_gen0 := running_total_gen0 - running_total_gen1;
    End if;
    IF running_gen0_op = 3 THEN
    running_total_gen0 := running_total_gen0 * running_total_gen1;
    End if;
    IF running_gen0_op = 4 THEN
    running_total_gen0 := running_total_gen0 / running_total_gen1;
    End if;
    -- we need to add the current member to the gen0
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    END IF;
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    -- we need to add the current member to the gen1
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 2 then
    --we need to "add" back the previous gen 3 parent
    IF running_gen1_op = 1 THEN
    running_total_gen2 := running_total_gen2 + running_total_gen3;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen2 := running_total_gen2 - running_total_gen3;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen2 := running_total_gen2 * running_total_gen3;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen2 := running_total_gen2 / running_total_gen3;
    End if;
    -- we need to add the current member to the gen2
    running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
    end if;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation - 2 then
    -- we are Down 2 generations
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    --we need to "add" back the previous gen 1 parent
    IF running_gen0_op = 1 THEN
    running_total_gen0 := running_total_gen0 + running_total_gen1;
    End if;
    IF running_gen0_op = 2 THEN
    running_total_gen0 := running_total_gen0 - running_total_gen1;
    End if;
    IF running_gen0_op = 3 THEN
    running_total_gen0 := running_total_gen0 * running_total_gen1;
    End if;
    IF running_gen0_op = 4 THEN
    running_total_gen0 := running_total_gen0 / running_total_gen1;
    End if;
    -- we need to add the current member to the gen0
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    END IF;
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    --we need to "add" back the previous gen 3 parent
    IF running_gen1_op = 1 THEN
    running_total_gen2 := running_total_gen2 + running_total_gen3;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen2 := running_total_gen2 - running_total_gen3;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen2 := running_total_gen2 * running_total_gen3;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen2 := running_total_gen2 / running_total_gen3;
    End if;
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    -- we need to add the current member to the gen1
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    END IF;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation - 3 then
    -- we are Down 3 generations
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    --we need to "add" back the previous gen 3 parent
    IF running_gen1_op = 1 THEN
    running_total_gen2 := running_total_gen2 + running_total_gen3;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen2 := running_total_gen2 - running_total_gen3;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen2 := running_total_gen2 * running_total_gen3;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen2 := running_total_gen2 / running_total_gen3;
    End if;
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    --we need to "add" back the previous gen 1 parent
    IF running_gen0_op = 1 THEN
    running_total_gen0 := running_total_gen0 + running_total_gen1;
    End if;
    IF running_gen0_op = 2 THEN
    running_total_gen0 := running_total_gen0 - running_total_gen1;
    End if;
    IF running_gen0_op = 3 THEN
    running_total_gen0 := running_total_gen0 * running_total_gen1;
    End if;
    IF running_gen0_op = 4 THEN
    running_total_gen0 := running_total_gen0 / running_total_gen1;
    End if;
    -- we need to add the current member to the gen0
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    END IF;
    end if;
    END IF;
    End IF;
    END LOOP; -- End of Detail Loop
    --DBMS_OUTPUT.PUT_LINE(BUDGET_HEADERS_CV.SCENARIO||';'||BUDGET_HEADERS_CV.ACCOUNT||';'||BUDGET_HEADERS_CV.ENTITY||';'||BUDGET_HEADERS_CV.Month||';'||BUDGET_HEADERS_CV.Version||';'||BUDGET_HEADERS_CV.Currency||';'||BUDGET_HEADERS_CV.Year||';'||BUDGET_HEADERS_CV.Project||';'||BUDGET_HEADERS_CV.CC||';'||BUDGET_HEADERS_CV.Grplcl||';'||BUDGET_HEADERS_CV.Product||';'||BUDGET_HEADERS_CV.SalesRegion||';'||BUDGET_HEADERS_CV.ContractAnalysis||';'||BUDGET_HEADERS_CV.IC||';'||running_total_gen0);
    utl_file.put_line(output_file,BUDGET_HEADERS_CV.SCENARIO||';'||BUDGET_HEADERS_CV.ACCOUNT||';'||BUDGET_HEADERS_CV.ENTITY||';'||BUDGET_HEADERS_CV.Month||';'||BUDGET_HEADERS_CV.Version||';'||BUDGET_HEADERS_CV.Currency||';'||BUDGET_HEADERS_CV.Year||';'||BUDGET_HEADERS_CV.Project||';'||BUDGET_HEADERS_CV.CC||';'||BUDGET_HEADERS_CV.Grplcl||';'||BUDGET_HEADERS_CV.Product||';'||BUDGET_HEADERS_CV.SalesRegion||';'||BUDGET_HEADERS_CV.ContractAnalysis||';'||BUDGET_HEADERS_CV.IC||';'||running_total_gen0);
    /*BUDGET_HEADERS_CV.SCENARIO, BUDGET_HEADERS_CV.ACCOUNT, BUDGET_HEADERS_CV.ENTITY, BUDGET_HEADERS_CV.Month, BUDGET_HEADERS_CV.Version,BUDGET_HEADERS_CV.Currency, BUDGET_HEADERS_CV.Year, BUDGET_HEADERS_CV.Project, BUDGET_HEADERS_CV.CC, BUDGET_HEADERS_CV.Grplcl, BUDGET_HEADERS_CV.Product, BUDGET_HEADERS_CV.SalesRegion, BUDGET_HEADERS_CV.ContractAnalysis, BUDGET_HEADERS_CV.IC */
    END LOOP; -- End of Header Loop
    --DBMS_OUTPUT.PUT_LINE('Total');
    -- DBMS_OUTPUT.PUT_LINE('End Processing');
    utl_file.fclose(output_file);
    END;
    Edited by: JeremieR on Apr 18, 2011 5:02 AM

  • Web Analysis Error -- Error while executing query and retrieving data

    Regarding Web Analysis:
    We have a number of reports that we created. yesterday they were all working fine. today we try to open them and most are generating an error.
    The error is:
    Error while executing query and retrieving data.; nested exception is:
    com.hyperion.ap.APException: [1033] Native:
    1013033[Thu Oct 22 09:08:17
    2009]server name/application name/database name/user name/Error91013033)
    ReportWriter exit abnormally
    Does anyone have any insight into what is going on?
    My version information is:
    Hyperion System 9 BI+ Analytic Administration Services 9.3.0.1.1 Build 2
    Web Analysis 9.3.0.0.0.286
    Thanks in advance for your help.
    DaveW

    Hi,
    And also click on check option by opening the query in Query designer,as Mr . Arun suggested.
    And if you get any error in checking, see the long message(detail).
    With rgds,
    Anil Kumar Sharma .P

  • Trial Balance - Encumbrance & Encumbrance Details Report not matching

    Hi,
    Our client has recently raised one issue saying Trial Balance - Encumbrance with 'Obligation' parameter and Encumbrance Details Report (both reports period name and Enc Date to choosen as FEB-12 and 29-Feb-2012).
    The final totals related to both reports does not match and why could be such difference occuring between the two reports. As both reports logically dealing with Enumbrance one at PO level and another one at GL level. And po transactions have been transferred to GL.
    Please explaing how to search those records which are showing these differences in main report.
    Appreciate in advance for your reply.
    Regards,
    Prasad

    Hi,
    This seems to be due to the rounding issue in the database.
    Can you check and confirm whether any time during the business process, in the system the decimal settings were increased or decreased ? If yes, then it can be due to the calculation (rounding)
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Query regarding the fields details in particular form for all the users in

    Dear All,
                  I have one query regarding the fields details in particular form for all the users in company.
    Let take an exapmle if i had created Purchase Order having fields in content tab as 1.Item No. 2.Quantity 3.Unit Proce   4.Total   5. Location.
    While Login in User manager i set these fields only for Purchase order , but when i login from other user and open the similar purchase order the defaults fields are also seen including  above 4 fieds .
    Now my question is how to set the User choice fiels for the particular form that are common to all users.
    Means whenever i login in any user and opens the same document the same fields should be seen....Thanksssss.........

    You have to login with each and every user and do the Form Settings of every forms, so that all the forms look same for all the users.
    This is a manual job and you have do do it with every user login.
    Alternately, you can try out this link that explains
    [How to Copy One Screen Layout to Another User|http://www.sbonotes.com/2008/03/how-to-copy-one-screen-layout-to.html]

  • Query to retrieve the number of transactions done in every 1 hour for last

    Hi,
    Could anyone help in writing a query to retrieve the number of transactions done in every 1 hour for last month.
    Case:
    I/P
    Cases Timestamp1
    case1 01-01-2008 00:00:01
    case2 01-01-2008 00:01:01
    case3 01-01-2008 01:00:01
    case1 01-01-2008 01:02:01
    case4 01-01-2008 01:10:01
    case5 02-01-2008 02:00:01
    case6 02-01-2008 02:10:01
    case7 02-01-2008 23:00:01
    case.. 31-01-2008 24:00:00
    O/P
    from time to_time cases
    01-01-2008 00:00:00 01-01-2008 01:00:00 2
    01-01-2008 01:00:01 01-01-2008 02:00:00 3
    etc
    Any help really appreciated

    We can do this using analytical functions
    Following is what I did:
    create table timestamp1 (ts date)
    select *from timestamp1
    30/10/2008 15:41:13
    30/10/2008 15:41:05
    30/10/2008 15:40:03
    30/10/2008 14:58:26
    30/10/2008 14:29:45
    30/10/2008 13:17:48
    30/10/2008 08:29:50
    30/10/2008 06:05:51
    30/10/2008 03:41:52
    30/10/2008 02:29:54
    select distinct to_char(ts,'hh24') frmhrs,
    to_char(ts,'hh24')+1 tohrs, count(ts) OVER (order by to_number(to_char(ts,'hh24')) RANGE (1/24) PRECEDING )
    from timestamp1
    where trunc(ts)=trunc(sysdate) -- I added this just to make sure I get for today's data
    order by frmhrs
    FRMHRS     TOHRS     CNT
    02     3     1
    03     4     1
    06     7     1
    08     9     1
    13     14     1
    14     15     2
    15     16     3
    You can customizeas per ur need.

  • Query to retrieve 2 level of supervisors

    Hi all,
    I am using the following query to retrieve the people who is being supervised for a given person_id... Is there any way to modify this query (below) in order to get two levels of employees? something like:
    Supervisor 1
    Employee 1
    Employee 2
    Employee 3
    Supervisor 2
    Employee 4
    Employee 5
    Employee 6
    The query is working if I pass the person_id of Supervisor 1 for example I would get Employee 1 2 and 3. But if I pass a person id which of higher hierarchy I will just get Supervisor 1 Supervisor 2 ... And I need all the people (just two levels down)
    select distinct * from(
    select distinct ppf.first_name||' '||ppf.last_name
    , ppf.last_name
    , fu.user_name
    , fu.user_id
    , ppf.person_id
    , papf.person_id supervisor_id
    , pi.image_id
    , initcap(hla.description) LOCATION
    , pb.NAME pay_basis_name
    , pax.grade_id
    , haou.name
    , employment_category
    , ppos.date_start
    from per_assignments_x pax
    , per_grade_definitions pgd
    , per_people_x ppf
    , fnd_user fu
    , per_all_people_f papf
    , per_images pi
    , hr_locations_all hla
    , per_pay_bases pb
    , hr_all_organization_units haou
    , per_periods_of_service ppos
    where ppf.person_id = pax.person_id
    and trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
    and fu.person_party_id = papf.party_id
    and pax.supervisor_id =papf.person_id
    and pi.parent_id (+) = ppf.person_id
    and pi.table_name(+) = 'PER_PEOPLE_F'
    and pax.person_id = ppf.person_id
    and hla.location_id (+)= pax.location_id
    AND ppf.current_employee_flag = 'Y'
    AND pb.pay_basis_id = pax.pay_basis_id
    AND haou.organization_id = pax.organization_id
    AND ppos.person_id = ppf.person_id
    AND pax.grade_id = pgd.grade_definition_id
    AND papf.person_id = :inPersonId
    UNION ALL
    select ppf.first_name||' '||ppf.last_name
    , ppf.last_name
    , fu.user_name
    , fu.user_id
    , ppf.person_id
    , papf.person_id supervisor_id
    , pi.image_id
    , initcap(hla.description) LOCATION
    , pb.NAME pay_basis_name
    , pax.grade_id
    , haou.name
    , employment_category
    , ppos.date_start
    from per_people_x ppf
    , per_grade_definitions pgd
    , fnd_user fu
    , per_all_people_f papf
    , HR_WORKING_PERSON_LISTS HWPL
    , per_images pi
    , per_assignments_x pax
    , hr_locations_all hla
    , per_pay_bases pb
    , hr_all_organization_units haou
    , per_periods_of_service ppos
    where
    trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
    and fu.person_party_id = papf.party_id
    AND HWPL.owning_person_id = papf.person_id
    and hwpl.selected_person_id = ppf.person_id
    AND pi.parent_id (+) = ppf.person_id
    and ppf.current_employee_flag = 'Y'
    and pax.person_id = ppf.person_id
    AND hla.location_id (+)= pax.location_id
    AND pb.pay_basis_id = pax.pay_basis_id
    AND haou.organization_id = pax.organization_id
    AND ppos.person_id = ppf.person_id
    AND pax.grade_id = pgd.grade_definition_id
    AND papf.person_id = :inPersonId
    )order by last_name

    Hola Alejandro,
    you can play a little bit around with the one below you find more confortable with.
    /* multi level */
    select level
    ,assignment_number
    ,assignment_id
    ,supervisor_id
    ,(select full_name from per_people_x where person_id = pax.person_id)
    ,sys_connect_by_path( (select employee_number from per_people_x where person_id = pax.person_id), ' --> ')
    from per_assignments_x pax
    where primary_flag = 'Y'
    connect by prior person_id = supervisor_id
    start with person_id = 1523
    /* level 2 only */
    select (select full_name from per_people_x where person_id = pax1.person_id)
    ,(select full_name from per_people_x where person_id = pax2.person_id)
    from per_assignments_x pax1
    ,per_assignments_x pax2
    where pax1.supervisor_id = 1523
    and pax1.primary_flag = 'Y'
    and pax1.person_id = pax2.supervisor_id
    and pax2.primary_flag = 'Y'

  • Query to get the details of Blocking and deadlock occurred for the Day

    Hi,
       I need a query to get the details of blocking and deadlock occurred for the day.

    You havent specified which version of SQL you are using which makes it difficult to give a solution. Assuming its latest versions , by default SQL Server (in any versions) doesnt track blocking information.
    You need to run some kind of queries/traces to capture blocking. The same goes with Deadlocks where majority of the DBA's enable trace flag 1222/1205 when they suspect deadlocks happening.
    Check this link -
    http://dba.stackexchange.com/questions/10644/deadlock-error-isnt-returning-the-deadlock-sql/10646#10646
    This link gives code to get historic deadlock information. I havent used it , I just googled to get that.
    That being said if you are looking for something to capture for the future check the below links.
    Check these links on how to setup extended events to capture deadlock and blocking.
    http://sqlblog.com/blogs/jonathan_kehayias/archive/2010/12/21/an-xevent-a-day-21-of-31-the-future-tracking-blocking-in-denali.aspx
    http://blogs.msdn.com/b/sqlserverfaq/archive/2013/04/27/an-in-depth-look-at-sql-server-memory-part-2.aspx
    http://blogs.technet.com/b/mspfe/archive/2012/06/28/how_2d00_to_2d00_monitor_2d00_deadlocks_2d00_in_2d00_sql_2d00_server.aspx
    HTH
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • How to retrieve Retrieve document details

    Dear experts,
    I am looking for a function module to retrieve the details ( Like header , item info etc ) of the below document types.
    BID   ( RFQ )
    BIDX ( RFP )
    PCTR ( Contract )
    Please help.
    Thanks & Regards,
    Murthy

    search thrice, you will get everything
    BBP_PD_CTR_GETDETAIL
    BBP_PD_BID_GETDETAIL
    BBP_PD_BID_GET_ITEMLIST
    BBP_PD_QUOT_GETDETAIL
    BBP_PD_QUOT_ITEM_GETDETAIL
    BBP_PD_QUOT_GETLIST
    muthu

  • VBScript does not retrieve Member details if a Distribution/Security Group have only one Member

    Hi,
    VBScript does not retrieve Member details if a Distribution/Security Group have only one Member. I have tried several Scripts even changed the coding in it, also tried few External Script by created by other Scriptor's. Any suggestion on why this is happening. 

    Perfect... Thank you. I reworked on the Script and it is showing up. One more info required. I know my script is having another bug. Can you help me getting the member list of a User Group. When i pull it retrieves all the Group info for a user
    but no "Domain Users" Group.
    Sorry for the lame humor but it was getting late.
    As for you new request.  I do not understand what you are asking. Can you post your script and any error messages you are getting.
    ¯\_(ツ)_/¯

  • SQL query to get transaction detail from DEFERRED_TRAN_ID

    Hi,
    I'm using Oracle Advance Replication and get the transaction detail from Enterprise Manager Console.
    So instead of using the console.
    Is there a way any SQL query which get transaction details like SQL query fired, old and new column value etc from DEFERRED_TRAN_ID.
    thanks

    quote:
    Originally posted by:
    lucapac
    I have two tables: tblWorkers and tblSkills. tblWorkers has a
    column, Skills, which is populated from a multiple-checkbox form
    field with one or more skill_IDs from tblSkills, so each
    tblWorkers.Skills consists of a list of one or more comma-delimited
    values. For any Skill_ID, I need to generate a listing of all
    Workers with the corresponding skill, so I have tried to do
    something along the lines of SELECT WorkerName FROM tblWorkers
    WHERE Skills IN (Skills, #FORM.Skill_ID#) ... or WHERE Skills IN
    (ListFind(Skills, #FORM.Skill_ID#)) ... etc. ??? My results (once I
    got data type mismatches out of the way) return all Workers, not
    just those with the desired Skill. There must be an easy way to do
    this ... How do people with a bit more CF/SQL experience than I
    have do this???
    As Kronin implied, we normalize our databases. If you don't
    understand that answer, the book "Database Design for Mere Mortals"
    is often mentioned on this forum.

  • Query to retrieve list of ledgers accessible for a given Applications User

    We've a requirement to find the list of the accessible ledgers for a given Oracle Apps User.I'm from Oracle ATG team,not familiar with GL terminologies. Can someone help with the query to retrieve the ledgers accessible for a given user.In our code flow, we may not have the complete applications context. Is it possible to retrieve that list only with the username. If so, how to do that? Do i need to access some profile values?
    Thanks,
    Senthil

    select * from usr where usr.usr_key not in (
    select usr.usr_key from oiu, usr, obi, obj, ost
    where oiu.usr_key=usr.usr_key
    and oiu.obi_key=obi.obi_key
    and obi.obj_key=obj.obj_key
    and obj.obj_name = :obj_name
    and oiu.ost_key=ost.ost_key
    and ost.ost_status not in ('Revoked'))
    -Kevin

  • Query to retrieve Identical names, same birth dates

    I have a table with these fields:
    table1 definition
    (ID varchar2(10),
    name1 varchar2(50),
    name2 varchar2(50),
    name3 varchar2(50),
    name4 varchar2(50),
    birthdt date)
    I need to write a query to retrieve the id's of those people that have identical first and last names AND were born on the same date. note that name is composed of four parts.
    I am trying this query
    (select id from table1 group by name1,name4,birthdt having count(name1)>1 and count(name4)>1 and count(birthdt)>1). I am not getting correct results.
    Any help appreciated.
    Ammar

    ¿...Doh...how could I miss that? smacks forehead
    Thanks ( for the N-th time ;) ) for setting straight, Solomon.
    Guess I wasn't completely recovered from yesterday ;)
    However, the basic approach wasn't too bad ;)
    But ofcourse the 'select *' should be 'select id'
    Using testdata:
    SQL> with table1 as ( -- generating sample data as I should have done in the first place:
      2  select 1 id, 'John' name1, 'James' name2, 'Joe' name3, 'Jameson' name4, to_date('15-05-1989','dd-mm-yyyy') birthdt from dual union all
      3  select 2 id, 'John' name1, 'James' name2, 'Joe' name3, 'Jackson' name4, to_date('15-05-1989','dd-mm-yyyy') birthdt from dual union all
      4  select 3 id, 'John' name1, 'James' name2, 'Joe' name3, 'Jameson' name4, to_date('25-05-1989','dd-mm-yyyy') birthdt from dual union all
      5  select 4 id, 'Zlad' name1, 'James' name2, 'Joe' name3, 'Jameson' name4, to_date('15-05-1989','dd-mm-yyyy') birthdt from dual union all
      6  select 5 id, 'John' name1, 'James' name2, 'Joe' name3, 'Jameson' name4, to_date('15-05-1989','dd-mm-yyyy') birthdt from dual
      7  )
      8  --
      9  -- actual query
    10  --
    11  select id
    12  from ( select id
    13         ,      name1
    14         ,      name2
    15         ,      name3
    16         ,      name4
    17         ,      birthdt
    18         ,      count(*) over (partition by name1, name2, name3, name4, birthdt) recs
    19         from   table1
    20       )
    21  where recs > 1;
            ID
             1
             5

  • Query to retrieve all saved user queries?

    Hi,
    In which table are the user queries saved?
    How can I write a query to retrieve all the user created queries?
    I need to copy all the user queries which are implemented in 1 client implementation to a different client's implementation.
    Thanks.

    Hi Rajesh
    Try This query
    select QName,QString from OUQR .
    You can use the quick copy option if you are using SAP version 9 and if lower you can use the copy express addon..
    SAP Business One 9 - Implemenation Center  Quick Copy  
    Hope Helpful
    Regards
    Kennedy

  • Query to retrieve all unreconciled BP account transactions

    Hi, can anyone help me to formulate a SQL query to retrieve only the unreconciled transactions from a business partner account.  In other words all the records that display in the account balance enquiry when you tick the "Display Unreconciled Trans. Only" box.

    Hi all,
    No one has been able to help with this one.  It appears to me there should be a simple solution somewhere.  Can anyone be a hero and answer this?
    I am querying the JDT1 table to get the transactions but I get everything and I want to identify only the ones that have not yet been reconciled.
    Cheers,
    Greg.

Maybe you are looking for

  • How do i install windows on mavericks using MDT?

    I have no problems installing 7 thru dvd or usb, but cannot get it to install using MDT

  • Alternative for group by

    Hi guys i need some help with the logic. As an example, i have table with Account and product columns. So each Account can have multiple products. Now i need SQL to see Accounts that have only Product. One way of doing it is by doing a groupby and ha

  • Recursive Node  In WebDyn Pro

    Hi........ Like I am not Able to Create Recursive Node. it is giving Error. Type Comfortable. Please Tell Me solution ...

  • Submit Button to Email PDF?

    Is it possible to submit a PDF fillable form through email without enabling the "additional features" via Adobe Acrobat Pro X? Or in order to submit anything by email is it HAS to be enabled? Thanks!

  • GetPreemptionLatency in Sun's RTJ

    Hello, I've tried the following piece of code to obtain information about the interference introduced by the garbage collector: System.out.println( RealtimeSystem.currentGC().getPreemptionLatency());in the following system: - Ubuntu (9.1) - Real-time