Help Needed in Checking data values.

There a table which has got the name, address, ph_number of the organisational division.These deailts are fetched from few other tables and stored in a table.
Could you suggest how to check the details(name,address,ph_number) stored in this table and to create/update a field in a table which has the following number ,along with other the details of the divisions,
‘2’ – Creation of the new New Divisions
‘3’ – Amendment – i.e. Changed Division (either in the Address, Name or Ph_number)
‘4’ – Not Changed
blank = undetermined
Could you pls help in this.
Thanks a lot.

Hallo,
with trigger
Something like this
create or replace trigger scott.trg_org
before update or insert on scott.tbl_org
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
begin
    if inserting THEN
        :new.flag := '2';
    else
        if :old.adress != :new.adress
        or :old.name != :new.name
        or :old.phoneNr != :new.phoneNr
        then
            :new.flag := '3';
        else
            :new.flag := '4';
        end if;
     end if;
end;Regards
Dmytro Dekhtyaryuk

Similar Messages

  • Check Data Values, Generates Navigation Data steps taking more time

    Hi,
    In the Masterdata load to 0MAT_PLANT
    The step - "Updating attributes for InfoObject 0MAT_PLANT" used to take a Maximum if 23 minutes for a data package size of 100,000 records till three days ago with the constituent steps "Check Data Values","Process Time-Independent Attributes" and "Generates Navigation Data" taking 5,4 and 12 minutes respectively.
    For the last three days the step "Updating attributes for InfoObject 0MAT_PLANT" is taking 58-60 minutes for the same for data package size of 100,000 records with the constituent steps "Check Data Values","Process Time-Independent Attributes" and "Generates Navigation Data" taking 12,14 and 22 minutes respectively.
    Can anyone please explain what is needed to speeden the dataload back to its previous timing e.g. if  tables indexes need to built for 'P' or 'SID' table of Mat_plant.
    An explanation of why the delay could be happening in the above steps will be really great.
    regards,
    Kulmohan

    Hi Kulmohan Singh,
    I think there may be a difference between the first update and second update is the 100,000 records is
    already in your 0MAT_PLANT.
    If you update the 0MAT_PLANT in twice, The Modify statement should loop the Q table of
    0MAT_PLANT that was already have the 100,000 records in it,so the upload speed was slowly.
    Hope it helpful you.
    Regards,
    James.

  • Need a maximum date value using group by

    Create table student (dept number(10), dep_name varchar2(10),join_date date,years_attended number(10),end_date date);
    insert into student values (1,'I',to_date('3/7/1917','MM/DD/YYYY'),4,to_date('8/26/1987','MM/DD/YYYY'));
    insert into student values (1,'I',to_date('1/1/1900','MM/DD/YYYY'),4,to_date('8/26/1932','MM/DD/YYYY'));
    insert into student values (1,'D',to_date('1/1/1920','MM/DD/YYYY'),5,to_date('8/26/1994','MM/DD/YYYY'));
    insert into student values (1,'C',to_date('1/1/1920','MM/DD/YYYY'),6,to_date('8/26/1945','MM/DD/YYYY'));
    insert into student values (2,'I',to_date('7/1/1900','MM/DD/YYYY'),3,to_date('8/26/1932','MM/DD/YYYY'));
    insert into student values (2,'I',to_date('8/16/1916','MM/DD/YYYY'),9,to_date('8/26/1923','MM/DD/YYYY'));
    insert into student values (2,'D',to_date('8/16/1916','MM/DD/YYYY'),10,to_date('8/26/1987','MM/DD/YYYY'));
    insert into student values (3,'I',to_date('3/7/1917','MM/DD/YYYY'),4,to_date('8/26/1987','MM/DD/YYYY'));
    insert into student values (3,'D',to_date('7/28/1920','MM/DD/YYYY'),6,to_date('8/26/1945','MM/DD/YYYY'));
    insert into student values (3,'I',to_date('7/28/1920','MM/DD/YYYY'),8,to_date('8/26/1965','MM/DD/YYYY'));
    insert into student values (4,'I',to_date('12/31/1924','MM/DD/YYYY'),2,to_date('8/26/1998','MM/DD/YYYY'));
    insert into student values (4,'I',to_date('6/10/1929','MM/DD/YYYY'),1,to_date('8/26/1943','MM/DD/YYYY'));
    insert into student values (4,'C',to_date('1/17/1927','MM/DD/YYYY'),4,to_date('8/26/1955','MM/DD/YYYY'));
    insert into student values (4,'C',to_date('6/10/1929','MM/DD/YYYY'),30,to_date('8/26/1967','MM/DD/YYYY'));
    insert into student values (5,'D',to_date('2/10/1931','MM/DD/YYYY'),2,to_date('8/26/1943','MM/DD/YYYY'));
    insert into student values (5,'I',to_date('2/10/1931','MM/DD/YYYY'),24,to_date('8/26/1962','MM/DD/YYYY'));
    commit;I need a maximum date value join_date for each department. If max(join_date) has two records for each dept then max(end_date) should be considered. I have used a below select query
    select * from student where join_date in (select
    max(join_date) from student group by dept);which gives me the following result
    1     D     1/1/1920     5     8/26/1994
    1     C     1/1/1920     6     8/26/1945
    2     I     8/16/1916     9     8/26/1923
    2     D     8/16/1916     10     8/26/1987
    3     D     7/28/1920     6     8/26/1945
    3     I     7/28/1920     8     8/26/1965
    4     I     6/10/1929     1     8/26/1943
    4     C     6/10/1929     30     8/26/1967
    5     D     2/10/1931     2     8/26/1943
    5     I     2/10/1931     24     8/26/1962But I am looking for the result which gives me only one maximum value for each dept column. First it should look for maximum value of join_date, if two records has same join_date then max(end_date) should be considered. The result should be sumthing like this
    1     D     1/1/1920     5     8/26/1994
    2     D     8/16/1916     10     8/26/1987
    3     I     7/28/1920     8     8/26/1965
    4     C     6/10/1929     30     8/26/1967
    5     I     2/10/1931     24     8/26/1962Can you please tell me how to rewrite the select query to get the above results.
    Edited by: user11872870 on Aug 2, 2011 5:29 PM
    Edited by: user11872870 on Aug 2, 2011 5:36 PM

    Hi,
    That's called a Top-N Query , and here's one way to do it:
    WITH     got_r_num     AS
         SELECT     student.*
         ,     ROW_NUMBER () OVER ( PARTITION BY  dept
                                   ORDER BY          join_date     DESC
                             ,                end_date     DESC
                           )      AS r_num
         FROM    student
    SELECT       dept, dep_name, join_date, years_attended, end_date
    FROM       got_r_num
    WHERE       r_num     = 1
    ORDER BY  dept
    ;Another way is similar to what you originally posted:
    SELECT    *
    FROM       student
    WHERE        (dept, join_date, end_date)
                   IN (
                        SELECT    dept
                   ,       MAX (join_date)
                   ,       MAX (end_date) KEEP (DENSE_RANK LAST ORDER BY join_date)
                   FROM      student
                   GROUP BY     dept
                   );I suspect the first way (using ROW_NUMBER) will be faster.
    Also, the ROW_NUMBER approach is guaranteed to return only 1 row per dept. Using the GROUP BY approach,if there is a tie on join_date and end_date, then it will return all contenders in that dept. Using ROW_NUMBER, it's easy to add as many tie-breaking expressions as you want, and, if there is still a tie, it will arbirarily pick one of the rows involved in the tie as #1.
    Thanks for posting the CREATE TABLE and INSERT statments! That's very helpful.
    Edited by: Frank Kulash on Aug 2, 2011 9:00 PM
    Added GROUP BY alternative

  • Help needed on meta data export

    I need a meta data export dump of a source database of two schemas and import to a fresh new database.
    COuld you please help with the steps to be followed.

    Assuming you are using 10g and exp utility
    You can say rows=N
    exp help=yes
    Export: Release 10.2.0.1.0 - Production on Thu Jul 23 13:36:59 2009
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    You can let Export prompt you for parameters by entering the EXP
    command followed by your username/password:
    Example: EXP SCOTT/TIGER
    Or, you can control how Export runs by entering the EXP command followed
    by various arguments. To specify parameters, you use keywords:
    Format: EXP KEYWORD=value or KEYWORD=(value1,value2,...,valueN)
    Example: EXP SCOTT/TIGER GRANTS=Y TABLES=(EMP,DEPT,MGR)
    or TABLES=(T1:P1,T1:P2), if T1 is partitioned table
    USERID must be the first parameter on the command line.
    Keyword Description (Default) Keyword Description (Default)
    USERID username/password FULL export entire file (N)
    BUFFER size of data buffer OWNER list of owner usernames
    FILE output files (EXPDAT.DMP) TABLES list of table names
    COMPRESS import into one extent (Y) RECORDLENGTH length of IO record
    GRANTS export grants (Y) INCTYPE incremental export type
    INDEXES export indexes (Y) RECORD track incr. export (Y)
    DIRECT direct path (N) TRIGGERS export triggers (Y)
    LOG log file of screen output STATISTICS analyze objects (ESTIMATE)
    {color:red}*ROWS export data rows (Y)* {color} PARFILE parameter filename
    CONSISTENT cross-table consistency(N) CONSTRAINTS export constraints (Y)
    OBJECT_CONSISTENT transaction set to read only during object export (N)
    FEEDBACK display progress every x rows (0)
    FILESIZE maximum size of each dump file
    FLASHBACK_SCN SCN used to set session snapshot back to
    FLASHBACK_TIME time used to get the SCN closest to the specified time
    QUERY select clause used to export a subset of a table
    RESUMABLE suspend when a space related error is encountered(N)
    RESUMABLE_NAME text string used to identify resumable statement
    RESUMABLE_TIMEOUT wait time for RESUMABLE
    TTS_FULL_CHECK perform full or partial dependency check for TTS
    TABLESPACES list of tablespaces to export
    TRANSPORT_TABLESPACE export transportable tablespace metadata (N)
    TEMPLATE template name which invokes iAS mode export
    Export terminated successfully without warnings.

  • Help needed in reading data from a Crystal Report

    I am trying to read data values from a saved crystal report. (groovy code snippet below)
    I open a new ReportClientDocument and set the RAS using the inprocConnectionString property.
    Then I get the rowsetController and set defaultNumOfBrowsingRecords, rowsetBatchSize and maxNumOfRecords all to 1000000
    Using the browseFieldValues method after that returns only 100 records. I want to get all.
               ReportClientDocument clientDocSaved;
           def pathout=rc.pathToSavedReports+rr.path;
         //****** BEGIN OPEN SAVED SNAPSHOT ************
         clientDocSaved = new ReportClientDocument();
         clientDocSaved.setReportAppServer(ReportClientDocument.inprocConnectionString);       
            // Open report
         println("Reading file in.")
         clientDocSaved.open(pathout, OpenReportOptions._openAsReadOnly);
           def rowsetController = clientDocSaved.getRowsetController()
         rowsetController.setDefaultNumOfBrowsingRecords(1000000)
         rowsetController.setRowsetBatchSize(1000000)
         rowsetController.setMaxNumOfRecords(1000000)
         //setup metadata
         IRowsetMetaData rowsetMetaData = new RowsetMetaData()
         Fields fields =  clientDocSaved.getDataDefController().getDataDefinition().getResultFields()
         rowsetMetaData.setDataFields(fields)
         def values = rowsetController.browseFieldValues(fields.get(0), 1000000)
         values.each{value->
            println(value.displayText(new Locale("ENGLISH")))
    Before using the browseFieldValues method I was trying to use a rowsetCursor
                //get the rowset cursor to navigate through the results
                RowsetCursor rowsetCursor = clientDoc.getRowsetController().createCursor(null, rowsetMetaData)
                //navigate through the rowset and log the name and value
                rowsetCursor.moveTo(0)
                while(!rowsetCursor.isEOF()){
                     Record currentRecord = rowsetCursor.getCurrentRecord()
                     //println("current record number: " + rowsetCursor.getCurrentRecordNumber())
                     for(int i=0;i<fields.size();i++){
                          //println("Column - "+fields.get(i).getName())
                          if (currentRecord.size()>0){
                              println(currentRecord.getValue(i))
                     rowsetCursor.moveNext()
    the currentRecord was always an empty list and I did not get any data values at all.
    Am I missing something in using these approaches?
    I'm fairly new to using the Java SDK for CR. Any help will be greatly appreciated.
    Thanks

    hi, I am trying this second method to read the values from report. but all the records comming as null. Kindly help me to resolve this issue.

  • Hierarchy node Variable: F4 Help - Not showing Master data values

    Hi,
    We're having some problems trying to display the F4 help of a hierarchy node selection variable, to show the master data values so that it would look more complete for the users during report execution.
    In the RSD1 setting for the info object, under 'Business Explorer' tab, the 'Query Execution Filter Val. Selectn' is set to 'Only Posted Values for Navigation'.
    I thot that we could overwrite this setting at the Query Designer level, but it does not seem to work.
    Even tho in the Query Designer, we have already specified the 'Filter Value Selection During Query Execution' to 'Values in Master Data Table', it does not seem to display the master data values.
    There is no difference in the F4 values being displayed for the hier node variable, before and after the change in Query Designer.
    Could anyone share some tips on other possible solutions to get a hier node selection variable's F4 help to show the master data values, without changing the RSD1 setting at the info object level please ?
    Thanks in advance for your help.
    Regards,
    Femmie.

    Hi,
    Could you please share the steps you have taken to fix the problem?
    We do have a similar problem and for some reason the newly added hierarchy node for 0Profit_ctr is not showing up in the variable selection screen F4 (input selection for query execution). However we can see this node when we display that hierarchy in RSA1. I did try applying the changes recommened by Jerome but unfortunately it didn't work.
    Any help on this would be greatly appreciated.
    Thanks,
    Krish

  • Help Needed in checking session variable

    In a sample site, I am calling a bounded task flow from an unbounded task flow. In the called taskflow the default activity is a router which checks the session variable, and the home page will be loaded only if the session variable is not null. If session variable is null router will lead to a page dispalying 'session expired'. But even after clearing the session if I copy pasted the previous url, the home page is loading. But when I call bounded taskflow from a bounded taskflow, it is working fine. Can anyone suggest any solution? Thanks in advance

    Thanks for the reply. I'm using jdev 11.1.1.5.0.. I'm just trying with a sample example. I have a login page and when the user logins, the user name is stored in session. the loginpage view activity is in adfc config unbounded taskflow. The login credentials is validated in a backing bean and based on the return value, if the login is valid, a bounded taskflow 'hometaskflow' is called. In this bounded taskflow, the default activity is a router wchich checks the username stored in session. If the username is not null it will lead to the 'homepage' view. Else if it is null it will lead to a 'sessionexpired' view.
    In the java class of login page I'm accessing the session variable as shown
    public Username getSessionBean()
    Username username =
    (Username)resolveExpression("#{Username}");
    return username;
    public static Object resolveExpression(String expression)
    FacesContext facesContext = FacesContext.getCurrentInstance();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext, expression,
    Object.class);
    return valueExp.getValue(elContext);
    On login button click the function being executed is as shown
    public String onLoginClick() {
    if(String.valueOf(itUserName.getValue()).equals("admin")
    && String.valueOf(itPassword.getValue()).equals("admin"))
    Username username=getSessionBean();
    username.setUsername(itUserName.getValue().toString());
    return "success";
    else {
    return "invalid";
    And to set username as null on logout, I used this function on logout click
    public void clearSession()
    Username username=getSessionBean();
    username.setUsername(null);
    The EL expression used to check the value of session variable is
    #{sessionScope.Username.username==null} outcome is expired
    #{sessionScope.Username.username!=null} outcome is active
    This worked when I used in a bounded taskflow, which is being called from another bounded taskflow. But not working in this scenario...

  • Help needed to insert data from different database

    Hi ,
    I have a requirement where i need to fetch data from different database through database link .Depending on user request , the dblink needs to change and data from respective table from mentioned datbase has to be fetched and populated .Could i use execute immediate for this, would dblink work within execute immediate .If not , could pls let me know any other approach .

    What does "the dblink needs to change" mean?
    Are you trying to dynamically create database links at run-time? Or to point a query at one of a set of pre-established database links at run-time?
    Are you sure that you really need to get the data from the remote database in real time? Could you use materialized views/ Streams/ etc to move the data from the remote databases to the local database? That tends to be far more robust.
    Justin

  • Help needed with missing data problem in CRVS2010

    We recently upgraded the reporting engine in our product to use Crystal Reports for Visual Studio 2010 (previously engine was CR9). Our quote report, which has numerous subreports and lots of conditional formatting, started losing data when a quote took more than a single page to be printed. We knew the SQL results included the data, but the report was not printing those lines at all or sometimes printing a partial line. In addition, the running total on the report would exclude the lines that were being missed on the next page. In one example submitted by a customer, 3 lines were skipped between pages.
    I think I have identified two potential issues that document the possibility of data not being included in the report.
    The first potential issue is an issue with the "suppress blank section" option being checked. This issue is supposedly fixed with ADAPT01483793, being released someday with service pack 2 for CRVS2010.
    The second potential issue is using shared variables. This issue is supposedly fixed with ADAPT01484308, also targeted for SP2.
    Our quote report does not explicitly use shared variables with any of the subreports, but it does have several subreports, each in its own section that has the "supress blank section" option checked. We have other reports that use this feature, as well, and they are not exhibiting the problem.
    One different thing about the quote report is that it has a section with multiple suppression options selected. The section has a conditional suppression formula, which controls whether the section is included at all within the report. The section also has the suppress blank section option selected. There are multiple fields within the report that are each conditionally suppressed. In theory, the section's suppress formula could evaluate to true, yet all of the fields within the section are suppressed (due to null values), and then the "suppress blank section" option would kick in.
    The missing data only seems to happen when the section is not being suppressed, and at least one of the fields is being included in the report. If I clear the "suppress blank section" check box, and change the section formula to also include the rules applied to the fields in the section, the missing data problem seems to be resolved.
    Is this related to ADAPT01483793? Will it be fixed in service pack 2?
    If more details are needed, I would be happy to provide a sample report with stored data.

    Hi Don,
    Have a look at the Record Selection formula in CR Designer ( stand alone ) and when exported to RPT format opening that report in the Designer also. 
    There's been a few issues with => logic in the record selection formula. It could be you are running into this problem. Look for NOT inserted into your selection formula.
    Oh and SP2 is coming out shortly so it may resolve the issue. But if you want you could purchase a support, or if you have a support contract then create a case in SMP and get a rep to work with you to debug the issue.
    If you have not try the Trial Version of CR 2011, put it on a VM-ware image or Test PC so you don't corrupt anything for production and have a look at and test it in that designer also. If you purchase a case and it is a bug then you'll get a credit back for the case.
    Don
    Edited by: Don Williams on Oct 26, 2011 7:40 AM

  • Help needed in inserting data using a query

    I need to have some data as a result of the following query:
    select sched_num,load_id,ord_id,split_id from ord_load_seq
    where (ord_id,split_id,sched_num) in (select ord_id,split_id,sched_num from ord_load_seq where seq_num = '2'
    group by ord_id,split_id,sched_num having count(1) >1)
    order by ord_id,split_id,sched_num;
    But currently it retunrns no rows. The problem is in the having count(1)> 1 clause.
    When i make =1, it returns rows. But no rows on > 1. I even tried inserting some rows to get the result >1
    But still the query on a whole returns no rows.Please help.

    ohhh... lets start our lesson children:
    here is code to consider:
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.2.0
    SQL>
    SQL> --Q1
    SQL> with tbl as
      2  (select 1 fld1, 1 fld2, 1 fld3 from dual
      3  union all
      4  select 1 fld1, 1 fld2, 2 fld3 from dual
      5  union all
      6  select 1 fld1, 1 fld2, 3 fld3 from dual
      7  union all
      8  select 1 fld1, 2 fld2, 3 fld3 from dual
      9  union all
    10  select 1 fld1, 3 fld2, 3 fld3 from dual)
    11  select  fld1, fld2, fld3 from tbl
    12  order by fld1, fld2, fld3
    13  /
          FLD1       FLD2       FLD3
             1          1          1
             1          1          2
             1          1          3
             1          2          3
             1          3          3
    SQL> --Q2
    SQL> with tbl as
      2  (select 1 fld1, 1 fld2, 1 fld3 from dual
      3  union all
      4  select 1 fld1, 1 fld2, 2 fld3 from dual
      5  union all
      6  select 1 fld1, 1 fld2, 3 fld3 from dual
      7  union all
      8  select 1 fld1, 2 fld2, 3 fld3 from dual
      9  union all
    10  select 1 fld1, 3 fld2, 3 fld3 from dual)
    11  select  fld1, fld2, fld3, count(1) from tbl
    12  group by fld1,fld2,fld3
    13  order by fld1, fld2, fld3
    14  /
          FLD1       FLD2       FLD3   COUNT(1)
             1          1          1          1
             1          1          2          1
             1          1          3          1
             1          2          3          1
             1          3          3          1
    SQL> --Q3
    SQL> with tbl as
      2  (select 1 fld1, 1 fld2, 1 fld3 from dual
      3  union all
      4  select 1 fld1, 1 fld2, 2 fld3 from dual
      5  union all
      6  select 1 fld1, 1 fld2, 3 fld3 from dual
      7  union all
      8  select 1 fld1, 2 fld2, 3 fld3 from dual
      9  union all
    10  select 1 fld1, 3 fld2, 3 fld3 from dual)
    11  select  fld1, fld2, fld3 from tbl
    12  group by fld1,fld2,fld3
    13  having count(1) > 1
    14  order by fld1, fld2, fld3
    15  /
          FLD1       FLD2       FLD3
    SQL> --Q4
    SQL> with tbl as
      2  (select 1 fld1, 1 fld2, 1 fld3 from dual
      3  union all
      4  select 1 fld1, 1 fld2, 2 fld3 from dual
      5  union all
      6  select 1 fld1, 1 fld2, 2 fld3 from dual
      7  union all
      8  select 1 fld1, 1 fld2, 3 fld3 from dual
      9  union all
    10  select 1 fld1, 2 fld2, 3 fld3 from dual
    11  union all
    12  select 1 fld1, 3 fld2, 3 fld3 from dual)
    13  select  fld1, fld2, fld3 from tbl
    14  order by fld1, fld2, fld3
    15  /
          FLD1       FLD2       FLD3
             1          1          1
             1          1          2
             1          1          2
             1          1          3
             1          2          3
             1          3          3
    6 rows selected
    SQL> --Q5
    SQL> with tbl as
      2  (select 1 fld1, 1 fld2, 1 fld3 from dual
      3  union all
      4  select 1 fld1, 1 fld2, 2 fld3 from dual
      5  union all
      6  select 1 fld1, 1 fld2, 2 fld3 from dual -- inserted duplicate row
      7  union all
      8  select 1 fld1, 1 fld2, 3 fld3 from dual
      9  union all
    10  select 1 fld1, 2 fld2, 3 fld3 from dual
    11  union all
    12  select 1 fld1, 3 fld2, 3 fld3 from dual)
    13  select  fld1, fld2, fld3, count(1)   from tbl
    14  group by fld1,fld2,fld3
    15  order by fld1, fld2, fld3
    16  /
          FLD1       FLD2       FLD3   COUNT(1)
             1          1          1          1
             1          1          2          2
             1          1          3          1
             1          2          3          1
             1          3          3          1
    SQL> --Q6
    SQL> with tbl as
      2  (select 1 fld1, 1 fld2, 1 fld3 from dual
      3  union all
      4  select 1 fld1, 1 fld2, 2 fld3 from dual
      5  union all
      6  select 1 fld1, 1 fld2, 2 fld3 from dual -- inserted duplicate row
      7  union all
      8  select 1 fld1, 1 fld2, 3 fld3 from dual
      9  union all
    10  select 1 fld1, 2 fld2, 3 fld3 from dual
    11  union all
    12  select 1 fld1, 3 fld2, 3 fld3 from dual)
    13  select  fld1, fld2, fld3 from tbl
    14  group by fld1,fld2,fld3
    15  having count(1) > 1
    16  order by fld1, fld2, fld3
    17  /
          FLD1       FLD2       FLD3
             1          1          2
    SQL> Q1. As you may see we have an bunch of data where each row is unique combination of the columns value.
    Q2. lets try to group it by fld1 and fld2 and fld3 columns. We don't expect any miracle and got the same data as Q1. Why? Because each row is unique combination(group) in scope of fld1, fld2, fld3 - count(1) exactly shows us that.
    Q3. Q2 is explanation why we got no rows filter (having count(1) > 1)because the result of the clause is always false.
    Q4. Lets put some duplication.
    Q5. Now we got some new result. Count shows us group with more then one rows.
    Q6. Shows us exact group which we've found in Q5.

  • HELP NEEDED !! Null values in Database

    Hi there !!
    I need help with EJB 3.0 passing null values to database. The situation looks like that :
    I have created EJB entity class called "Osoba.java", it is in relation
    with "Rola.java" (one to many). Each Object of class Osoba can have
    many Roles. Then I created "OsobaServiceBean.java " I included it with
    metod "CreateUnregisteredOsoba(Osoba , Boolean)". From "flex" level I
    call this bean - call is accepted, and as a result new object of class Osoba is added to database. Problem is that only one column is filled in table,
    dispite that in service bean I enforce it to fill all columns (see
    source code - file OsobaServiceBean.java , method
    createUnregisteredOsoba() )
    I provided source code here :
    FILE Rola.java
    package test.granite.ejb3.entity ;
    import javax.persistence.Basic;
    import javax.persistence.CascadeType;
    import javax.persistence.Entity;
    import javax.persistence.ManyToOne;
    @Entity
    public class Rola extends AbstractEntity {
    private static final long serialVersionUID = 1L;
    @Basic
    private String login = new String("");
    @Basic
    private String rola = new String("");
    @Basic
    private String roleGroup = new String("");
    @Basic
    private Boolean zatwierdzony = new Boolean(false);
    @ManyToOne(optional=false)
    private Osoba osoba;
    public Boolean getZatwierdzony() {
    return zatwierdzony;
    public void setZatwierdzony(Boolean zatwierdzony) {
    this.zatwierdzony = zatwierdzony;
    public String getLogin() {
    return login;
    public void setLogin(String login) {
    this.login = login;
    public String getRola() {
    return rola;
    public void setRola(String rola) {
    this.rola = rola;
    public Osoba getOsoba() {
    return osoba;
    public void setOsoba(Osoba osoba) {
    this.osoba = osoba;
    public String getRoleGroup() {
    return roleGroup;
    public void setRoleGroup(String roleGroup) {
    this.roleGroup = roleGroup;
    FILE Osoba.java
    package test.granite.ejb3.entity ;
    import java.util.HashSet;
    import java.util.Set;
    import javax.persistence.Basic;
    import javax.persistence.CascadeType;
    import javax.persistence.Entity;
    import javax.persistence.FetchType;
    import javax.persistence.OneToMany;
    @Entity
    public class Osoba extends AbstractEntity {
    private static final long serialVersionUID = 1L;
    @Basic
    private String imie;
    @Basic
    private String nazwisko;
    @Basic
    private String login;
    @Basic
    private String haslo;
    @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER,
    mappedBy="osoba")
    private Set<Rola> role = new HashSet<Rola>();
    @Basic
    private String email;
    @Basic
    private String nrTelefonu;
    @Basic
    private int rokStudiow;
    public String getPelneImie() {
    StringBuilder sb = new StringBuilder();
    if (imie != null && imie.length() > 0)
    sb.append(imie);
    if (nazwisko != null && nazwisko.length() > 0) {
    if (sb.length() > 0)
    sb.append(' ');
    sb.append(nazwisko);
    return sb.toString();
    public String getImie() {
    return imie;
    public void setImie(String imie) {
    this.imie = imie;
    public String getNazwisko() {
    return nazwisko;
    public void setNazwisko(String nazwisko) {
    this.nazwisko = nazwisko;
    public String getLogin() {
    return login;
    public void setLogin(String login) {
    this.login = login;
    public String getHaslo() {
    return haslo;
    public void setHaslo(String haslo) {
    this.haslo = haslo;
    public Set<Rola> getRole() {
    return role;
    public void setRole(Set<Rola> role) {
    this.role = role;
    public String getEmail() {
    return email;
    public void setEmail(String email) {
    this.email = email;
    public String getNrTelefonu() {
    return nrTelefonu;
    public void setNrTelefonu(String nrTelefonu) {
    this.nrTelefonu = nrTelefonu;
    public int getRokStudiow() {
    return rokStudiow;
    public void setRokStudiow(int rokStudiow) {
    this.rokStudiow = rokStudiow;
    FILE OsobaServiceBean.java
    package test.granite.ejb3.service;
    import java.util.HashSet;
    import java.util.List;
    import java.util.Set;
    import javax.annotation.security.RolesAllowed;
    import javax.ejb.Local;
    import javax.ejb.Stateless;
    import javax.persistence.Query;
    import org.jboss.annotation.security.SecurityDomain ;
    import test.granite.ejb3.entity.Osoba;
    import test.granite.ejb3.entity.Rola;
    @Stateless
    @Local(OsobaService.class)
    @SecurityDomain("other")
    public class OsobaServiceBean extends AbstractEntityService implements
    OsobaService{
    private static final long serialVersionUID = 1L;
    public OsobaServiceBean() {
    super();
    public List<Osoba> findAllOsoba() {
    return findAll(Osoba.class);
    @SuppressWarnings("unchecked")
    public List<Osoba> findAllOsoba(String name) {
    Query query = manager.createQuery (
    "select distinct p from Osoba p " +
    "where upper(p.imie) like upper('%" + name + "%')
    or upper(p.nazwisko) like upper('%" + name + "%')"
    return query.getResultList();
    public Osoba createOsoba(Osoba person) { // pozwalamy
    tworzyc zeby niezalogowany
    return manager.merge (person); //
    uzytkownik utworzyl osobe
    } // ale
    osoba ta i tak nie bedzie jeszcze
    // zatwierdzona
    @RolesAllowed({"unregistered"})
    public Osoba createUnregisteredOsoba(Osoba person, boolean
    zatwierdzony) {
    Rola niezarejestrowany = new Rola();
    niezarejestrowany.setRola("user");
    niezarejestrowany.setOsoba(person);
    niezarejestrowany.setRoleGroup("Roles");
    niezarejestrowany.setLogin(person.getLogin());
    niezarejestrowany.setZatwierdzony(zatwierdzony);
    Set<Rola> role = new HashSet<Rola>();
    role.add(niezarejestrowany);
    // Arrays;
    Object a[] = role.toArray();
    Rola temp;
    temp = (Rola)a[0];
    System.out.println("Login = " + temp.getLogin() + //
    added only for check !!
    "Rola = " + temp.getLogin() +
    "Zatwierdzony = " +
    temp.getZatwierdzony() +
    "Rolegroup = " + temp.getRoleGroup());
    person.setRole (role);
    return manager.merge(person); //
    uzytkownik utworzyl osobe
    } // ale
    osoba ta i tak nie bedzie jeszcze
    public Osoba modifyOsoba(Osoba person) {
    return manager.merge(person);
    @RolesAllowed({"admin"})
    public void deleteOsoba(Osoba person) {
    person = manager.find(Osoba.class, person.getId());
    manager.remove(person);
    public void deleteRola(Rola rola) {
    rola = manager.find(Rola.class, rola.getId());
    rola.getOsoba().getRole().remove(rola);
    manager.remove(rola);
    DATABASE LISTING :
    -----------------------------------------------------------------+----------\
    --------------------------------------------------------+
    | id | ENTITY_UID | version | rola |
    zatwierdzony | osoba_id | login | RoleGroup |
    -----------------------------------------------------------------+----------\
    --------------------------------------------------------+
    | 1 | | NULL | unregistered |
    | 0 | unregistered | Roles | NULL |
    | 33 | eee91bd9-8c5f-4154-8260-3cac9a18eb97 | 0 | user |
    | 34 | NULL | NULL |
    | 32 | a7ed4e8d-a1ba-473a-921c-73c8f8f89efb | 0 | user |
    | 33 | NULL | NULL |
    -----------------------------------------------------------------+----------\
    --------------------------------------------------------+
    The row numer 1 is added by hand and it works. row number 33 and 32
    are added to database by method CreateUnregisteredOsoba. As you can
    see fields login as well as Roles and RoleGroup are empty (NULL). What
    Im doing wrong ?
    Thanks for your help -
    Roman Kli&#347;
    PS. Table Osoba works fine - everything is added as I want.

    I solved problem.
    The reason why EJB had not added anything to database NULL was becouse wrong names of class. Ive refactored whole class Rola.java to RolaClass.java and suddenly it worked.
    True reason is still unknown but most importent is that it works.
    Thanx for reading topic - hope next time someone will answer my questions.
    By !!

  • Help needed! ADF Data Control: Navigation Buttons + Table  issue.

    Hey all!
    We are working on a new application using ADF JSF+EJB 3.0 stack and are experiencing a problem with a simple feature we need to implement.
    Scenario:
    - Creating a data control for a facade session bean and drag a List returned by one of its methods as table;
    - Dragging its corresponding navigation buttons (first, previous, next, last) from the data control onto the page.
    Issue:
    As we press those buttons, we see the page being submitted but but nothing changes in the table...It keep showing the same records all the time (buit-in range navigation works fine though). However, when we manage to drop the collection as a form (with nav buttons included), everything works fine.
    We have inspected pagedefs for both cases and could not identify the difference.
    Any help would be much appreciated as we need to address the issue asap..
    Thanks in advance,
    Gustavo
    PS: Sorry for my English! ;)

    Hey, i have the solve to my problem.
    In the definition page of the table page i change the propert Refresh (ifNeeded is his default value) to always of the iterator who im using to the table.But i use Toplink, then i had to change the property "Refresh Identity Map Results" to "enabled", that option is in the options of the named queries on queries in the toplinkmap of the current table who im using to my page.
    i hope this will be util for you.
    That's all
    Dany

  • "Help Needed" passing ResultSet data to JList having JCheckBox  !!!

    hi every body I am facing this problem since two days I tried but could't get correctly,I am new to java and I need to pass the result set data from the database to a JList having JCheckBox
    I tried but could't get it
    please do help me out, please
    need some sample code for passing resultset data to JList having JCheckBox anybody please help me out
    thanking you,
    with regards

    hello
    try this to pass the recordset to the jlist
    String strlist[];// string array to store the resultsvalues
    JList tempList;//list
    protected void getList()
         Connection conn = null;
         try
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              // Get Connections
              conn = DriverManager.getConnection ("jdbc:odbc:tablename", "", "");
    resultSet = ----------
    strlist= new String[delSecCnt];
         int i = 0;
         while (resultSet.next())
         // Get the table name
         tempList[i] = resultSet.getString(3);
              i++;
         resultSet.close();
         conn.close();
         catch (Exception e)
              tempList = new JList();
              for(int i=0;i < strList.length; i++)
              tempList.add(strList,i);
    //or if you want to use directly the values of recordset
    tempList.add(recordSet[3]);
    in this code i am using a string to store the results values and then passing it to the list.

  • Help needed setting specific date in GregorianCalendar object?

    Hi All!
    I have set SimpleTimeZone object in GregorianCalendar object. How can I set a new date to the GregorianCalendar object, such that i can find DAY_OF_YEAR specific to this date's day?
    URGENT replies will be appreciated!

    Thanks for ur reply!
    but the problem is that i have to create a method:
    public int getDayOfYear(int day, int month, int year)
    return day_of_the year;
    This method should accept user specified day, month and year and passes to GregorianCalendar/Calendar object. I need want to get DAY_OF_YEAR value from Calendar.DAY_OF_YEAR which it will provide, but the change is not affecting!
    ACTUAL CODE
    ===========
    public static double getDayofYear(int hr, int min, int sec)
    String[] ids = TimeZone.getAvailableIDs(5 * 60 * 60 * 1000);
    SimpleTimeZone pdt = new SimpleTimeZone(5 * 60 * 60 * 1000, ids[0]);      
    for (int i=0; i<ids.length; i++)
    System.out.println (ids);
    //setting DLS start and end rule
    pdt.setStartRule(Calendar.MAY, 1, Calendar.SUNDAY, 00 * 60 * 60 * 1000);
    pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 00 * 60 * 60 * 1000);
    Calendar calendar = new GregorianCalendar(pdt);
    //Date trialTime = new Date();//SET DATE
    //calendar.setTime(trialTime);
    calendar.set(Calendar.HOUR,hr);
    calendar.set(Calendar.MINUTE,min);
    calendar.set(Calendar.SECOND,sec);
    return ((double) calendar.get(Calendar.DAY_OF_YEAR));          
    This method is giving true output for today [2nd Dec. 2002 -> 336], but only when it accepts current time, not date. Also giving same output on changing arguments!
    Hoping ur help!

  • Help needed-Survey template data not flowing from CRM to Mobile & V V

    Hi experts,
    We have a requirement to create a custom survey template and pass it to mobile. The data flow should be to and fro. as in; from CRM to Mobile Application and vice versa.
    Currently we are facing an issue in this that the data if not being passed properly from the CRM TO Moblie.
    As i am new to the middleware concepts, i am not sure how to go about analysing if my data in the BDocs for the survey template if correct or not.Some data is present for the survey in the Bdoc(xml), but i am not sure if this xml value is correct or not as the Bdoc table entry (xml value)seems to have been truncated(i cannot view the entire xml there wen i try to open the BDoc fields in SMW01).
    any pointers to this is highly appreciated.
    Thanks
    Swapna.

    May be this thread will help
    v('APP_USER') not returning HTMLDB user
    regards,
    Shijesh

Maybe you are looking for

  • How to send an URL with arguments in a mailto: link ?

    Hello, I need to build simple mailto links to send urls in the body of the message. Unfortunately there are arguments in this url : like http://host/SearchServlet?toSearch=foo"; When I click on the link the body is truncated before the ? even when I

  • MacBook Pro - Broken Superdrive

    Hi all, The superdrive on my MacBook Pro (15", Early 2008) is broken, discs don't spin properly, I think because I always pick it up with one hand at the corner and I've bent the whole thing. Silly me. Anyway, seeing as I'm out of warrantly now, I wa

  • Selection tool causing flashes

    When I use the selection tool, the screen flashes repetedely. What do I do?

  • Problems with the HP 1441A using the 33120A VXI pnp driver

    Hi, I am building a VXI system which incorporates the HP1441A Arb. I am using the 33120A/1441A VXIpnp driver (within LabView 6) and am having some 'issues' with it. I am able to see my instrument in the Visa Assistant screens and am able to run a sof

  • For Readers NOOK is released for Android

    Finally the best ereader stores are all on Android now.  Barnes and Noble Nook is now on Android, Kindle came to Android earlier this month, Kobo finally came to Android replacing the Shortcovers app, and you can get the Borders app that basically is