How to make joins using different tables depending on inputs? Dynamic Query

Hi,
I have this situation:
- A form with a few input messages;
- Each input corresponds to a table on a DB;
- A user can search for information filling any input, one or more;
- With the inputs filled I have to dynamic create the query, execute it and show the returned lines on a table.
How I am supposed to do that? What is the right way to make it? Can I alter a VO query on runtime including from arguments?
Any light would be apreciate!
Thanks,
Marcelo

You can make View Object with Dynamic Select Statement.
See the detailed instructions in the
oracle.apps.fnd.framework.server.OAViewDef Javadoc for creating a thread-specific view instance at Run time.

Similar Messages

  • How to join THREE different tables into internal table using one select statement .

    How to join THREE different tables into internal table using one select statement .
    Hi experts,
    I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
    Scenario:
    Database tables:
    SPFLI
    SFLIGHT
    SBOOK.
    Table Fields:
    SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
    SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
    SEATSOCC_C SEATSMAX_F SEATSOCC_F
    SBOOK - CARRID CONNID CLASS
    MY INTERNAL TABLE IS IT_XX.
    Your help much appreciated.
    Thanks in advance.
    Pawan.

    Hi Pawan,
    please check below codes. hope it can help you.
    TYPES: BEGIN OF ty_xx,
            carrid     TYPE spfli-carrid   ,
            connid     TYPE spfli-connid   ,
            countryfr  TYPE spfli-countryfr,
            cityfrom   TYPE spfli-cityfrom  ,
            countryto  TYPE spfli-countryto,
            cityto     TYPE spfli-cityto   ,
            fldate     TYPE sflight-fldate ,
            seatsmax   TYPE sflight-seatsmax ,
            seatsocc   TYPE sflight-seatsocc ,
            seatsmax_b TYPE sflight-seatsmax_b,
            seatsocc_b TYPE sflight-seatsocc_b,
            seatsmax_f TYPE sflight-seatsmax_f,
            seatsocc_f TYPE sflight-seatsocc_f,
            class      TYPE sbook-class,
          END OF ty_xx,
          t_xx TYPE STANDARD TABLE OF ty_xx.
    DATA: it_xx TYPE t_xx.
    SELECT spfli~carrid
           spfli~connid
           spfli~countryfr
           spfli~cityfrom
           spfli~countryto
           spfli~cityto
           sflight~fldate
           sflight~seatsmax
           sflight~seatsocc
           sflight~seatsmax_b
           sflight~seatsocc_b
           sflight~seatsmax_f
           sflight~seatsocc_f
           sbook~class
      INTO TABLE it_xx
      FROM spfli INNER JOIN sflight
      ON spfli~carrid = sflight~carrid
      AND spfli~connid = sflight~connid
      INNER JOIN sbook
      ON spfli~carrid = sbook~carrid
      AND spfli~connid = sbook~connid.
    Thanks,
    Yawa

  • How to make column headers in table in PDF report appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp

    Hi my name is vishal
    For past 10 days i have been breaking my head on how to make column headers in table appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp.
    Given below is my code in c# on how i export datas from different tables in sql server to PDF report using iTextSharp:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using System.Diagnostics;
    using System.IO;
    namespace DRRS_CSharp
    public partial class frmPDF : Form
    public frmPDF()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(6);
    table.TotalWidth =530f;
    table.LockedWidth = true;
    PdfPCell cell = new PdfPCell(new Phrase("Institute/Hospital:AIIMS,NEW DELHI", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK)));
    cell.Colspan = 6;
    cell.HorizontalAlignment = 0;
    table.AddCell(cell);
    Paragraph para=new Paragraph("DCS Clinical Record-Assigned Dialyzer",FontFactory.GetFont("Arial",16,iTextSharp.text.Font.BOLD,BaseColor.BLACK));
    para.Alignment = Element.ALIGN_CENTER;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(105f, 105f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn = new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select d.dialyserID,r.errorCode,r.dialysis_date,pn.patient_first_name,pn.patient_last_name,d.manufacturer,d.dialyzer_size,r.start_date,r.end_date,d.packed_volume,r.bundle_vol,r.disinfectant,t.Technician_first_name,t.Technician_last_name from dialyser d,patient_name pn,reprocessor r,Techniciandetail t where pn.patient_id=d.patient_id and r.dialyzer_id=d.dialyserID and t.technician_id=r.technician_id and d.deleted_status=0 and d.closed_status=0 and pn.status=1 and r.errorCode<106 and r.reprocessor_id in (Select max(reprocessor_id) from reprocessor where dialyzer_id=d.dialyserID) order by pn.patient_first_name,pn.patient_last_name", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("Reprocessing Date");
    table.AddCell("Patient Name");
    table.AddCell("Dialyzer(Manufacturer,Size)");
    table.AddCell("No.of Reuse");
    table.AddCell("Verification");
    table.AddCell("DialyzerID");
    while (dr.Read())
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString() +"_"+ dr[4].ToString());
    table.AddCell(dr[5].ToString() + "-" + dr[6].ToString());
    table.AddCell("@count".ToString());
    table.AddCell(dr[12].ToString() + "-" + dr[13].ToString());
    table.AddCell(dr[0].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    System.Diagnostics.Process.Start("AssignedDialyzer.pdf");
    if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.Yes)
    var writer2 = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    else if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.No)
    this.Close();
    The above code executes well with no problem at all!
    As you can see the file to which i create and save and open my pdf report is
    AssignedDialyzer.pdf.
    The column headers of table in pdf report from c# windows forms using iTextSharp are
    "Reprocessing Date","Patient Name","Dialyzer(Manufacturer,Size)","No.of Reuse","Verification" and
    "DialyzerID".
    However the problem i am facing is after execution and opening of document is my
    column headers in table in pdf report from
    c# and datas in it all appear in bold.
    I have browsed through net regarding to solve this problem but with no success.
    What i want is my pdf report from c# should be similar to following format which i was able to accomplish in vb6,adodb with MS access using iTextSharp.:
    Given below is report which i have achieved from vb6,adodb with MS access using iTextSharp
    I know that there has to be another way to solve my problem.I have browsed many articles in net regarding exporting sql datas to above format but with no success!
    Is there is any another way to solve to my problem on exporting sql datas from c# windows forms using iTextSharp to above format given in the picture/image above?!
    If so Then Can anyone tell me what modifications must i do in my c# code given above so that my pdf report from c# windows forms using iTextSharp will look similar to image/picture(pdf report) which i was able to accomplish from
    vb6,adodb with ms access using iTextSharp?
    I have approached Sound Forge.Net for help but with no success.
    I hope anyone/someone truly understands what i am trying to ask!
    I know i have to do lot of modifications in my c# code to achieve this level of perfection but i dont know how to do it.
    Can anyone help me please! Any help/guidance in solving this problem would be greatly appreciated.
    I hope i get a reply in terms of solving this problem.
    vishal

    Hi,
    About iTextSharp component issue , I think this case is off-topic in here.
    I suggest you consulting to compenent provider.
    http://sourceforge.net/projects/itextsharp/
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can you please help me by saying me how can i join two different picture to make it as one picture.??

    Hi Sir/ Madam,
       My name is Rishav and I am facing some problem with my Photoshop CC. Actually I have a question. If you guys could help me out i will be very obliged. The quest in "Can you please help me by saying me how can i join two different picture to make it as one picture.??"

    Maybe you should post over at
    Photoshop for Beginners
    or start with the "Get Started" section of the Help:
    Photoshop Help | Photoshop Help
    And your question
    Can you please help me by saying me how can i join two different picture to make it as one picture.??
    does not seem particularly specific – do you want to simply combine two images as they are, do you want to clip elements from the one and insert them into the other, …?
    Could you post (lores of) the images and explain what you intend to achieve?

  • How to provide joins between oracle tables and sql server tables

    Hi,
    I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server.
    how to provide joins between oracle tables and sql server tables ? Any help on this
    Regards,
    Malli

    user10675696 wrote:
    I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server. Bad idea most times. Heterogeneous joins do not exactly scale and performance can be severely degraded by network speed and b/w availability. And there is nothing you can do in the application and database layers to address performance issue at the network level in this case - your code's performance is simply at the mercy of network performance. With a single glaring fact - network performance is continually degrading. All the time. Always. Until it is upgraded. When the performance degradation starts all over again.
    If the tables are not small (few 1000 rows each) and row volumes static, I would not consider doing a heterogeneous join. Instead I would rather go for a materialised view on the Oracle side, use a proper table and index structure, and do a local database join.

  • How to make records  to the table TRFCQIN

    hi all,
    anyone can tell me
    how to make records  to the table TRFCQIN
    regards

    Hi Wanna,
                    Write a module pool program to enter record into table TRFCQIN.
    Take fields to which u want to make entries in module pool.
    Use insert command to append data in table TRFCQIN.
    Refer this code :
    CASE OK_CODE_101.
    WHEN 'SAV1'.
    TRFCQIN-QNAME = 'XYZ'.
    TRFCQIN-QCOUNT = "Screen field name at which user will enter value
    INSERT TRFCQIN.
    if sy-subrc <> 0.
    message e007.
    else.
    clear TRFCQIN.
    clear ok_code_101.
    endif.
    endcase.
    Reward points if helpful.
    Regards,
    Heamnt

  • I have a $10 gift card balance on my Apple ID but when I try to rent a movie it wants me to use my debit card. How can Make it use the iTunes credit?

    I have a $10 gift card balance on my Apple ID but when I try to rent a movie it wants me to use my debit card. How can Make it use the iTunes credit?

    Hi ...
    Select None for payment method > iTunes Store: Changing account information
    Be aware, an auto renewing subsciption by require a credit card.

  • How to make OLAPDATAGRID use AS3

    How to make OLAPDATAGRID use AS3? I make like this and have a
    problem lease halp me type simple example!
    [Attach Code]
    package My
    import mx.collections.ArrayCollection;
    import mx.collections.IList;
    import mx.controls.Alert;
    import mx.controls.OLAPDataGrid;
    import mx.olap.IOLAPCube;
    import mx.olap.IOLAPDimension;
    import mx.olap.IOLAPQuery;
    import mx.olap.IOLAPQueryAxis;
    import mx.olap.OLAPAttribute;
    import mx.olap.OLAPCube;
    import mx.olap.OLAPDimension;
    import mx.olap.OLAPHierarchy;
    import mx.olap.OLAPLevel;
    import mx.olap.OLAPMeasure;
    import mx.olap.OLAPQuery;
    import mx.olap.OLAPResult;
    import mx.olap.OLAPSet;
    import mx.rpc.AsyncResponder;
    import mx.rpc.AsyncToken;
    public class OlapDGCreator
    [Bindable]
    private var flatData:ArrayCollection = new ArrayCollection(
    {otd:"div1",pos:"programmer",year:2007,quarter:"q1",zp:20000},
    {otd:"div1",pos:"manager",year:2007,quarter:"q1",zp:15000},
    {otd:"div2",pos:"programmer",year:2007,quarter:"q1",zp:25000},
    {otd:"div2",pos:"manager",year:2007,quarter:"q1",zp:23000},
    {otd:"div1",pos:"programmer",year:2007,quarter:"q2",zp:21000},
    {otd:"div1",pos:"manager",year:2007,quarter:"q2",zp:16000},
    {otd:"div2",pos:"programmer",year:2007,quarter:"q2",zp:27000},
    {otd:"div2",pos:"manager",year:2007,quarter:"q2",zp:24000},
    public var str:String = "";
    public var ODG:OLAPDataGrid = new OLAPDataGrid();
    public var MyCube:OLAPCube = new OLAPCube("otchet");
    public function OlapDGCreator()
    MyCube.dataProvider=flatData;
    var m:OLAPMeasure = new OLAPMeasure("ZP");
    m.aggregator="SUM";
    m.dataField="zp";
    var a:IList = new ArrayCollection();
    a.addItem(m);
    var dimDateTime:OLAPDimension = new
    OLAPDimension("DateTime","DateTime");
    dimDateTime.cube=MyCube;
    dimDateTime.name="DateTime";
    var hierDataTime:OLAPHierarchy = new
    OLAPHierarchy("hierDataTime","displayHierDataTime");
    var l1:OLAPLevel = new OLAPLevel("Year","Year")
    var l2:OLAPLevel = new OLAPLevel("Quarter","Quarter")
    hierDataTime.levels.addItem(l1);
    hierDataTime.levels.addItem(l2);
    var att1:OLAPAttribute = new OLAPAttribute("Year","Year")
    att1.dataField="year";
    att1.name="Year";
    var att2:OLAPAttribute = new
    OLAPAttribute("Quarter","quarter")
    att2.dataField="quarter";
    att2.name="Quarter";
    dimDateTime.attributes.addItem(att1)
    dimDateTime.attributes.addItem(att2)
    dimDateTime.hierarchies.addItem(hierDataTime);
    var dimDivDim:OLAPDimension = new
    OLAPDimension("DivDim","DivDim");
    dimDivDim.cube=MyCube;
    dimDivDim.name="DivDim";
    var hierDivDim:OLAPHierarchy = new
    OLAPHierarchy("hierDivDim","displayHierDivDim");
    var dd_l1:OLAPLevel = new OLAPLevel("Otd","Otd")
    var dd_l2:OLAPLevel = new OLAPLevel("Pos","Pos")
    hierDivDim.levels.addItem(dd_l1);
    hierDivDim.levels.addItem(dd_l2);
    var dd_att1:OLAPAttribute = new OLAPAttribute("Otd","Otd")
    dd_att1.dataField="otd";
    dd_att1.dimension=dimDivDim;
    var dd_att2:OLAPAttribute = new OLAPAttribute("Pos","Pos")
    dd_att2.dataField="pos";
    dd_att2.dimension=dimDivDim;
    dimDivDim.attributes.addItem(dd_att1);
    dimDivDim.attributes.addItem(dd_att2);
    dimDivDim.hierarchies.addItem(hierDivDim);
    MyCube.dimensions.addItem(dimDateTime);
    MyCube.dimensions.addItem(dimDivDim);
    MyCube.measures = a
    MyCube.refresh();
    //MyCube.measures.addEventListener("www",test);
    //MyCube.addEventListener(CubeEvent.CUBE_COMPLETE,runQuery)
    runQuery();
    //запустили
    выражение
    // Create the OLAP query.
    private function getQuery(cube:IOLAPCube):IOLAPQuery {
    // Create an instance of OLAPQuery to represent the query.
    var query:OLAPQuery = new OLAPQuery;
    // Get the row axis from the query instance.
    var rowQueryAxis:IOLAPQueryAxis =
    query.getAxis(OLAPQuery.ROW_AXIS);
    // Create an OLAPSet instance to configure the axis.
    var otdSet:OLAPSet = new OLAPSet;
    // Add the Product to the row to aggregate data
    // by the Product dimension.
    var tmp:IOLAPDimension = cube.findDimension("DivDim");
    var tmp2:OLAPDimension = cube.dimensions[0];
    otdSet.addElements(OLAPAttribute(OLAPDimension(cube.dimensions[1]).attributes[0]).childre n);//zah
    otdSet.addElements(cube.findDimension("DivDim").findAttribute("Otd").children);
    // Add the OLAPSet instance to the axis.
    var posSet:OLAPSet = new OLAPSet;
    // Add the Product to the row to aggregate data
    // by the Product dimension.
    posSet.addElements(OLAPAttribute(OLAPDimension(cube.dimensions[1]).attributes[1]).childre n);//zah
    posSet.addElements(cube.findDimension("DivDim").findAttribute("Pos").children);
    // Add the OLAPSet instance to the axis.
    rowQueryAxis.addSet(otdSet.crossJoin(posSet));
    // Get the column axis from the query instance, and
    configure it
    // to aggregate the columns by the Quarter dimension.
    var colQueryAxis:IOLAPQueryAxis =
    query.getAxis(OLAPQuery.COLUMN_AXIS);
    var yearSet:OLAPSet= new OLAPSet;
    yearSet.addElements(OLAPAttribute(OLAPDimension(cube.dimensions[0]).attributes[0]).childr en);//zah
    yearSet.addElements(cube.findDimension("DateTime").findAttribute("Year").children);
    var quarterSet:OLAPSet= new OLAPSet;
    quarterSet.addElements(OLAPAttribute(OLAPDimension(cube.dimensions[0]).attributes[1]).chi ldren);//zah
    //quarterSet.addElements(cube.findDimension("DateTime").findAttribute("Quarter").children );
    colQueryAxis.addSet(yearSet.crossJoin(quarterSet));
    return query;
    // Event handler to execute the OLAP query
    // after the cube completes initialization.
    // private function runQuery(event:CubeEvent):void {
    private function runQuery():void {
    // Get cube.
    //var cube:IOLAPCube = IOLAPCube(event.currentTarget);
    var cube:IOLAPCube = IOLAPCube(this.MyCube);
    // Create a query instance.
    var query:IOLAPQuery = getQuery(cube);
    // Execute the query.
    var token:AsyncToken = cube.execute(query);
    // Setup handlers for the query results.
    token.addResponder(new AsyncResponder(showResult,
    showFault));
    // Handle a query fault.
    private function showFault(result:Object, token:Object):void
    Alert.show("Error in query.");
    // Handle a successful query by passing the query results to
    // the OLAPDataGrid control..
    private function showResult(result:Object,
    token:Object):void {
    if (!result) {
    Alert.show("No results from query.");
    return;
    ODG.dataProvider= result as OLAPResult;
    [/Attach Code]

    Here is the fixed code. I would have loved to re-organize the
    code but left it as is so that you can diff the files and make a
    note of the differences.
    package
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    import mx.controls.OLAPDataGrid;
    import mx.events.CubeEvent;
    import mx.olap.IOLAPCube;
    import mx.olap.IOLAPDimension;
    import mx.olap.IOLAPQuery;
    import mx.olap.IOLAPQueryAxis;
    import mx.olap.OLAPAttribute;
    import mx.olap.OLAPCube;
    import mx.olap.OLAPDimension;
    import mx.olap.OLAPHierarchy;
    import mx.olap.OLAPLevel;
    import mx.olap.OLAPMeasure;
    import mx.olap.OLAPQuery;
    import mx.olap.OLAPResult;
    import mx.olap.OLAPSet;
    import mx.rpc.AsyncResponder;
    import mx.rpc.AsyncToken;
    public class OlapDGCreator
    [Bindable]
    private var flatData:ArrayCollection = new ArrayCollection(
    {otd:"div1",pos:"programmer",year:2007,quarter:"q1",zp:20000},
    {otd:"div1",pos:"manager",year:2007,quarter:"q1",zp:15000},
    {otd:"div2",pos:"programmer",year:2007,quarter:"q1",zp:25000},
    {otd:"div2",pos:"manager",year:2007,quarter:"q1",zp:23000},
    {otd:"div1",pos:"programmer",year:2007,quarter:"q2",zp:21000},
    {otd:"div1",pos:"manager",year:2007,quarter:"q2",zp:16000},
    {otd:"div2",pos:"programmer",year:2007,quarter:"q2",zp:27000},
    {otd:"div2",pos:"manager",year:2007,quarter:"q2",zp:24000},
    public var str:String = "";
    public var ODG:OLAPDataGrid = new OLAPDataGrid();
    public var MyCube:OLAPCube = new OLAPCube("otchet");
    public function OlapDGCreator()
    MyCube.dataProvider=flatData;
    var m:OLAPMeasure = new OLAPMeasure("ZP");
    m.aggregator="SUM";
    m.dataField="zp";
    //var a:IList = new ArrayCollection();
    //a.addItem(m);
    var dimDateTime:OLAPDimension = new
    OLAPDimension("DateTime","DateTime");
    //dimDateTime.cube=MyCube;
    //dimDateTime.name="DateTime";
    var hierDataTime:OLAPHierarchy = new
    OLAPHierarchy("hierDataTime","displayHierDataTime");
    var l1:OLAPLevel = new OLAPLevel("Year","Year")
    l1.attributeName = "Year";
    var l2:OLAPLevel = new OLAPLevel("Quarter","Quarter")
    l2.attributeName = "Quarter";
    //hierDataTime.levels.addItem(l1);
    //hierDataTime.levels.addItem(l2);
    hierDataTime.levels = new ArrayCollection([l1, l2]);
    var att1:OLAPAttribute = new OLAPAttribute("Year","Year")
    att1.dataField="year";
    //att1.name="Year";
    var att2:OLAPAttribute = new
    OLAPAttribute("Quarter","quarter")
    att2.dataField="quarter";
    //att2.name="Quarter";
    //dimDateTime.attributes.addItem(att1)
    //dimDateTime.attributes.addItem(att2)
    dimDateTime.attributes = new ArrayCollection([att1, att2]);
    //dimDateTime.hierarchies.addItem(hierDataTime);
    dimDateTime.hierarchies = new
    ArrayCollection([hierDataTime]);
    var dimDivDim:OLAPDimension = new
    OLAPDimension("DivDim","DivDim");
    //dimDivDim.cube=MyCube;
    //dimDivDim.name="DivDim";
    var hierDivDim:OLAPHierarchy = new
    OLAPHierarchy("hierDivDim","displayHierDivDim");
    var dd_l1:OLAPLevel = new OLAPLevel("Otd","Otd")
    dd_l1.attributeName = "Otd";
    var dd_l2:OLAPLevel = new OLAPLevel("Pos","Pos")
    dd_l2.attributeName = "Pos";
    //hierDivDim.levels.addItem(dd_l1);
    //hierDivDim.levels.addItem(dd_l2);
    hierDivDim.levels = new ArrayCollection([dd_l1, dd_l2]);
    var dd_att1:OLAPAttribute = new OLAPAttribute("Otd","Otd")
    dd_att1.dataField="otd";
    //dd_att1.dimension=dimDivDim;
    var dd_att2:OLAPAttribute = new OLAPAttribute("Pos","Pos")
    dd_att2.dataField="pos";
    //dd_att2.dimension=dimDivDim;
    //dimDivDim.attributes.addItem(dd_att1);
    //dimDivDim.attributes.addItem(dd_att2);
    //dimDivDim.hierarchies.addItem(hierDivDim);
    dimDivDim.attributes = new ArrayCollection([dd_att1,
    dd_att2]);
    dimDivDim.hierarchies = new ArrayCollection([hierDivDim]);
    //MyCube.dimensions.addItem(dimDateTime);
    //MyCube.dimensions.addItem(dimDivDim);
    //MyCube.measures = a
    MyCube.elements = [dimDateTime, dimDivDim, m];
    MyCube.refresh();
    //MyCube.measures.addEventListener("www",test);
    MyCube.addEventListener(CubeEvent.CUBE_COMPLETE,runQuery)
    // Create the OLAP query.
    private function getQuery(cube:IOLAPCube):IOLAPQuery {
    // Create an instance of OLAPQuery to represent the query.
    var query:OLAPQuery = new OLAPQuery;
    // Get the row axis from the query instance.
    var rowQueryAxis:IOLAPQueryAxis =
    query.getAxis(OLAPQuery.ROW_AXIS);
    // Create an OLAPSet instance to configure the axis.
    var otdSet:OLAPSet = new OLAPSet;
    // Add the Product to the row to aggregate data
    // by the Product dimension.
    var tmp:IOLAPDimension = cube.findDimension("DivDim");
    var tmp2:OLAPDimension = cube.dimensions[0];
    otdSet.addElements(OLAPAttribute(OLAPDimension(cube.dimensions[1]).attributes[0]).children );//zah
    otdSet.addElements(cube.findDimension("DivDim").findAttribute("Otd").children);
    // Add the OLAPSet instance to the axis.
    var posSet:OLAPSet = new OLAPSet;
    // Add the Product to the row to aggregate data
    // by the Product dimension.
    posSet.addElements(OLAPAttribute(OLAPDimension(cube.dimensions[1]).attributes[1]).children );//zah
    posSet.addElements(cube.findDimension("DivDim").findAttribute("Pos").children);
    // Add the OLAPSet instance to the axis.
    rowQueryAxis.addSet(otdSet.crossJoin(posSet));
    // Get the column axis from the query instance, and configure
    it
    // to aggregate the columns by the Quarter dimension.
    var colQueryAxis:IOLAPQueryAxis =
    query.getAxis(OLAPQuery.COLUMN_AXIS);
    var yearSet:OLAPSet= new OLAPSet;
    yearSet.addElements(OLAPAttribute(OLAPDimension(cube.dimensions[0]).attributes[0]).childre n);//zah
    yearSet.addElements(cube.findDimension("DateTime").findAttribute("Year").children);
    var quarterSet:OLAPSet= new OLAPSet;
    quarterSet.addElements(OLAPAttribute(OLAPDimension(cube.dimensions[0]).attributes[1]).chil dren);//zah
    //quarterSet.addElements(cube.findDimension("DateTime").findAttribute("Quarter").children) ;
    colQueryAxis.addSet(yearSet.crossJoin(quarterSet));
    return query;
    // Event handler to execute the OLAP query
    // after the cube completes initialization.
    // private function runQuery(event:CubeEvent):void {
    private function runQuery(event:Event):void {
    // Get cube.
    //var cube:IOLAPCube = IOLAPCube(event.currentTarget);
    var cube:IOLAPCube = IOLAPCube(this.MyCube);
    // Create a query instance.
    var query:IOLAPQuery = getQuery(cube);
    // Execute the query.
    var token:AsyncToken = cube.execute(query);
    // Setup handlers for the query results.
    token.addResponder(new AsyncResponder(showResult,
    showFault));
    // Handle a query fault.
    private function showFault(result:Object, token:Object):void
    Alert.show("Error in query.");
    // Handle a successful query by passing the query results to
    // the OLAPDataGrid control..
    private function showResult(result:Object, token:Object):void
    if (!result) {
    Alert.show("No results from query.");
    return;
    ODG.dataProvider= result as OLAPResult;

  • How to create indexes using CREATE TABLE statement

    Hi,
    Can anyone please tell me how to create indexes using CREATE TABLE staement? This point is part SQL Expert exam (1Z0-047) and please guide me to use which books for this particular exam.
    Thanks in advance.

    Can anyone please tell me how to create indexes using CREATE TABLE staement?e.g. creating a primary key or a unique constraint will generate indexes along with the create table syntax:
    SQL> create table t (a integer primary key, b integer unique)
    Table created.
    SQL> select   index_name, index_type, uniqueness
      from   user_indexes
    where   table_name = 'T'
    INDEX_NAME                     INDEX_TYPE                  UNIQUENES
    SYS_C0016575                   NORMAL                      UNIQUE  
    SYS_C0016574                   NORMAL                      UNIQUE  
    2 rows selected.

  • How to make a column in Table popin read only

    Hi Everyone
    Could anyone let me know how to make a column in table popin read only.
    Regards

    if you ar eusing an ALV table
    try this
      DATA: lr_salv_wd_table TYPE REF TO iwci_salv_wd_table,
            r_table TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
    * get reference to ALV component interface
      lr_salv_wd_table = wd_this->wd_cpifc_alvmain( ).
    * get ConfigurationModel from ALV Component
      wd_this->r_table = lr_salv_wd_table->get_model( ).
    * init ColumnSettings
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
            lr_col_header TYPE REF TO cl_salv_wd_column_header.
      lr_column_settings ?= wd_this->r_table.
    * get table of column settings - each line one column
      DATA: lt_columns TYPE salv_wd_t_column_ref.
      lt_columns = lr_column_settings->get_columns( ).
    * loop over table - in each loop another column can be modified
      DATA: ls_column TYPE salv_wd_s_column_ref.
    * define visible columns (fields) by naming them,
    * exclude others by setting visibility to none
      DATA: ls_tooltip TYPE string.
      LOOP AT lt_columns INTO ls_column.
        " get header of column
        lr_col_header = ls_column-r_column->get_header( ).
        " do settings here
    ENDLOOP.
    Or see this document for more tips.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40794172-b95a-2910-fb98-b86d8a0918b4">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40794172-b95a-2910-fb98-b86d8a0918b4</a>
    regards,
    Joris

  • Update two different tables by a single sql query:

    Hi All,
    i need to update two different talbes in a single sql query..
    i m using the following query
    UPDATE FT_User_Alert SET Subscription = 'W' where product_key=1 and measure_key = 12
    AND
    UPDATE LU_Monthly_Alert_Budget_Sheet SET Min_Red_Range ='16.0' AND Max_Green_Range ='24.0'AND Max_Red_Range ='27.0'AND Min_Green_Range ='16.0' where product_key='1' and measure_key = 12
    i m getting the following error:
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43093] An error occurred while processing the EXECUTE PHYSICAL statement. [nQSError: 17001] Oracle Error code: 936, message: ORA-00936: missing expression at OCI call OCIStmtExecute: UPDATE FT_User_Alert SET Subscription = 'W' where product_key=1 and measure_key = 12 AND UPDATE LU_Monthly_Alert_Budget_Sheet SET Min_Red_Range ='16.0' AND Max_Green_Range ='24.0'AND Max_Red_Range ='27.0'AND Min_Green_Range ='16.0' where product_key='1' and measure_key = 12 . [nQSError: 17011] SQL statement execution failed. (HY000)
    SQL Issued: EXECUTE PHYSICAL CONNECTION POOL writeback UPDATE FT_User_Alert SET Subscription = 'W' where product_key=1 and measure_key = 12 AND UPDATE LU_Monthly_Alert_Budget_Sheet SET Min_Red_Range ='16.0' AND Max_Green_Range ='24.0'AND Max_Red_Range ='27.0'AND Min_Green_Range ='16.0' where product_key='1' and measure_key = 12
    but when i m ushin the same query in Microsoft SQL Server it executes properly:
    please help me out...

    Duplicate thread. I've already answered on your other thread...
    update two different tables by a single sql query:

  • Passing different tables as a input parameter

    HI,
    I've 5 tables TAB1, TAB2, TAB3, TAB4, TAB5
    and I created 5 store procedures to generate 5 file.txt with utl_file utility.
    Now I'd like to know if possible create just one stored procedure (or package) with just one cursor
    that passing different tables as a input parameter.
    Have you any idea?
    Thanks in advance!

    Here you go...
    SQL> create table tab1 as select 1 as x, 'A' as y from dual union
      2                       select 2, 'B' from dual union
      3                       select 3, 'C' from dual;
    Table created.
    SQL>
    SQL> create table tab2 as select 4 as x, 'D' as y from dual union
      2                       select 5, 'E' from dual union
      3                       select 6, 'F' from dual;
    Table created.
    SQL>
    SQL> CREATE OR REPLACE PROCEDURE output_tbl (p_table_name IN VARCHAR2) IS
      2    v_cur     SYS_REFCURSOR;
      3    x         NUMBER;
      4    y         VARCHAR2(10);
      5  BEGIN
      6    OPEN v_cur FOR 'SELECT x, y FROM '||p_table_name||' ORDER BY x';
      7    LOOP
      8      FETCH v_cur INTO x, y;
      9      EXIT WHEN v_cur%NOTFOUND;
    10      -- Here you would output to your file, but for ease of
    11      -- demonstration I'll just dbms_output the data
    12      DBMS_OUTPUT.PUT_LINE(x||' : '||y);
    13    END LOOP;
    14  END;
    15  /
    Procedure created.
    SQL> exec output_tbl('TAB1');
    1 : A
    2 : B
    3 : C
    PL/SQL procedure successfully completed.
    SQL> exec output_tbl('TAB2');
    4 : D
    5 : E
    6 : F
    PL/SQL procedure successfully completed.
    SQL>

  • How to join 5 different tables using SQL to make it to a flat file structur

    I am trying to load five differnt tables into one flat file structure table without cartesian product.
    I have five different tables Jobplan, Jobtask(JT), Joblabor(JL), Jobmaterial(JM) and Jpsequence(JS) and the target table as has all the five tables as one table.
    The data i have here is something like this.
    jobplan = 1record
    jobtask = 5 records
    joblabor = 2 records
    jobmaterial = 1 record
    jpsequence = 3 records
    The output has to be like this.
    JPNUM     DESCRIPTION     LOCATION     JT_JPNUM     JT_TASK     JL_JPNUM     JL_labor     JM_JPNUM     JM_MATERIAL     JS_JPNUM     JS_SEQUENCE
    1001     Test Jobplan     USA     NULL     NULL     NULL     NULL     NULL     NULL     NULL     NULL
    1001     Test Jobplan     USA     1001     10     NULL     NULL     NULL     NULL     NULL     NULL
    1001     Test Jobplan     USA     1001     20     NULL     NULL     NULL     NULL     NULL     NULL
    1001     Test Jobplan     USA     1001     30     NULL     NULL     NULL     NULL     NULL     NULL
    1001     Test Jobplan     USA     1001     40     NULL     NULL     NULL     NULL     NULL     NULL
    1001     Test Jobplan     USA     1001     50     NULL     NULL     NULL     NULL     NULL     NULL
    1001     Test Jobplan     USA     NULL     NULL     1001     Sam     NULL     NULL     NULL     NULL
    1001     Test Jobplan     USA     NULL     NULL     1001     Mike     NULL     NULL     NULL     NULL
    1001     Test Jobplan     USA     NULL     NULL     NULL     NULL     1001     Hammer     NULL     NULL
    1001     Test Jobplan     USA     NULL     NULL     NULL     NULL     NULL     NULL     1001     1
    1001     Test Jobplan     USA     NULL     NULL     NULL     NULL     NULL     NULL     1001     2
    1001     Test Jobplan     USA     NULL     NULL     NULL     NULL     NULL     NULL     1001     3
    Please help me out with this issue.
    Thanks,
    Siva
    Edited by: 931144 on Apr 30, 2012 11:35 AM

    Hope below helps you
    CREATE TABLE JOBPLAN
    ( JPNUM NUMBER,
      DESCRIPTION VARCHAR2(100)
    INSERT INTO JOBPLAN VALUES(1001,'Test Jobplan');
    CREATE TABLE JOBTASK
    ( LOCATION VARCHAR2(10),
      JT_JPNUM NUMBER,
      JT_TASK  NUMBER
    INSERT INTO JOBTASK VALUES('USA',1001,10);
    INSERT INTO JOBTASK VALUES('USA',1001,20);
    INSERT INTO JOBTASK VALUES('USA',1001,30);
    INSERT INTO JOBTASK VALUES('USA',1001,40);
    INSERT INTO JOBTASK VALUES('USA',1001,50);
    CREATE TABLE JOBLABOR
    ( JL_JPNUM NUMBER,
      JL_LABOR VARCHAR2(10)
    INSERT INTO JOBLABOR VALUES(1001,'Sam');
    INSERT INTO JOBLABOR VALUES(1001,'Mike');
    CREATE TABLE JOBMATERIAL
    ( JM_JPNUM    NUMBER,
      JM_MATERIAL VARCHAR2(10)
    INSERT INTO JOBMATERIAL VALUES(1001,'Hammer');
    CREATE TABLE JOBSEQUENCE
    ( JS_JPNUM    NUMBER,
      JS_SEQUENCE NUMBER
    INSERT INTO JOBSEQUENCE VALUES(1001,1);
    INSERT INTO JOBSEQUENCE VALUES(1001,2);
    INSERT INTO JOBSEQUENCE VALUES(1001,3);
    SELECT   JP.JPNUM        AS JPNUM       ,
             JP.DESCRIPTION  AS DESCRIPTION ,
             NULL            AS LOCATION    ,
             NULL            AS JT_JPNUM    ,
             NULL            AS JT_TASK     ,
             NULL            AS JL_JPNUM    ,
             NULL            AS JL_labor    ,
             NULL            AS JM_JPNUM    ,
             NULL            AS JM_MATERIAL ,
             NULL            AS JS_JPNUM    ,
             NULL            AS JS_SEQUENCE
    FROM JOBPLAN JP
    UNION ALL
    SELECT   JP.JPNUM        AS JPNUM       ,
             JP.DESCRIPTION  AS DESCRIPTION ,
             JT.LOCATION     AS LOCATION    ,
             JT.JT_JPNUM     AS JT_JPNUM    ,
             JT.JT_TASK      AS JT_TASK     ,
             NULL            AS JL_JPNUM    ,
             NULL            AS JL_labor    ,
             NULL            AS JM_JPNUM    ,
             NULL            AS JM_MATERIAL ,
             NULL            AS JS_JPNUM    ,
             NULL            AS JS_SEQUENCE
    FROM JOBPLAN JP, JOBTASK JT
    UNION ALL
    SELECT   JP.JPNUM        AS JPNUM       ,
             JP.DESCRIPTION  AS DESCRIPTION ,
             NULL            AS LOCATION    ,
             NULL            AS JT_JPNUM    ,
             NULL            AS JT_TASK     ,
             JL.JL_JPNUM     AS JL_JPNUM    ,
             JL.JL_labor     AS JL_labor    ,
             NULL            AS JM_JPNUM    ,
             NULL            AS JM_MATERIAL ,
             NULL            AS JS_JPNUM    ,
             NULL            AS JS_SEQUENCE
    FROM JOBPLAN JP, JOBLABOR JL
    UNION ALL
    SELECT   JP.JPNUM        AS JPNUM       ,
             JP.DESCRIPTION  AS DESCRIPTION ,
             NULL            AS LOCATION    ,
             NULL            AS JT_JPNUM    ,
             NULL            AS JT_TASK     ,
             NULL            AS JL_JPNUM    ,
             NULL            AS JL_labor    ,
             JM.JM_JPNUM     AS JM_JPNUM    ,
             JM.JM_MATERIAL  AS JM_MATERIAL ,
             NULL            AS JS_JPNUM    ,
             NULL            AS JS_SEQUENCE
    FROM JOBPLAN JP, JOBMATERIAL JM
    UNION ALL
    SELECT   JP.JPNUM        AS JPNUM       ,
             JP.DESCRIPTION  AS DESCRIPTION ,
             NULL            AS LOCATION    ,
             NULL            AS JT_JPNUM    ,
             NULL            AS JT_TASK     ,
             NULL            AS JL_JPNUM    ,
             NULL            AS JL_labor    ,
             NULL            AS JM_JPNUM    ,
             NULL            AS JM_MATERIAL ,
             JS.JS_JPNUM     AS JS_JPNUM    ,
             JS.JS_SEQUENCE  AS JS_SEQUENCE
    FROM JOBPLAN JP, JOBSEQUENCE JS;
         JPNUM DESCRIPTION     LOCATION      JT_JPNUM    JT_TASK   JL_JPNUM JL_LABOR     JM_JPNUM JM_MATERIA   JS_JPNUM JS_SEQUENCE
          1001 Test Jobplan    NULL       NULL        NULL       NULL       NULL       NULL       NULL    NULL          NULL
          1001 Test Jobplan    USA        1001        10         NULL       NULL       NULL       NULL    NULL          NULL
          1001 Test Jobplan    USA        1001        20         NULL       NULL       NULL       NULL    NULL          NULL
          1001 Test Jobplan    USA        1001        30         NULL       NULL       NULL       NULL    NULL          NULL
          1001 Test Jobplan    USA        1001        40         NULL       NULL       NULL       NULL    NULL          NULL
          1001 Test Jobplan    USA        1001        50         NULL       NULL       NULL       NULL    NULL          NULL
          1001 Test Jobplan    NULL       NULL        NULL       1001       Sam        NULL       NULL    NULL          NULL
          1001 Test Jobplan    NULL       NULL        NULL       1001       Mike       NULL       NULL    NULL          NULL
          1001 Test Jobplan    NULL       NULL        NULL       NULL       NULL       1001       Hammer  NULL          NULL
          1001 Test Jobplan    NULL       NULL        NULL       NULL       NULL       NULL       NULL    1001          1
          1001 Test Jobplan    NULL       NULL        NULL       NULL       NULL       NULL       NULL    1001          2
          1001 Test Jobplan    NULL       NULL        NULL       NULL       NULL       NULL       NULL    1001          3
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to Select Data from different Tables Using Linq

    Hi,
    I have two different tables, I just want to collect data from tables using Linq to SQL Queries.
    The tables looks like This 
    ID Name ImageUrl 
    Other Table is
    ID EmpID CheckInTime CheckOutTime 
    What I want to Collect data from CheckInTime and want to place it in a that is in a list view
    Same thing I want to do it for CheckOutTime And One thing I want to tell is both tables are joined by a FK EmpID with ID.
    What Are the suggestions for me 
    I have Used this code
    var data = from emp in db.Employees
    join chk in db.CheckInCheckOuts on emp.ID equals chk.EmpID
    select new EmployeeCheckInOut
    Name = emp.Name,
    ImageUrl = emp.ImageUrl,
    CheckIn = emp.CheckInCheckOuts,
    CheckOut = emp.CheckInCheckOuts
    Here the CheckInCheckOuts is another table, I don't how do I access fields of the Other table "CheckInCheckOuts"
    Thank you
    Ali

    Mitja,
    Kind of Tables, I don't Know but I can Tell you that these are Two table, first Table Have Data in It, Name, ImageUrl I have filled this table with names and ImageUrls And are string type.Other Table is for the CheckInTime And CheckOutTime of the employee.
    What I need that when I click on the Image button it Should displays The Current Datetime into the label below the Image button.
    So I have Problem accessing my CheckInCheckOut Table because I may not have Idea about.Did you understand what I need to do, if you have more question please ask to me.
    Thanks
    Ali

  • Is it possible to use a case statement when joining different tables based on input parameters?

    Hi,
    I have a scenario where my stored procedure takes 5 parameters and the users can pass NULL or some value to these parameters and based on the parameters, I need to pull data from various tables.
    Is it possible to use a case statement in the join, similar the one in the below example. I'm getting error when I use the below type of statement.
    select a.*
    from a
    case
    when parameter1=1 then
    inner join a on a.id = b.id
    when parameter1=2 then
    inner join a on a.id = c.id
    end;
    Please let me know, if this type of statement works, and if it works will it create any performance issues?. If the above doesn't work, could you please give me some alternate solutions?
    Thanks.

    Here's a technique for joining A to B or C depending on the input parameters. In theory, you are joining to both tables but the execution plan includes filters to skip whichever join is not appropriate. The drawback is that you have to do outer joins, not inner ones.
    CREATE TABLE A AS SELECT LEVEL ak FROM dual CONNECT BY LEVEL <= 100;
    CREATE TABLE b AS SELECT ak, bk
    FROM A, (SELECT LEVEL bk FROM dual CONNECT BY LEVEL <= 10);
    CREATE TABLE c(ak, ck) AS SELECT ak, bk*10 FROM b;
    variable p1 NUMBER;
    variable p2 NUMBER;
    exec :p1 := 1;
    exec :p2 := 20;
    SELECT /*+ gather_plan_statistics */ A.ak, nvl(b.bk, c.ck) otherk FROM A
    LEFT JOIN b ON A.ak = b.ak AND :p1 IS NOT NULL AND b.bk = :p1
    LEFT JOIN c ON A.ak = c.ak AND :p1 is null and :p2 IS NOT NULL and c.ck = :p2
    WHERE A.ak <= 9;
    SELECT * FROM TABLE(dbms_xplan.display_cursor(NULL,NULL,'IOSTATS LAST'));
    | Id  | Operation             | Name            | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
    |   0 | SELECT STATEMENT      |                 |      1 |        |      9 |00:00:00.01 |       7 |
    |*  1 |  HASH JOIN OUTER      |                 |      1 |      9 |      9 |00:00:00.01 |       7 |
    |*  2 |   HASH JOIN OUTER     |                 |      1 |      9 |      9 |00:00:00.01 |       7 |
    |*  3 |    TABLE ACCESS FULL  | A               |      1 |      9 |      9 |00:00:00.01 |       3 |
    |   4 |    VIEW               | VW_DCL_5532A50F |      1 |      9 |      9 |00:00:00.01 |       4 |
    |*  5 |     FILTER            |                 |      1 |        |      9 |00:00:00.01 |       4 |
    |*  6 |      TABLE ACCESS FULL| B               |      1 |      9 |      9 |00:00:00.01 |       4 |
    |   7 |   VIEW                | VW_DCL_5532A50F |      1 |      9 |      0 |00:00:00.01 |       0 |
    |*  8 |    FILTER             |                 |      1 |        |      0 |00:00:00.01 |       0 |
    |*  9 |     TABLE ACCESS FULL | C               |      0 |      9 |      0 |00:00:00.01 |       0 |
    Predicate Information (identified by operation id):
       1 - access("A"."AK"="ITEM_0")
       2 - access("A"."AK"="ITEM_1")
       3 - filter("A"."AK"<=9)
      5 - filter(:P1 IS NOT NULL)
       6 - filter(("B"."AK"<=9 AND "B"."BK"=:P1))
       8 - filter((:P2 IS NOT NULL AND :P1 IS NULL))
       9 - filter(("C"."AK"<=9 AND "C"."CK"=:P2))
    You can see that table C was not really accessed: the buffer count is 0.
    exec :p1 := NULL;
    SELECT /*+ gather_plan_statistics */ A.ak, nvl(b.bk, c.ck) otherk FROM A
    LEFT JOIN b ON A.ak = b.ak AND :p1 IS NOT NULL AND b.bk = :p1
    LEFT JOIN c ON A.ak = c.ak AND :p1 is null and :p2 IS NOT NULL and c.ck = :p2
    WHERE A.ak <= 9;
    SELECT * FROM TABLE(dbms_xplan.display_cursor(NULL,NULL,'IOSTATS LAST'));
    Now table B is not accessed.
    | Id  | Operation             | Name            | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
    |   0 | SELECT STATEMENT      |                 |      1 |        |      9 |00:00:00.02 |       7 |      2 |
    |*  1 |  HASH JOIN OUTER      |                 |      1 |      9 |      9 |00:00:00.02 |       7 |      2 |
    |*  2 |   HASH JOIN OUTER     |                 |      1 |      9 |      9 |00:00:00.01 |       3 |      0 |
    |*  3 |    TABLE ACCESS FULL  | A               |      1 |      9 |      9 |00:00:00.01 |       3 |      0 |
    |   4 |    VIEW               | VW_DCL_5532A50F |      1 |      9 |      0 |00:00:00.01 |       0 |      0 |
    |*  5 |     FILTER            |                 |      1 |        |      0 |00:00:00.01 |       0 |      0 |
    |*  6 |      TABLE ACCESS FULL| B               |      0 |      9 |      0 |00:00:00.01 |       0 |      0 |
    |   7 |   VIEW                | VW_DCL_5532A50F |      1 |      9 |      9 |00:00:00.01 |       4 |      2 |
    |*  8 |    FILTER             |                 |      1 |        |      9 |00:00:00.01 |       4 |      2 |
    |*  9 |     TABLE ACCESS FULL | C               |      1 |      9 |      9 |00:00:00.01 |       4 |      2 |

Maybe you are looking for

  • Flash pro cs5.5 won't start

    Last time I worked with flash was January 23, 2012. It was working fine, but this morning I tried running the program and it won't start. Same with encore, it just doesn't start. Is this due to a windows update? Does anybody know of a workaround to t

  • Rest In Peace Flash Catalyst

    I just heard the news and I can't believe it!  I don't know what we're gonna do! We are designers and visualists, not developers. Although we are not formally trained in interactive design, from time to time we get jobs that require us to flesh out l

  • Enhancement for MIGO when SAVE with any of these tables afru,aufk,jest,tj02

    Enhancements/BADI's for MIGO Transaction When SAVE. Tables: afru,aufk,jest,tj02t,afpo, eban,qave,qals. can anyone pls suggest Enhancements/Exits/BADI's for MIGO transaction where i can use any of the above tables . i found mb_migo_badi, i dont think

  • Toc Links randomly not working

    Robohelp HTML 9.0.2.271 Word 2010 - documents hosted on SharePoint 2007 Windows 7 OS Published in a merged Help project Each time i generate a project one or more of the toc links do not expand when clicked. The links which dont work change randomly.

  • External Apple logo shows through to display

    I just returned to my iBook after 5 minutes (the time I have set to have the display turn off) to find that there is the vague outline of the Apple logo (the illuminated one on the outside over of the iBook) showing through to the display. It is a fu