Rules for joining tables in SQVI

Hi all,
I'm new to this community and this is my first time when i post on this forum. Hope I didn't post or did anything to bad.
I just want to know how can I know which tables should I join. I'm trying to create a report that shows me all the open items from a GL account (Construction In Progress) and have beside the AUC the AUC description, order, PO, Vendor, vendor name, plant, material (at least).
I tried to join BSIS and ANLA for starters, but anything I select it just gives me the same error "No data was selected" Is there any rule like only the key should be selected as selection fields, anything that you could advise would be a blessing.
Thank you
Edited by: Viorel_Petre on Jan 18, 2011 10:52 AM

Hi,
Welcome to SDN!!!
Since you are new to SAP.
you should ask the functional consultant to provide you with the names of the tables and fields.
the transaction SQVI is used to create queries and you can also use it to know relation bewetween tables for appplying join conditions.
for join conditions.
1. create  VIEW.
2. Choose data source as table join.
3. insert 2 tables so see the realation between them.
search google/SDN for more information.

Similar Messages

  • How do you handle update and delete rules for fact tables?

    I have a fact table with a composite key of 5 columns. Two of the columns are FKs to the date dimension. I was setting the delete/update rules for the FK relationship in SSMS and it had a problem with me creating cascade action on the FKs that connected
    to the date dimension.
    What is the proper way to set up FK relationships in fact tables with SSMS when  you have composite keys as most fact tables do?

    Yeah I understand all that. What I'm trying to do is to protect my database from RI violations that occur by production support people blowing away stuff in a dimension table but forgetting to blow away related records in the fact table. I want those fact
    records deleted automatically so we don't have orphan records which was a real issue at a previous engagement. Production support is usually just people that know SQL and some relational modeling. It's not too likely they will understand the details of dimensional
    modeling enough such that they would know that they had to blow away the fact record first.
    My problem is I have a FK to a role playing dimension (the date dimension in this case). So basically I have to columns in the fact table that have a FK relationship to the PK of the date dimension. When I create both relationships SSMS and try to have both
    of them cascade delete SSMS has an issue with it.
    The error I get is:
    Unable to create relationship '[relationship name]'
    Introducing Foreign Key constraint '[constraint name]' on table '[table name]' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other foreign key constraints.
    I can go ahead and put no action and the table will save fine. The question now becomes how does the cascade delete actually work. Can I just set one part of the key to cascade delete?
    Actually I just realized that this is an even bigger design issue. What DOES happen to a fact record when one of it's dimensions gets deleted and I've got full RI set up on the table?
    Or am I totally thinking about this wrong. Do you set up cascade deletes in a dimensional model? Is there a way to prevent deletes from the dimension table if there are related fact records?

  • Sql statement for join tables

    hi there..i need ur helps
    Here are my tables n column name for each tables
    a) rep_arrngt
    Name
    REP_ARRNGT_ID
    REP_ARRNGT_DESC
    REP_ARRNGT_TYPE
    ACCT_CAT
    DEF_INDUSTRY_CODE
    MEDIA_ID
    LANGUAGE_ID
    CURRENCY
    PAGE_ID
    b) bci_rep_arrng
    Name
    REP_ARRNGT_ID
    BCI
    SUB_SUM_CODE
    DP_SUB_SUM_CODE
    c) acct_rep_arrngt_link
    Name
    ACCT_NO
    REP_ARRNGT_ID
    DOC_TYPE
    LAST_BILL_DATE
    BILL_FREQUENCY
    SCALING
    EFF_FROM_DATE
    EFF_TO_DATE
    MEDIA_ID
    Actually, i want to get the unique value for sub_sum_code according to the bci..
    i already use join tables n here is my sql statement :
    SELECT T1.SUB_SUM_CODE,T1.BCI,T1.REP_ARRNGT_ID,T2.REP_ARRNGT_ID,T3.REP_ARRNGT_ID FROM BCI_REP_ARRNG T1, REP_ARRNGT T2, ACCT_REP_ARRNGT_LINK T3 WHERE T1.REP_ARRNGT_ID=T2.REP_ARRNGT_ID AND T2.REP_ARRNGT_ID=T3.REP_ARRNGT_ID AND BCI='TTA00F06'
    n my results is :
    SUB_SUM_CODE BCI REP_ARRNGT_ID
    TBGSR TTA00F06 R1
    TBGSR TTA00F06 R1
    TBGSR TTA00F06 R1
    TBGSR TTA00F06 R1
    I get the repeated results for sub_sum_code..
    so, what i need to do if i want only 1 row results like this :
    [u]SUB_SUM_CODE BCI REP_ARRNGT_ID
    TBGSR TTA00F06 R1
    i try to use group by, but i get the error..plz help me

    If you only want "to get the unique value for sub_sum_code according to the bci" then why are you joining the tables in the first place? Not knowing PKs etc you could just use DISTINCT in your select statement.
    SELECT DISTINCT T1.SUB_SUM_CODE,
                    T1.BCI
    FROM BCI_REP_ARRNG T1
    AND BCI='TTA00F06'

  • Get double return for join table

    Dear Experts:
    SELECT eban~banfn      "PR number
             eban~bnfpo      "PR item
             eban~bsart      "Doc Type
             eban~bednr      "Requistion tracking number
             eban~ebeln
             eban~ebelp
             eban~zzloc      "GEO code
             ztmm_ccp~zzclli "zzclli code
      INTO CORRESPONDING FIELDS OF TABLE gi_pr_extract
      FROM  ( eban
             INNER JOIN ztmm_ccp
                    ON  eban~bednr = ztmm_ccp~bednr
                   AND  eban~ebeln = ztmm_ccp~ebeln
                   AND  eban~ebelp = ztmm_ccp~ebelp )
      WHERE eban~bsart IN s_bsart.  "11 input doc type
    The s_bsart are:
    NB
    UB
    ZNB
    ZSC
    ZUC
    ZVC
    ZXC
    ZZO
    ZZX
    ZZY
    ZZZ
    From above SQL, I got double returen for each  ebanbanfn  and ebanbnfpo
    Row     BANFN     BNFPO     BSART     BEDNR     ZZLOC     ZZCLLI
    1      3100000056     00010     NB               
    2      3100000056     00010     NB               CLLICD DRTP
    3      3100000057     00010     NB               
    4      3100000057     00010     NB               CLLICD DRTP
    5      3100000058     00010     NB               
    6      3100000058     00010     NB               CLLICD DRTP
    7      3100000061     00010     NB               
    8      3100000061     00010     NB               CLLICD DRTP
    9      3100000062     00010     NB               
    10      3100000062     00010     NB               CLLICD DRTP
    Do you know why and how do I get the unique one?
    Thank you very much!
    Helen
    Edited by: Thomas Zloch on Oct 4, 2010 3:49 PM - please use code tags

    Hi Helen,
    Please check with the below code snippet. Hope it will work.
    SELECT eban~banfn     
              eban~bnfpo    
              eban~bsart     
              eban~bednr    
              eban~ebeln
              eban~ebelp
              eban~zzloc     
              ztmm_ccp~zzclli
       INTO CORRESPONDING FIELDS OF TABLE gi_pr_extract
       FROM  eban
              INNER JOIN ztmm_ccp
                      ON    ztmm_ccp~bednr = eban~bednr
                    AND  ztmm_ccp~ebeln = eban~ebeln
                    AND  ztmm_ccp~ebelp = eban~ebelp
       WHERE eban~bsart IN s_bsart.
    Thanks
    Nitesh

  • Tablespace design for joined tables

    Hello altogether,
    Right now I'm designing the database structure for an application requiring high performance on database side.
    While thinking about the tablespace structure I came to the following question:
    When I am sure that I will have a join on two (or more) tables very often, is it better to put them in one tablespace, or is it better to put them into different tablespaces?
    Thanks for your help!
    Daniel

    The tablespace that any particular object is in is irrelevant from a performance standpoint (assuming the tablespace parameters are identical, of course. An object in a dictionary managed tablespace may well have different performance characteristics than an object in a locally managed tablespace using ASSM). Now, if different tablespaces have data files on different physical devices, you may see some performance gains from putting different objects into different tablespaces simply because this would tend to distribute I/O over more physical devices. Of course, you could accomplish the same thing by creating data files on different devices in the same tablespace. And with newer disk subsystems, this sort of manual load balancing tends to be rather pointless.
    If you have locally attached storage and you want to distribute I/O across devices by putting objects in different tablespaces rather than assigning multiple data files to the same tablespace, it generally isn't going to matter much which objects are in which tablespace so long as the I/O is relatively evenly distributed (and assuming that there aren't any I/O patterns that need to be accounted for (i.e. if object A is used heavily during the day and object B is used heavily at night and those are the only two objects in the database, putting them in different tablespaces is pointless because you'd never be using the extra spindles simultaneously). You'd have just as much luck putting objects that start with the letters A-L in one tablespace and M-Z in another as putting tables and indexes in different tablespaces or putting related objects in the same tablespace or putting related objects in different tablespaces. So long as I/O gets distributed, it doesn't matter which objects are where.
    Personally, I'd never have separate tablespaces for performance. Much easier to have a single tablespace with multiple data files on different devices. Multiple tablespaces should exist for managability reasons, recoverability reasons, and because different objects require different tablespace settings.
    Justin

  • Create Keys for joining tables

    Can I create a data element for a given table that can be used as a joining utility data item for extracting data from two or more tables?
    I have a business area with tables that are basically non-relational because of the absence of data elements that are of common name or meaning.

    Hi,
    it will be better if we can have the table structure, depending upon what information we have and there is no join condition between different table you could try with UNION.
    --untested
    CREATE VIEW VW_TEST AS
    select SERIAL_NUMBER , TABLE_NAME FROM table1
    UNION ALL
    select SERIAL_NUMBER , TABLE_NAME
    UNION ALL
    select SERIAL_NUMBER , TABLE_NAME
    thanks

  • SQL for join table  problem?

    hi morning,
    my problem also haven find out the solution,can help me solve.
    I got one part of register student to exam,during that part is like that.
    Student Code:________(table3)
    Exam Code:_________(table 3)
    Student Name:________(table 1)
    Exam Name:_________(table 2)
    I can write code call table 3 but when three table join together in part 3,got problem is come out alry....The problem is inside the Student Name & Exam Name.When i use the button for NEXTRECORD to check record,cannot call the student Name & exam Name.
    Thank for help. Because i use sql code to call table 3 to check table1 and table 2 detail ,then retrive that data.
    my code is like that,
    private void cmd_NexRec_RSEActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    int i;
    i=0;
    try{
    String x1,x2;
    x1=(jTextField10.getText()).trim();
    x2=(jTextField11.getText()).trim();
    if (x1.equals("")&& x2.equals("") )
    counter.studentExam="R";
    counter.registerStudentExam="N";
    i++;
    jInternalFrame8.setVisible(false);
    Connection con = getConnection2();
    Statement s = con.createStatement (ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
    ResultSet rs=getStudentExams();
    ResultSet rs1=getCodes();
    ResultSet rs2=getExams();
    String select="select * from studentExamFile a LEFT JOIN {studentData b} ON a.student_code=b.student_code LEFT JOIN {exam c} ON c.exam_code=a.exam_code where student_code='"+ x1 +"' and exam_code='"+ x2 +"'" ;
    // String select ="select * from studentExamFile , exam , studentData where studentExamFile.student_code=studentData.student_code and exam.exam_code=studentExamFile.exam_code ";
    // rs = s.executeQuery(select);
    rs.next();
    StudentExam c=getstudentcode(rs);
    Code c1=getCode(rs1);
    Examcode c2=getexamcode(rs2);
    jTextField12.setText(c.studentcode);
    jTextField13.setText(c.examcode);
    jTextField14.setText(rs.getString("c1.name"));
    jTextField15.setText(rs.getString("c2.ename"));
    // jTextField14.setText(c1.name);
    // jTextField14.setText(c2.ename);
    jLabel16.setText("Record: Review");
    jInternalFrame10.setVisible(true);
    jTextField12.setEnabled(false);
    jTextField13.setEnabled(false);
    //New Line
    jTextField14.requestFocus();
    else
    Connection con = getConnection2();
    Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
    String w=(jTextField10.getText()).trim();
    String w2=(jTextField11.getText()).trim();
    //String select= "select * from [studentExamFile] where [student_code]>'" w "'";
    // String select1="select * from [studentExamFile] where [exam_code]>'" w2 "'";
    String select="select * from studentExamFile a LEFT JOIN {studentData b} ON a.student_code=b.student_code LEFT JOIN {exam c} ON c.exam_code=a.exam_code where student_code='"+ x1 +"' and exam_code='"+ x2 +"'" ;
    ResultSet rs;
    rs = s.executeQuery(select);
    // rs = s.executeQuery(select1);
    rs.next();
    if(rs.isFirst())
    counter.registerStudentExam="N";
    jInternalFrame8.setVisible(false);
    jTextField12.setText(rs.getString(1));
    jTextField13.setText(rs.getString(2));
    jLabel16.setText("Record: Review");
    jInternalFrame10.setVisible(true);
    jTextField12.setEnabled(false);
    jTextField13.setEnabled(false);
    //New Line
    jTextField14.requestFocus();
    counter.studentExam="R";
    else
    JOptionPane.showMessageDialog(this,"End of the file ","Infomation",JOptionPane.INFORMATION_MESSAGE);
    }catch(SQLException e)
    System.out.println("Error");
    //jTextField3.requestFocus();
    }

    thanks for reply.
    i think my problem is in connection to database .
    String sql="select studentData.student_name, exam.exam_name from studentData,exam,studentExamFile where studentData.student_code=studentExamFile.student_code and exam.exam_code=studentExamFile.exam_code ";
                    // String sql="select studentData.student_name , exam.exam_name from studentExamFile  LEFT JOIN { studentData }  ON studentExamFile.student_code=studentData.student_code LEFT JOIN { exam }  ON exam.exam_code=studentExamFile.exam_code ";
                     Connection con = getConnection();
                     Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
                     Connection con2 = getConnection();
                     Statement s3 = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
                     System.out.println("error");//my problem inside here....help me
                     rs3=s.executeQuery(sql);
                     rs3=s3.executeQuery(sql);
                     rs3.next();
                     String s1,s2;
                     s1=rs3.getString(1);//maybe me dunno how to convert the sql data...
                     s2=rs3.getString(2);
                     rs.next();
                     rs2.next();
                    // rs3.next();
                     Code c=getCode(rs);
                     Examcode c2=getexamcode(rs2);
                     StudentExam c3=getstudentcode(rs3);
                     jTextField12.setText(c3.studentcode);
                     jTextField13.setText(c3.examcode);
                    // jTextField14.setText(rs.getString("c.name")); 
                     //jTextField15.setText(rs.getString("c2.ename"));
                     jTextField14.setText(s1); 
                     jTextField15.setText(s2);
                     jLabel16.setText("Record: Review");
                     jInternalFrame10.setVisible(true);
                     jTextField12.setEnabled(false);
                     //New Line
                     jTextField14.requestFocus();                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • SQL query for join table and multiple values

    Trying to join two tables , Emphours and EmpStatus to get
    result which gives each emplyees hour 
    worked each day
    in past  say 1 year in what status. I need result similar to table 3 , Hours Can also be grouped per week
    all I need Is Each employees hours in each week and his status and position at that time if possible
    any help will be highly appreciated. Thank you 
    note: payday is every other Friday- week runs from Saturday through Friday
    EmpStatus Table tracks when employees status changed
    EmpHours
    employee
    workday
    payday
    hours
    position
    101
    1/1/2014
    1/3/2014
    8
    assistant
    101
    1/3/2014
    1/3/2014
    8
    assistant
    101
    1/4/2014
    1/17/2014
    8
    assistant
    101
    1/5/2014
    1/17/2014
    8
    assistant
    101
    1/7/2014
    1/17/2014
    8
    assistant
    101
    1/8/2014
    1/17/2014
    8
    assistant
    101
    1/9/2014
    1/17/2014
    8
    assistant
    101
    1/11/2014
    1/17/2014
    8
    assistant
    101
    1/13/2014
    1/17/2014
    8
    assistant
    101
    1/14/2014
    1/17/2014
    8
    assistant
    101
    1/18/2014
    2/14/2014
    8
    assistant
    102
    1/1/2014
    1/3/2014
    7
    manager
    102
    1/25/2014
    1/31/2014
    7
    manager
    102
    1/26/2014
    1/31/2014
    7
    manager
    102
    1/28/2014
    1/31/2014
    7
    manager
    102
    1/31/2014
    1/31/2014
    7
    manager
    103
    1/1/2014
    1/3/2014
    5
    intern
    103
    1/31/2014
    1/31/2014
    6
    intern
    104
    1/14/2014
    1/17/2014
    5
    supervisor
    104
    1/30/2014
    1/31/2014
    6
    supervisor
    EmpStatus
    employee
    start_date
    status
    101
    1/1/2014
    parttime
    101
    1/18/2014
    fulltime
    102
    1/1/2014
    seasonal
    102
    1/18/2014
    fulltime
    103
    1/1/2014
    partime
    103
    1/18/2014
    fulltime
    104
    1/4/2014
    parttime
    104
    1/18/2014
    fulltime
    Table 3
    employee
    status
    hours
    position
    workday
    weekend
    payday
    101
    parttime
    8
    assistant
    1/1/2014
    1/3/2014
    1/3/2014
    101
    parttime
    8
    assistant
    1/3/2014
    1/3/2014
    1/3/2014
    101
    parttime
    8
    assistant
    1/4/2014
    1/10/2014
    1/17/2014
    101
    parttime
    8
    assistant
    1/5/2014
    1/10/2014
    1/17/2014
    101
    parttime
    8
    assistant
    1/7/2014
    1/10/2014
    1/17/2014
    101
    parttime
    8
    assistant
    1/8/2014
    1/10/2014
    1/17/2014
    101
    parttime
    8
    assistant
    1/9/2014
    1/10/2014
    1/17/2014
    101
    parttime
    8
    assistant
    1/11/2014
    1/17/2014
    1/17/2014
    101
    parttime
    8
    assistant
    1/13/2014
    1/17/2014
    1/17/2014
    101
    parttime
    8
    assistant
    1/14/2014
    1/17/2014
    1/17/2014
    101
    fulltime
    8
    assistant
    1/18/2014
    1/24/2014
    2/14/2014
    102
    seasonal
    7
    manager
    1/1/2014
    1/3/2014
    1/3/2014
    102
    fulltime
    7
    manager
    1/25/2014
    1/25/2014
    2/14/2014
    102
    fulltime
    7
    manager
    1/26/2014
    1/26/2014
    2/14/2014
    102
    fulltime
    7
    manager
    1/28/2014
    1/28/2014
    2/14/2014
    102
    fulltime
    7
    manager
    1/31/2014
    1/31/2014
    2/14/2014
    103
    parttime
    5
    intern
    1/1/2014
    1/3/2014
    1/3/2014
    103
    fulltime
    6
    intern
    1/31/2014
    1/31/2014
    2/14/2014
    104
    parttime
    5
    supervisor
    1/14/2014
    1/17/2014
    1/17/2014
    104
    fulltime
    6
    supervisor
    1/30/2014
    1/31/2014
    1/31/2014

    Hello David,
    Try this query
    set dateformat mdy;
    declare @EmpHours table
    (Employee int,workday date,payday date,hours int,position varchar(50));
    insert into @EmpHours values
    (101,'1/1/2014','1/3/2014',8,'assistant'),
    (101,'1/3/2014','1/3/2014',8,'assistant'),
    (101,'1/4/2014','1/17/2014',8,'assistant'),
    (101,'1/5/2014','1/17/2014',8,'assistant'),
    (101,'1/7/2014','1/17/2014',8,'assistant'),
    (101,'1/8/2014','1/17/2014',8,'assistant'),
    (101,'1/9/2014','1/17/2014',8,'assistant'),
    (101,'1/11/2014','1/17/2014',8,'assistant'),
    (101,'1/13/2014','1/17/2014',8,'assistant'),
    (101,'1/14/2014','1/17/2014',8,'assistant'),
    (101,'1/18/2014','2/14/2014',8,'assistant'),
    (102,'1/1/2014','1/3/2014',7,'manager'),
    (102,'1/25/2014','1/31/2014',7,'manager'),
    (102,'1/26/2014','1/31/2014',7,'manager'),
    (102,'1/28/2014','1/31/2014',7,'manager'),
    (102,'1/31/2014','1/31/2014',7,'manager'),
    (103,'1/1/2014','1/3/2014',5,'intern'),
    (103,'1/31/2014','1/31/2014',6,'intern'),
    (104,'1/14/2014','1/17/2014',5,'supervisor'),
    (104,'1/30/2014','1/31/2014',6,'supervisor');
    --select * from @EmpHours
    declare @EmpStatus table
    (employee int,start_date date,status varchar(20));
    insert into @EmpStatus values
    (101,'1/1/2014','parttime'),
    (101,'1/18/2014','fulltime'),
    (102,'1/1/2014','seasonal'),
    (102,'1/18/2014','fulltime'),
    (103,'1/1/2014','partime'),
    (103,'1/18/2014','fulltime'),
    (104,'1/4/2014','parttime'),
    (104,'1/18/2014','fulltime');
    WITH C AS
    SELECT es.employee,es.start_date, es.status, ROW_NUMBER() OVER(partition by employee ORDER BY start_date) AS rownum
    FROM @EmpStatus ES
    CTE_RANGES as(
    SELECT cur.employee,Cur.start_date start_range, cur.status,case when nxt.start_date is null then '2099-12-31' else dateadd(d,-1,Nxt.start_date) end AS end_range
    FROM C AS Cur
    left JOIN C AS Nxt
    ON Nxt.rownum = Cur.rownum + 1 and cur.employee=nxt.employee)
    select eh.*,es.status from @EmpHours EH join CTE_RANGES Es on EH.Employee =es.employee and EH.workday between es.start_range and es.end_range
    --where es.employee=101
    You will need a calender table too which can be joined to the output of the above query to get the weekend dates.
    You can find the T-SQL code to generate the calender here
    http://stackoverflow.com/questions/19191577/t-sql-function-to-generate-calendar-table
    and posting the questions with necessary DDL , DML (like I have posted) would help us a lot. 
    Satheesh
    My Blog

  • Oracle Stored Procedure's TYPE IS RECORD for join table columns

    Hi there,
    I'm trying to use the type is record to setup all my output columns; However, these columns are joined from 2 or more tables. i.e.,
    TYPE my_rec IS RECORD (
    myColumn1 varchar2(50),
    myColumn2 varchar2(20)
    where myColumn1 is slected from a join of table1 and table2, and myColumn2 is selected from a join of table2 and table3.
    as I tried to exec mySP, I got the error:
    wrong number or types of arguments in call to 'mySP'
    I know it is not "wrong number of arguments", but I don't know why these columns are wrong types? though I had TO_CHAR the new myColumn1 and myColumn2, I'm wondering if I should use %TYPE instead. If so, how do I do?
    Meanwhile, I think it may help if I post the code here:
    ===========================================
    create or replace package PHAStatusRpt is
    type pha_type is record(
    name varchar2(50),
    pha_start varchar2(12),
    current_step varchar2(50),
    dates varchar2(25),
    last_status varchar2(20)
    pha_rec pha_type;
    procedure PHAStatusData(ret_parm OUT pha_type);
    end PHAStatusRpt;
    create or replace package body PHAStatusRpt is
    procedure PHAStatusData(ret_parm OUT pha_type) is
    BEGIN
    SELECT name,
    TO_CHAR(DECODE(NVL(current_pha_step_name,'~'),'~',last_pha_date,current_pha_start),'mm/dd/yyyy') pha_start,
    DECODE(NVL(current_pha_step_name,'~'),'~','Complete',current_pha_step_name) current_step,
    DECODE(NVL(current_pha_step_name,'~'),'~',TO_CHAR(last_pha_date,'mm/dd/yyyy'),pp_date) dates,
    DECODE(NVL(current_pha_step_name,'~'),'~',null,last_pha_status) last_status
    INTO pha_rec
    FROM (SELECT pfeed_name||' ('||TO_CHAR(pfeed_dob,'mm/dd/yyyy')||')' ||'('||SUBSTR(pers_ssn,5,4)||')' name,
    current_pha_start,
    current_pha_step_name,
    last_pha_date,
    last_pha_status,
    TO_CHAR(pp.start_date,'mm/dd/yyyy')||'-'||NVL(TO_CHAR(pp.end_date,'mm/dd/yyyy'),'n/a') pp_date
    FROM v_pers_unit pu, personnel_readiness pr, person_processes pp
    WHERE pu.pers_pers_id=pr.pers_id AND pr.current_pha_step_pp_id=pp.pp_id(+) AND cmdstr_cs_id=95990)
    ORDER BY name;
    end PHAStatusData;
    end PHAStatusRpt;
    SQL> exec phastatusrpt.phastatusdata
    BEGIN phastatusrpt.phastatusdata; END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PHASTATUSDATA'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ============================================
    Thanks in advance,
    SC

    case closed. I found the answer.

  • Feature request - use same colors for joined tables

    I brought two datasets into Power Map. Both have a shared segmentation dimension (joined in Power Pivot). Power Map doesn't pay attention to the fact that the tables are joined and does not use the same series colors.  I have to manually adjust all
    the colors (~2 dozen segments) which is painful and should not be necessary. Power Map should be smart and automatically use the same colors.

    You are more likely to
    produce some effect if you post your request here:
    https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

  • Joining tables in different databases

    Hi,
    I know we can access multiple databases like Oracle, Informix etc. through a single toplink session using session broker. Also in toplink documentation it says there is a work around for joining tables that exists in different databases i.e. joining an Oracle table with an Informix Table. If anyone had tried this or if it is possible, please let me know how to do this.
    Thanks..

    If I could know, how to perform or some sample code, for the following two steps it would be great.
    Write descriptor ammendment code to bind together that go from (A) to (B) and (B) to (A).
    Be sure to map the ammendment descriptors in the mapping workbench.Or please point me to the right toplink documentation or examples.
    Thanks a lot for your help.

  • Drop the Rules of one table from existing bi directional replication setup

    Hi All,
    I have one small question on bi directional replication setup, Its regarding table add in existing replication setup.
    What happened ,When we add a new table to existing replication setup if any reason table is not replicating between two database even we are not getting
    any error in dba_apply_error ,then we have to remove the rules for that particular table and setup again. Some time what happened we got error "queue has
    errors" i dont know the ORA number. But in that case what happened Apply process ABORETED and when we try to start the process it gives same error
    ("Queue has errors" ) and ABORTED again.
    then on metalink for doc id 203225.1 .we have remove the whole replication Manually and setup again. It's horriable....
    Could you please help that before drop the rules for particular table from exisitng bi directional replication setup then wht should we do ?
    Do we need to unscheduled the propagation process and then drop the rules becuase i read on metalink that reason behind the error ,queue has errors
    "negative rules drops while propagation process using the same rule set" .
    Please Suggest!!!!!!!!!!
    Many Thanks

    How huge those tables?. If those are small tables use Oracle MINUS function to get the defference records.

  • Can we join Ztables with SAP std. tables in SQVI ?

    Dear All,
    Can we join Ztables with SAP std. tables in SQVI ?
    How to use "left outer join" in SQVI ?
    What r the rules/steps to be followed for creating right SQVI/query ?
    Sometimes it gives error / we do not get any output ....
    Pl' give examples.

    hi
    good
    1- Yes
    3-Check this example for SQVI Query.
    It is possible to generate a complete list of purchase document releases with the purchase document number (requisitions and orders), releaser, release date and release time.
    First, create an Infoset using transaction SQ02 directly reading from table CDPOS and create an additional table: CDHDR. If you are releasing purchase requsitions at the item level, it is convenient to create an additional field (PURPS LIKE EBAN-BNFPO) to capture the item number. Once the field is defined add the following code to it:
    PURPS = CDPOS-TABKEY+14(5).
    Once created, make sure to assign your Infoset to the user groups.
    Second, create an SAP Query (SQ00) or QuickViewer (SQVI) based on the Infoset you created previously. Set CDPOS-OBJECTID, PURPS (additional field), CDHDR-USERNAME, CDHDR-UDATE & CDHDR-UTIME, CDPOS-TCODE, CDPOS-VALUE_NEW, and CDPOS-VALUE_OLD as list fields (display screen).
    Set CDPOS-OBJECTCLAS, CDPOS-OBJECTID, CDPOS-TABNAME, CDPOS-FNAME, CDPOS-CHANGIND, CDHDR-USERNAME, CDHDR-UDATE & CDHDR-UTIME as the selection fields (selection screen).
    Finally, execute your query. For filtering purchase requisition releases set:
    Object class='BANF'
    Table Name='EBAN'
    Field Name='FRGKZ'
    Change type='U'
    For filtering purchase order releases set:
    Object class='EINKBELEG'
    Table Name='EKKO'
    Field Name='FRGKE'
    Change type='U'
    Make sure to specify username, dates or purchase document number (object value) in order to reduce run times.
    thanks
    mrutyun^

  • How to define an aggregation rule for a dimension based on bridge table?

    Hello,
    I need a solution for aggregating data correctly when using a dimension based on a set of dimensione tables containing a bridge table. Please find below a description of my business case and the OBIEE model which I’ve created thus far.
    Business Case
    The company involved wants to report on the number of support cases, the different types of actions that were taken and the people involved in those actions. One support case will undergo a number of actions (called ‘handelingen’) until it is closed. For each action at least one person is involved performing a specific role, but there can also be multiple persons involved with 1 action, each performing a different role for that action. This is the N : N part of the model.
    The problem that I face is visible in the two pictures below:
    http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/sample.png
    As long as I don’t include anything from the Dimension Meelezer in my report, I get the correct number of handelingen (7). When I include the person (called ‘Meelezer’), the measuere per action is multiplied by the number of persons/roles involved with that action.
    When I changed the Aggregation rule in the report column #Handelingen to ‘Server Complex Aggregate’ I do get the correct endtotal:
    http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/sample2.png
    I believe it should be possible to define in the repository a different aggregation rule for individual dimensions, but I’ve not been able to achieve this.
    Explained below is what I have created in my Physical and Business Model & Mapping layers:
    The Physical Model is built like this:
    (This is just a small part of a much larger physical model, but I’ve only included the most relevant tables)
    http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/PhysicalDiagram-1.png
    The Fact table (ALS Feit Zaakverloop) contains FK’s for the action (FK_HANDELING, joined to ALS Dim Handeling), the date the action took place (FK_DATUM_ZAAKVERLOOP, joined to ALS Dim Datum Zaakverloop) and the uniqe group of people involved (FK_MEELEZERS, joined to ALS Groep Meelezers) and a measure column (SUM_HANDELINGEN) populated with the value ‘1’ for each row.
    The Bridge table (ALS Brug Meelezer/Reden Meelezen) contains three FK’s: FK_GR_MEELEZERS (joined to ALS Groep Meelezers), FK_MEELEZER (joined to ALS Dim Functionaris) and FK_REDEN_MEELEZEN (joined to ALS Dim Reden Meelezen).
    The Business Model
    In the business model, the four physical tables for the N:N relation have been combined into one logical dimension table.
    http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/BusinessModel-1.png
    DIM Meelezer contains one LTS in which the four physical tables have been combined:
    http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/LTS1.png
    And all the required locical columns have been created:
    http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/LTS2.png
    DIM Meelezer has also been identified as a bridge table and a Business Key has been defined on a combination of the FK’s in the bridge table and business codes of the two dimension tables.
    http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/BMDIM.png
    Next a hierachy was created for Dim Meelezer:
    http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/Hier.png
    In Feit Zaakverloop, a measurement called ‘# Handelingen’ was created using SUM_HANDELINGEN, with an aggregation rule of SUM.
    In the LTS of both the DIM Meelezer and Feit Zaakverloop, the Logical Content Levels have both been set to: LVL Detail – Meelezer.
    Please provide suggestions that will NOT require changes to the physical datamodel as they would require too much time to achieve (or at leats would not be ready before my deadline.
    Thanks!
    Edited by: The_Dutchman on Dec 13, 2011 11:43 AM

    Hmm, no replies yet...
    Am I in 'uncharted territory' with this issue?

  • Correlated Subquery for joining summary table original data table

    I want to list a set of fields from an inner-query that correspond to calculated fields on an outer-query. A set of date fields on the outer-query signify a range to correlate records on the inner-query. Records on the inner-query have a single date field
    which should fall within the outer-query date range. At this point, I cannot determined the correct syntax for this query, but am able to achieve the desired results using a left outer join and case-when arguments on what should be the inner-query records.
    Here's my basic SQL right now:
    SELECT  DISTINCT a.service,
          a.start_range,   -- start of month
          a.end_range,    -- end of month
          a.availability,
          CASE WHEN YEAR(a.start)=YEAR(o.begin) AND MONTH(a.start)=month(o.begin) THEN o.event_id ELSE NULL END AS 'event_id'
    CASE WHEN YEAR(a.start)=YEAR(o.begin) AND MONTH(a.start)=month(o.begin) THEN o.minutes ELSE NULL END AS 'minutes'
    FROM   service_availability a LEFT OUTER JOIN 
               service_outage o ON 
    a.service=o.service AND
    TIMESTAMPDIFF(YEAR,o.begin,NOW())=0
    WHERE   TIMESTAMPDIFF(YEAR,a.start,NOW())=0
    The limitation with this approach is that the CASE WHEN argument needs to be used for retrieving any fields on the service_outage table. I've tried several approaches including parameters in both the FROM and
    WHERE clauses as well as subqueries, but cannot get any to return the data. Is there a better way to achieve this?

    Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your datA. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal datA. We need
    to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL.
    >> I want to list a set of fields[sic] from an inner-query that correspond to calculated fields [sic] on an outer-query. <<
    Columns are not fields. Rows are not records. CASE is an expression, not an argument. Where did you get the terms “inner-query” and “outer-query”? I never heard them before and I have some experience with SQL. We have subqueries; is that what you are trying
    say? 
    >> A set of date fields [sic] on the outer-query signify a range to correlate records [sic] on the inner-query. Records on the inner-query have a single date field [sic] which should fall within the outer-query date range.<<
    You do not know the basic terms or how SQL work. You also posted some weird dialect of an SQL-like language. What is NOW()?? Does that mean CURRENT_TIMESTAMP in your dialect?  Did you know that BEGIN is a reserved word in SQL? 
    >> At this point, I cannot determined the correct syntax for this query, but am able to achieve the desired results using a LEFT OUTER JOIN and CASE-when arguments [sic] on what should be the inner-query [sic] records [sic]. Here's my basic SQL right
    now: <<
    Why are you doing temporal math in SQL? Where is the calendar and report period tables?
    Since SQL is a database language, we prefer to do look ups and not calculations. They can be optimized while temporal math messes up optimization. A useful idiom is a report period calendar that everyone uses so there is no way to get disagreements in the DML.
    The report period table gives a name to a range of dates that is common to the entire enterprise. 
    CREATE TABLE Month_Periods
    (month_name CHAR(10) NOT NULL PRIMARY KEY
      CHECK (month_name LIKE '[12][0-9][0-9][0-9]-[01][0-9]-00'),
     month_start_date DATE NOT NULL,
     month_end_date DATE NOT NULL,
     CONSTRAINT date_ordering
      CHECK (month_start_date <= month_end_date),
    etc);
    These report periods can overlap or have gaps. I like the MySQL convention of using double zeroes for months and years, That is 'yyyy-mm-00' for a month within a year and 'yyyy-00-00' for the whole year. The advantages are that it will sort with the ISO-8601
    data format required by Standard SQL and it is language independent. The pattern for validation is '[12][0-9][0-9][0-9]-00-00' and '[12][0-9][0-9][0-9]-[01][0-9]-00'
    Why is an outage not an availability status or an event? 
    >> The limitation with this approach is that the CASE WHEN argument [sic] needs to be used for retrieving [sic: querying is not retrieving] any fields [sic] on the Service_Outage table<<
    We have no DDL! Not even sample data. 
    >> I've tried several approaches including parameters in both the FROM and WHERE clauses as well as subqueries, but cannot get any to return the data. <<
    Parameters exist in procedure declarations; arguments are the actual values passed in them.  Neither of them as anything to do with a query. 
    Want to try again? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

Maybe you are looking for