Some hierarchy related issues, SQL Query is including unselected columns?

Hello Guys...
I have something strange happening in my report.. First of all, the RPD I have is built according to JDE model.
There is a schema which looks like this:
BU Dim ------->Fact<---------Account Dim <--------BU Account Dim (Indeed a copy of BU Dim)
A dim hierarchy is created as AccountDim with Account Desc at the lowest bottom level, the dimension key at that level is AcctID which is the unique identifier.
The issue comes when I created a report using Account, Account Desc, Fact Measures. The measures are not displayed as per account even if the joins and aggr levels are all defined correctly at the proper level..
I checked the sql that is generately, it is interested that whenever I include Account Desc column in the report, the SQL will include Actid column in the select and groupby part, which results in data being at the wrong level..
When I remove Actid from Account Hierarchy as the key, the report runs correctly and the SQL query won't include Actid column.. However, since the removal of the ACTid key from Account Hierarchy will cause other reports not running properly, I have to revert the change back to normal.. I'd like to know what to do in order to investigate more deeply as what's going on and as why the SQL will include columns fields that are not selected at answer levels..
Any suggestions will be greatly appreciately.. I'd like to provide the rpd file, but not sure how to..
Many Thanks

Hi, Vikeng,
Why use the salary table at all, if you're not ever getting any information from it?
Why not:
SELECT  EmpName
,      DeptName
,      'N/A'          AS SalaryValue
FROM     Employee
,     Department
WHERE      Employee.EmployeeId     = Department.EmployeeId
Are you saying that somethimes there is a relationship, but not with this sample data?
If so, post some different sample data (CREATE TABLE and INSERT statements) that has a relationship for some rows, and not for others. Post the results you want from that data, and explain, with specific examples, how you get those results from that data.
You might just need an outer join.

Similar Messages

  • SQL Query - The number of columns specified in "SQL Query" does not match t

    I am creating new UDM for tablespace alert, below is my query,however its failing with error
    SQL Query - The number of columns specified in "SQL Query" does not match the value specified in "SQL Query Output"
    I selected Metric type is number
    SQL Query Format : Two columns
    Query:
    SELECT d.tablespace_name,round(((a.bytes - NVL(f.bytes,0))*100/a.maxbytes),2)
    used_pct FROM sys.dba_tablespaces d,(select tablespace_name, sum(bytes) bytes, sum(greatest(maxbytes,bytes)) maxbytes from sys.dba_data_files group by tablespace_name) a,(select tablespace_name, sum(bytes) bytes from sys.dba_free_space group by tablespace_name) f
    WHERE d.tablespace_name = a.tablespace_name(+) AND d.tablespace_name = f.tablespace_name(+)
    AND NOT (d.extent_management = 'LOCAL' AND d.contents = 'TEMPORARY');
    Any clues why i am getting error.

    SQL> SELECT d.tablespace_name,round(((a.bytes - NVL(f.bytes,0))*100/a.maxbytes),2) used_pct
    2 FROM sys.dba_tablespaces d,(select tablespace_name, sum(bytes) bytes, sum(greatest(maxbytes,bytes)) maxbytes from sys.dba_data_files group by tablespace_name) a,(select tablespace_name, sum(bytes) bytes from sys.dba_free_space group by tablespace_name) f
    3 WHERE d.tablespace_name = a.tablespace_name(+) AND d.tablespace_name = f.tablespace_name(+)
    4 AND NOT (d.extent_management = 'LOCAL' AND d.contents = 'TEMPORARY');
    TABLESPACE_NAME USED_PCT
    MGMT_TABLESPACE .82
    SYSAUX 1.52
    UNDOTBS1 .32
    RMAN .02
    CORRUPT_TS 10.63
    USERS 0
    SYSTEM 2.26
    MGMT_ECM_DEPOT_TS .04
    MGMT_AD4J_TS 0

  • IF NEW VARIABLE IN SQL QUERY, DISPLAYS AS LAST COLUMN + rpad not working

    Hello everybody and thank you in advance,
    1) if I add a new variable to my sql query to select a column which was already in the table, it shows it in the report table as the Last column to the right. That is, if I add "street" to
    something like city, postcode, street, store, manager, etc, instead of placing street between postcode and store, it places it as i said as the last column to the right.
    2) When values are entered into the cells of the tables, yes, they do expand it to their needed lenght, But, only if it is one word. If it is two, like when i enter the value "very good"
    then it takes two lines so as with a carriage return within the cell, thus, making it too high the row. I tried to padd spaces with rpad but it did not work. something like rpad(stock, 20,' ')
    I must say that the table is in the same page where there is a Form, so as the table grows in lenth it is actually squeezing the form located right on its left.
    3) rpad did not work with the most simple syntax, but less would with what i need because it turns out i am using DECODE in order to do a conversion between value displayed and
    value returned in my select list of values, something like : DECODE (TO_CHAR (stock),'1','Deficient','2','Average','3','Good','4','Very Good',null) AS stock,
    so, i have tried to put the rpad there in several places but either it gave parsing error or it left the column empty not picking any values.
    thank you very much
    Alvaro

    Alvaro
    1) That is standard behaviour of apex builder. You can change the display order with the arrows in the report attributes column report.
    2) You will have to play with the style attributes of the column to accomplice this. For instance style="white-space:pre;" in the Element Attributes of the column attributes. White-space:normal would thread several space (' ') as 1. So no matter how many you add with rpad they will be shown as 1.
    Or set a width either as attibute or in a style class for that column.
    Nicolette

  • Goods Issue - SQL Query will not sum

    I have 3 Goods Issue documents with Document Total for each document 10,000 / 20,000 / 30,000 subsequently.
    I want to make query so that it will display like below - where it shows BOTH each of 3 document value (10000/2000/30000) AND the sum of the 3 documents (60000) like below.
    Doc 1 - 10,000
    Doc 2 - 20,000
    Doc 3 - 30,000
    Total = 60,000
    In addition, I would like the ability to choose date range. Basically, something like
    SELECT Document_Total
    FROM Goods_Issue table
    WHERE the_document_date is between 1-SEP-2011 and 31-SEP-2011
    AND the_reference_is _________________
    I have tried many SQL queries, but it displayed either:
    Doc 1 - 10,000
    Doc 2 - 20,000
    Doc 3 - 30,000
    OR
    Total = 60,000
    Please help.

    @Hendry Wijaya      @GordonDu   @malhaar
    Thanks for helps. The SQL query you provided solved 99% of the problem. I just need to make a tweak on the SQL so that it could display the total on the footer. See screenshot below - I uploaded the pics at imageshack as I don't find a way to attach pics in here.
    [See here - Total_at_Footer|http://i129.photobucket.com/albums/p213/whitesnowbear/AAAA/Untitled-2.jpg]
    Thanks a bunch.

  • Handling hierarchy in oracle sql query

    I have two tables:
    The first contains COMPANY_ID and CATEGORY_ID
    The second contains CATEGORY_ID and PARENT_CATEGORY_ID
    I need to return a list containing COMPANY_ID and CATEGORY_ID. The entries, however, must come not only from the first table, but also include all the descendants listed in the second table.
    So for example (and please read the example carefully) - let’s say in the first table I have one row:
    COMPANY_ID | CATEGORY_ID
    1000 | 1
    In the second table, I have three rows:
    CATEGORY_ID | PARENT_CATEGORY_ID
    1 | null
    2 | 1
    3 | 2
    4 | null
    I want to have the following rows as a result:
    COMPANY_ID | CATEGORY_ID
    1000 | 1
    1000 | 2
    1000 | 3
    How can I do this in oracle 10 in a single SQL statement ?

    Hi,
    Welcome to the forum!
    Whenver you have a question, post your sample data in a form that people can use.
    CREATE TABLE and INSERT statements are great:
    CREATE TABLE  first
    (       company_id     NUMBER (4)
    ,     category_id     NUMBER (4)
    INSERT INTO first (company_id, category_id) VALUES (1000,   1);CREATE TABLE AS is good, too:
    CREATE TABLE  second
    AS
    SELECT     1 AS category_id, NULL AS parent_category_id     FROM dual     UNION ALL
    SELECT     2,               1                          FROM dual     UNION ALL
    SELECT     3,               2                          FROM dual     UNION ALL
    SELECT     4,               NULL                    FROM dual;Without that, people can't test their ideas, and are often unsure about your data.
    You should also say what version of Oracle you're using. That's especially important with CONNECT BY queries. Every version since Oracle 7 has had significant improvements in how to do CONNECT BY queries. The query below works in Oracle 10 (and up).
    For hierarchies and trees, use CONNECT BY
    When you have to join tables and use CONNECT BY, it's usually more efficient to do one in a sub-query, and the other in another query.
    In the example below, we're doing the CONNECT BY in sub-query cbq, and the join in the main query.
    WITH     cbq     AS
         SELECT     category_id
         ,     CONNECT_BY_ROOT category_id     AS root_category_id
         FROM     second
         START WITH     parent_category_id     IS NULL
               AND     category_id          IN ( SELECT  category_id          -- Maybe; see note below
                                             FROM    first
         CONNECT BY     parent_category_id     = PRIOR category_id
    SELECT  first.company_id
    ,     cbq.category_id
    FROM     first
    JOIN     cbq     ON     first.category_id     = cbq.root_category_id
    ;The 2nd condition in the START WITH clause won't change the results any; any rows that are excluded by that condition would also be excluded by the join condition. There can be a big differenece in performance, however. Try the query both ways, and use the 2nd condition if it helps.
    Edited by: Frank Kulash on Feb 3, 2010 3:46 PM

  • Hierarchy problem in sql query

    Hello Experts,
                   I am using oracle 11g database with sql developer tool at windows 7.I am trying to make hierarchy for my table data.I have a table tbl_state as
    State_Code
    State_Name
    Country_Code
    1
    AH
    0
    2
    BH
    91
    3
    CI
    72
    4
    DI
    72
    5
    EH
    91
    6
    FI
    72
    7
    GJ
    83
    8
    HJ
    83
    I want hierarchy as: set all states under their country for this I have tried a query as:
    SELECT 1, LEVEL, STATE_NM, null, to_char(SATE_CODE) FROM tbl_state CONNECT BY PRIOR SATE_CODE = COUNTRY_CODE start with COUNTRY_CODE=0
    but there is no output as i want.Please suggest me what is going wrong here and if there is any better optimized way to make such hierarchy then please give me.
    thank  you
    regards
    aaditya

    Hi,
    You always need to post CREATE TABLE and INSERT statements for sample data, so that the people who want to help you can re-create the problem and test their ideas.  If you post statements that don't work, you're just wasting your own and other peoples' time.  Do you wnat to get answers that work?  Then show the same courtesy to the people who try to help you.  Test (and, if necessary, correct) your statements before you post them.
    None of the INSERT statements you posted work with the given CREATE TABLE statement.  You should always explicity list the columns in an INSERT statement, like this:
    INSERT INTO tbl_state (sate_code, state_nm, country_code)
                   VALUES (1,         'AA',     0);
    If you add new columns to the table, old INSERT statements like this will still work.
    Here's one way to do what you requested:
    SELECT    CASE
                  WHEN  GROUPING (state_nm) = 1
                  THEN  country_code
              END    AS country_code
    ,         state_nm
    FROM      tbl_state  t
    GROUP BY  country_code
    ,         ROLLUP (state_nm)
    ORDER BY  t.country_code
    ,         state_nm        NULLS FIRST
    Output:
    COUNTRY_CODE STATE_NM
               0
                 AA
              72
                 CI
                 DI
                 FI
              83
                 GJ
                 HJ
              91
                 BH
                 EH
                 IH
    Is the order of countries in your desired output important?  If you really need 91 between 0 and 72, explain why, and we'll find a way to code it.

  • GL Account Hierarchy related issue

    Hi BI gurus,
    The Scenario is like this:-
    We are doing reporting for Profit&Loss based on GL Account Hierarchy (0GL_ACCOUNT).
    The GL Hierarchy have Asset & Liability nodes.
    The problem is that, in BW, regardless of credit or debit values, it will just display the report the same values on both nodes. so certain GL accounts (e.g. Cash Loan) would appear both side of the hierarchy - Asset node and Liability node.
    Is there a way to make it so when we do reporting based on Hierarchy, when the value's Credit, shows on "Asset Node", and Value's Debit will shows on "Liability node"?
    Any advice is greatly appreciated.
    Thanks,
    Vince

    Thanks for the info Yiannis, but I think I've found out the theory for this.
    According to this [http://help.sap.com/saphelp_nw04s/helpdata/en/04/7b95fb42b0f94aba334c0890dbbda4/content.htm|http://help.sap.com/saphelp_nw04s/helpdata/en/04/7b95fb42b0f94aba334c0890dbbda4/content.htm]
    I have read through it, not fully understand how this works yet, but I think should be able to use the following:-
    1. InfoObject 0GLACCEXT (instead of 0GL_ACCOUNT)
    The exception aggregation (balance sheet aggregation) that is in effect here is only possible for the Financial Statement Item characteristic (technical name 0GLACCEXT). The hierarchy table for this characteristic contains a special attribute called Balance-Dependency of a Hierarchy Node (technical name 0BAL_DEPEND), which controls the balance sheet aggregation of the Financial Statement Item characteristic.
    2. Virtual InfoCube  0FIGL_VC1 (will read data from 0FIGL_C01).
    3. There is a balance sheet query available 0FIGL_VC1_Q0001, which displays the balance sheet data the same way as the R/3 report RFBILA00 does.
    [http://help.sap.com/saphelp_sm32/helpdata/en/2d/955a73da4d6d41a0a6128caf274ce8/content.htm|http://help.sap.com/saphelp_sm32/helpdata/en/2d/955a73da4d6d41a0a6128caf274ce8/content.htm]
    Rgds,
    Vince

  • MS SQL query slow using view column as criteria

    HI,
    I am experiencing a very frustrate problem. I have 2 tables, and create a view
    to union these 2 tables, when do a select on this view using the column of the
    view as criteria is took more 1 minutes, but the query runs fine in Qurey Analyzer.
    Anybody has the same experience? is this the problem with jdbc?

    I searched http://e-docs.bea.com/wls/docs70/index.html, also searched the documentation
    for wls6.1, wls5.1. As you pointed I searched support site, they are all the customer
    case, it's not formal documentation.
    Joe Weinstein <[email protected]> wrote:
    >
    >
    jen wrote:
    Thanks. but I search on the table is fine (the same column). is thereany db setting
    could be tuned? so the view is the problem? No, it's a client decision/issue. If you defined your tables to have
    nvarchar columns
    the jdbc driver's parameter values would be fine as-is.
    I searched "useVarChars" on whole
    site and can't find anything.Which site? This is a property of the weblogic.jdbc.mssqlserver4.Driver.
    I just went to www.bea.com/support and entered useVarChars in the Ask
    BEA
    question panel and got hits...
    Joe
    Joe Weinstein <[email protected]> wrote:
    Jen wrote:
    Sorry it's my bad. I am testing on wls81, but the problems is on wls70,so they
    are using different drivers.
    You are the magic man. It worked on wls81 now. I am sure it will curethe problem
    on wls70. Is there any documentation on this? Why it is not a problemon some
    databse server? ThanksSure. The issue has to do with the MS client-DBMS protocol having evolved
    from
    an 8-bit (7-bit really) character representation. Now it has a newer
    16-bit
    way, to transfer NVARCHAR data. Java characters are all 16-bit, so
    by default
    a JDBC driver will send Java parameters over as NVARCHAR data. This
    is
    crucial
    for Japanese data etc. However, once simple ASCII data is transformed
    to an
    NVARCHAR format, the DBMS can't directly compare it to varchar data,
    or use it
    in index searches. The DBMS has to convert the VARCHAR data to NVARCHAR,
    but it
    can't guarantee that the converted data will retain the same ordering
    as the index,
    so the DBMS has to do a table scan!
    The properties I suggested are each driver's way of allowing you
    to say "I'm
    a simple American ;) I am using simple varchar data so please sendmy
    java
    strings that way.". This allows the DBMS to use your varchar indexes
    in queries.
    Joe Weinstein at BEA
    Joe Weinstein <[email protected]> wrote:
    Jen wrote:
    It doesn't cure the problem. Here is my pool
    <JDBCConnectionPool DriverName="weblogic.jdbc.sqlserver.SQLServerDriver"Name="test_pool"
    Password="{3DES}fKSovViFe5kHzl/vTs0LVQ==" Properties="user=user;PortNumber=1543;useVarChars=true;ServerName=194.20.2.10;DatabaseName=devDB"
    Targets="admin" TestTableName="SQL SELECT COUNT(*) FROM sysobjects"URL="jdbc:bea:sqlserver://194.20.2.10:1543"/>
    Strange is some database is fine.Oh, sorry. I thought it was the older weblogic driver. Change the
    useVarChars=true to sendStringParametersAsUnicode=false
    Let me know... Also, I suggest changing the TestTableName to "SQL
    select
    1".
    For MS, that will be much more efficient than involving a full count
    of sysobjects!
    Joe
    Joe Weinstein <[email protected]> wrote:
    Jen wrote:
    You are right. Tadaa! Am I Kreskin, or what? ;) Here's what I recommend:
    In your pool definition, for this driver add a driver property:
    useVarChars=true
    and let me know if it's all better.
    Joe
    I am using weblogic jdbc driver weblogic.jdbc.mssqlserver4.Driver.
    here is the code:
    getData(Connection connection, String stmt, ArrayList arguments)
         PreparedStatement pStatement=null;>>>>>>>>     ResultSet resultSet=null;>>>>>>>>     try {>>>>>>>>         pStatement = connection.prepareStatement(stmt);>>>>>>>>         for (int i = 1; i <= arguments.size(); i++) {>>>>>>>>          pStatement.setString(i, (String) arguments.get(i-1));>>>>>>>>                    resultSet = pStatement.executeQuery(); //this statement takesmore than 1
    min.
    Joe Weinstein <[email protected]> wrote:
    Jen wrote:
    HI,
    I am experiencing a very frustrate problem. I have 2 tables,
    and
    create
    a view
    to union these 2 tables, when do a select on this view using
    the
    column
    of the
    view as criteria is took more 1 minutes, but the query runs
    fine
    in
    Qurey Analyzer.
    Anybody has the same experience? is this the problem with jdbc?
    I have suspicions... Show me the jdbc code. I'm guessing it's
    a
    PreparedStatement,
    and you send the search criterion column value as a parameter
    you
    set
    with a
    setString().... Let me know... (also let me know which jdbc driveryou're
    using).
    Joe

  • SQL Query not working for column names with spaces

    Hi People..
    We have a strange situation wherein, the column name in the database table has a space inbetween like "Constant Name". While we write a JDBC statement code with the select query we get an exception for invalid syntax. It will help us in a great way if you have anything to inform us on this..
    Thanks
    Prabz

    Using case sensitive names and names with spaces in it is not a good practice.
    However, I believe the SQL standard accounts for this with quoted identifiers. I believe the syntax is
    . select "My Field1", "My Field2"
    . from "My Table'
    Have also seen the following although it might be MS Access specific.
    . select [My Field1], [My Field2]
    . from [My Table]

  • What is syntax of sql query for horizontal 2d column in apex

    Series1 Query---SELECT NULL LINK, REGION LABEL,MILESTONES_PLANNED "MILESTONES PLANNED" ,MILESTONE_ACHIEVED "MILESTONE ACHIEVED" FROM (SELECT REGION_NAME "REGION",sum(NO_OF_MILESTONES_PLANNED) "MILESTONES_PLANNED",sum( NO_OF_MILESTONES_ACHIEVED) "MILESTONE_ACHIEVED" FROM MSR_NO_OF_MILESTONES JOIN PM_PROJECT ON MSR_NO_OF_MILESTONES .PROJECT_ID=PM_PROJECT.PROJECT_ID JOIN PM_REGION ON REGION_ID=PROJECT_REGION_ID GROUP BY REGION_NAME)
    Series2 Query----SELECT NULL LINK, 'Consulting Services' label , MILESTONES_PLANNED "MILESTONES PLANNED" , MILESTONE_ACHIEVED "MILESTONE ACHIEVED" FROM (SELECT sum(A.NO_OF_MILESTONES_PLANNED) "MILESTONES_PLANNED", sum(A.NO_OF_MILESTONES_ACHIEVED) "MILESTONE_ACHIEVED" FROM MSR_NO_OF_MILESTONES A)
    I want both output in the same bar chart...
    But am not getting correct output... its giving 4 labels instead of 2 labels and fills 2 extra 0 in chart becoz of it

    Hi All,
    I think you misunderstood my question, so may be I didnt ask it properly, so here it is I am explaining in detail with an example.
    Suppose I have 10 users with 10 different user name's in a database and I am the 11th user as DBA, every 10 of these users have created some tables lets say 20 tables each by every user making a count of the total tables as 200, now lets say 10 of 200 tables has a column ie fname with value as 'rahul', I want to search the string 'rahul' from all the 200 tables that which of the tables contains this string along with the column name.
    I hope this time my question is clear, the point is I just know of a value and I dont know the table name and column name where it may actually residing, futher I want to search tables of other users as well.
    Regards
    Rahul

  • Sql query tuning for null columns

    Hi All
    I have one query which runs on a table X.
    This table X has one column COL1 with 10 million rows.
    Out of 10million rows, 4Million rows are null.
    Btree Index is availabe on this column. No other type of index feasible.
    I suspect that these null rows are causing burden over my query and is slowing response.
    Is there any way i can improve performance for that query?
    Any help will be appreciated.
    Sun10
    Oracle10G 10.2.0.3.0
    Thanks
    aps
    Edited by: aps on Apr 3, 2009 9:44 AM

    Aps,
    YOu can generated explan plan from sqlplus like this
    sqlplus username/password
    Note: And if user is not set with plustrace then use sqlplus '/as sysdba' and qualify your tables with schemaname.table_name
    sql>set timi on;
    sql> set lines 400;
    sql> set autotrace traceonly;
    sql>select a.account_no,a.read_no,a.inc_obj from billadjmaster a,masterdata b
    where a.account_no=b.acc_no
    and
    b.item_type=22
    and b.idate>'23-mar-2009'
    order by a.account_no,a.read_no;Regards

  • Performance issue: View query is calculating a column value before filterin

    Hi,
    I have a view like this.(My view is more complex than this..I just tried to imitate the situation )
    Select emp_id, emp_name, calculate_salary(emp_id) salary
      From employees
    Where nvl(department, '@@##$$') = nvl(get_global.department, '@@##$$')When I execute the below query
    select emp_name from my_view where salary=10000 by setting a value to get_globals.department I found that it first calls the calculate_salary instead of applying the filter for departments. By somehow the cost base analyzer thinks that calling the function is cheaper than applying the filter. I wonder whether there is way to direct the cba and say to first apply the filters before calculating column values.
    Any suggestions ?
    Thanks

    I don't think it's possible.
    Before a WHERE clause can be applied the data has to be collected for the row so Oracle, I would imagine, isn't going to differentiate between what is a database column and a function, fetch just the columns, do the filtering and then go back to calculate the rest of the columns; it's just going to get all the columns, including the calculated ones, and then apply the filters.
    The only option would be to do...
    select emp_id, emp_name, calculate_salary(emp_id) salary
    from (select emp_id, emp_name
          from employees
          where nvl(deparment, '@@##$$') = nvl(get_global.department, '@@##$$')
          )as your view

  • SQL query to view all columns

    Hello,
    How can I view all columns stored in the Users table? I know some of the field names, like Users.First Name, Users.Last Name, Users.Login, Users.Manager Login.
    I'm essentially trying to access some udf fields (usr_udf_fielda, usr_udf_fieldb) and don't know how to reference them.
    Thanks.

    This is the code I'm using. It was actually working just fine when I had hard coded test values. Since I changed it to references it's been generating that error so I assumed it had something to do with that.
    package com.oracle.events;
    import Thor.API.Operations.tcUserOperationsIntf;
    import Thor.API.tcResultSet;
    import Thor.API.tcUtilityFactory;
    import com.thortech.xl.crypto.tcCryptoUtil;
    import com.thortech.xl.crypto.tcSignatureMessage;
    import com.thortech.xl.util.config.ConfigurationClient;
    import java.util.HashMap;
    import java.util.Hashtable;
    import java.util.Map;
    public class managerid2 extends com.thortech.xl.client.events.tcBaseEvent{
    tcUtilityFactory utilFactory = null;
    tcSignatureMessage moSignature = null;
    ConfigurationClient.ComplexSetting myConfig = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    final Hashtable env = myConfig.getAllSettings();
    Map statusMap = new HashMap();
    private tcUserOperationsIntf userIntf;
    String supervisoremplno=getDataObject().getString("usr_udf_supemplno");
    protected void implementation() throws Exception {
    if (getDataObject().isDeleting()) {
    return;
    if (getDataObject().isUpdating()) {
    return;
    String managerid= getManagerID(supervisoremplno);
    try{
    getDataObject().setString("usr_manager",managerid);
    return;
    }catch(Exception ioex){
    System.out.println("Supervisoremployeenumber does not exist" + ioex.getMessage());
    return;
    public String getManagerID(String supervisoremplno) {
    try {
    moSignature = tcCryptoUtil.sign("xelsysadm", "PrivateKey");
    utilFactory = new tcUtilityFactory(env, moSignature);
    userIntf = (tcUserOperationsIntf) utilFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
    String userid = "temp";
    //String supervisoremplno=userSet.getStringValue("usr_udf_supemplno");
    HashMap userHash = new HashMap();
    userHash.put("Users.User ID", userid);
    tcResultSet userSet = userIntf.findAllUsers(userHash);
    for (int i=0;i<userSet.getTotalRowCount();i++){
    userSet.goToRow(i);
    String emplno=userSet.getStringValue("USR_UDF_EMPLNO");
    String mgrid = userSet.getStringValue("Users.Login");
    if(emplno.equalsIgnoreCase(supervisoremplno))
    return mgrid;
    catch(Exception e){
    return "xelsysadm";
    }

  • I want a sql query to diffrentiate the column names between two schemas

    The structure of the dba_tab_cols table is owner, table_name, column_name, data_type,.....
    So I have a ACCT_ALT_ID table under owner SEODS01 and in that therse are column names
    IBD_ID
    ACCT_ALT_ID_CNTX_CDE
    EODS_ACCT_ID
    DATA_GRP_CDE
    UPDT_DTE
    AND I have a ACCT_ALT_ID table under owner SEODS02 and in that therse are column names
    IBD_ID
    ACCT_ALT_ID_CNTX_CDE
    EODS_ACCT_ID
    DATA_GRP_CDE
    CRTE_PGM
    CRTE_TSTP
    UPDT_PGM
    UPDT_TSTP
    so I want select query to display like this
    SEODS1_ACCT_ALT_ID SEODS02_ACCT_ALT_ID (COLUMN HEADER)
    IBD_ID IBD_ID
    ACCT_ALT_ID_CNTX_CDE ACCT_ALT_ID_CNTX_CDE
    EODS_ACCT_ID EODS_ACCT_ID
    DATA_GRP_CDE DATA_GRP_CDE
    UPDT_DTE CRTE_PGM
    CRTE_TSTP
    UPDT_PGM
    UPDT_TSTP
    AND ALSO I NEED ONE MORE QUERY THAT I DO NOT WANT DISPLAY HAVING SAME COLUMN_NAME LIKE ACCT_ALT_ID_CNTX_CDE ,EODS_ACCT_ID,IBD_ID
    DATA_GRP_CDE

    Hi,
    Welcome to the forum!
    876793 wrote:
    The structure of the dba_tab_cols table is owner, table_name, column_name, data_type,.....
    So I have a ACCT_ALT_ID table under owner SEODS01 and in that therse are column names
    IBD_ID
    ACCT_ALT_ID_CNTX_CDE
    EODS_ACCT_ID
    DATA_GRP_CDE
    UPDT_DTE
    AND I have a ACCT_ALT_ID table under owner SEODS02 and in that therse are column names
    IBD_ID
    ACCT_ALT_ID_CNTX_CDE
    EODS_ACCT_ID
    DATA_GRP_CDE
    CRTE_PGM
    CRTE_TSTP
    UPDT_PGM
    UPDT_TSTP
    so I want select query to display like this
    SEODS1_ACCT_ALT_ID SEODS02_ACCT_ALT_ID (COLUMN HEADER)
    IBD_ID IBD_ID
    ACCT_ALT_ID_CNTX_CDE ACCT_ALT_ID_CNTX_CDE
    EODS_ACCT_ID EODS_ACCT_ID
    DATA_GRP_CDE DATA_GRP_CDE
    UPDT_DTE CRTE_PGM
    CRTE_TSTP
    UPDT_PGM
    UPDT_TSTPYou may have noticed that this site normally doesn't display multiple spaces in a row.
    Whenever you post formatted text (such as query results) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
    That way, your message will look like this:SEODS1_ACCT_ALT_ID SEODS02_ACCT_ALT_ID (COLUMN HEADER)
    IBD_ID IBD_ID
    ACCT_ALT_ID_CNTX_CDE ACCT_ALT_ID_CNTX_CDE
    EODS_ACCT_ID EODS_ACCT_ID
    DATA_GRP_CDE DATA_GRP_CDE
    UPDT_DTE CRTE_PGM
    CRTE_TSTP
    UPDT_PGM
    UPDT_TSTP
    This sounds like a jon for a FULL OUTER JOIN:SELECT     s1.column_name     AS seods1_acct_alt_id
    ,     s2.column_name     AS seods2_acct_alt_id
    FROM          dba_tab_cols     s1
    FULL OUTER JOIN     dba_tab_cols     s2 ON s1.column_name     = s2.column_name
    WHERE     s1.owner     = 'SEODS1'
    AND     s1.table_name = 'ACCT_ALT_ID'
    AND     s2.owner     = 'SEODS2'
    AND     s2.table_name = 'ACCT_ALT_ID'
    AND ALSO I NEED ONE MORE QUERY THAT I DO NOT WANT DISPLAY HAVING SAME COLUMN_NAME LIKE ACCT_ALT_ID_CNTX_CDE ,EODS_ACCT_ID,IBD_ID
    DATA_GRP_CDESorry, I don;t understand.
    Post the results you want (formatted, between \ tags, of course).
    Do you want only the column names that appear in one table or the other, but not in both?
    In that case, you can add a condition like this to the WHERE clause:
    AND       (   s1.column_name  IS NULL
           OR  s2.column_name  IS NULL
           )

  • Include Button that executes PL/SQL procedure to SQL query based region

    I would like to add two columns to a SQL query region.
    These columns would not be sourced from the query, but rather would be used to execute a PL/SQL procedure.
    For example, I would like to have a manager approve or deny adding an additional employee to the department.
    There would be one button for APPROVE. And, one button for DENY.
    The PL/SQL procedure would execute to perform the required DML based upon the selected action (either APPROVE or DENY).
    A sample output would look like this:
    <APPROVE>, <DENY>, John Doe, Accountant
    <APPROVE>, <DENY>, Jane Doe, Accountant
    Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?
    Thanks!
    -Reid

    Is there any way to add a button to a SQL Query based report region where that button executes a stored proc? If so, what is the basic process for doing this?Conditional page item? You can associate processes with buttons on a page

Maybe you are looking for

  • How can I send a PDF via mail without it becoming an attached file?

    Hi All! I need to know how I am able to send a PDF file via mail, without it becoming an attached file. This means when the receiver opens the mail, he automatically sees the PDF without first having to read the normal mail text and scroll down to op

  • Keyboard delete and caps lock keys not working after update

    Shortly after a windows update two keys, delete and caps lock do not work. I have tried the following 1. system restore..it says it cannot restore as a file is missing. I have used this function before without any problem. 2. Update key board driver

  • In-Ear headset not from Nokia

    Hi,  how can I use a In-Ear headset which is not from Nokia?  I have a Apple In-Ear headset which I cant use with my N9...  Is something like this working? http://www.beatsbydre.com/products/Products.aspx?pid=B5933&cat=2

  • Java update crashes Safari and Mail

    When upgrading to the latest version of Java, I got a message at the end of the cycle saying that the "source media" was corrupt (or a similar word). I now find that both Safari and Mail crash immediately upon trying to open a URL or a mail message.

  • Syncing smart playlists with location set to "on this computer"

    I have a ton of playlists with multiple creitera that after the upgrade to iOS7 just stopped working entirely. It turns out that when I added "location - on this computer" as a filter to avoid seeing everything in my icloud, that no longer applied to