Query not synchronized

Hi,
I'm having some trouble on rendering a list where some of the row attributes have changed.
The list page renders a table where the value attribute is binded to a java.util.List in a request scope backing bean. I select one of the items and send it to the edition view, and change one or two attribute, call the service and merge the changes with the javax.persistence.EntityManager. Once finished I'm sent back to the list where I started. The one or two attributes happen to be in the columns the table is rendering, but they haven't changed. I check at the database and they do have changed, and if I go to other list where these change will cause this row not to be included it works fine, but when I'm back to the list the attributed remain unchanged.
I've checked and every time I go to the list, before and after the edition, the query to load the list is called. The java.util.List object is called from the backing bean, which is request scope. The query is created in the facade as follows:
public List<Result> getResults(String id, Long state) {
StringBuilder sql = new StringBuilder("select x.field_one, x.field_two, y.field_three from table_x x, table_y y where x.field_one = ?1");
if(null != state) {
sql.append(" and x.field_two = ?2");
Query query = em.createNativeQuery(sql.toString, Result.class);
query.setParameter(1, id);
if(null != state) {
query.setParameter(2, state);
return query.getResultList();
And the Result class is an entity without any real table attached to it.
@Entity
public class Result implements serializable {
//attributes + getters and setters
Any ideas why would this happen?
Thnaks in advance.

Try to add the following line before the invocation of query.getResultList():
query.setHint(TopLinkQueryHints.REFRESH, HintValues.TRUE);Add the following to your import statements:
import oracle.toplink.essentials.config.HintValues;
import oracle.toplink.essentials.config.TopLinkQueryHints;pino

Similar Messages

  • Slave instance can not synchronized with the master for a long time

    Hi,
    Slave instance can not synchronized with the master for a long time, and the gap of LSNs between slave and master are more and more larger. The transfer bytes per second between master and slave is 118MB/s , upper limit to the ethernet card. Why???
    ENVIRONMENT:
    1. A network program which we called mcdb is based on BDB 4.8.30. It is used to accept get/set requests and then query data from bdb or save data to bdb.
    2. mcdb implements replication with bdb replication manager api. The default start replication policy is DB_REP_ELECTION, rep ack policy is DB_REPMGR_ACKS_ONE_PEER and rep priority is 100.
    3. The bdb data files, bdb log files, region files and rep files are all in the same home directory.
    4. There are two instances of the mcdb are separately on two standalone servers which has no other programs. These two instances are in one replication group which can elect a master automatically.
    5. The master instance is online, which has lots of requests (get, set, delete).
    ACTIONS:
    1. Start two mcdb instances on two servers and the two instance make a replication group. Slave has already synchronized with the master.
    2. Stop the slave for a long time (more than 20 hours).
    3. Start the slave instance to synchronize data with master.
    RESULT:
    1. the gap of LSNs between slave and master are more and more larger.
    2. db_stat of master and slave:
    master db_stat:
    467170     Number of PERM messages not acknowledged
    9245     Number of messages queued due to network delay
    172415     Number of messages discarded due to queue length
    25880     Number of existing connections dropped
    3407     Number of failed new connection attempts
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    DB_REPMGR site information:
    10.67.15.146 (eid: 0, port: 30011)
    Environment configured as a replication master
    331726/3574994     Next LSN to be used
    0/0     Not waiting for any missed log records
    328872/466092     Maximum permanent LSN
    0     Next page number expected
    0     Not waiting for any missed pages
    0     Number of duplicate master conditions originally detected at this site
    2147M     Current environment ID (2147483647)
    100     Current environment priority
    49     Current generation number
    50     Election generation number for the current or next election
    2323     Number of duplicate log records received
    0     Number of log records currently queued
    6768     Maximum number of log records ever queued at once
    55284     Total number of log records queued
    120M     Number of log records received and appended to the log (120475988)
    111     Number of log records missed and requested
    2147M     Current master ID (2147483647)
    2     Number of times the master has changed
    0     Number of messages received with a bad generation number
    8505306     Number of messages received and processed
    12     Number of messages ignored due to pending recovery
    471869     Number of failed message sends
    12M     Number of messages sent (12959945)
    0     Number of new site messages received
    1     Number of environments believed to be in the replication group
    990543     Transmission limited
    0     Number of outdated conditions detected
    0     Number of duplicate page records received
    0     Number of page records received and added to databases
    0     Number of page records missed and requested
    Startup complete
    6244678     Number of transactions applied
    0     Number of startsync messages delayed
    1     Number of elections held
    1     Number of elections won
    No election in progress
    0.057097     Duration of last election (seconds)
    8944103     Number of bulk buffer sends triggered by full buffer
    0     Number of single records exceeding bulk buffer size
    5273M     Number of records added to a bulk buffer (5273592170)
    10M     Number of bulk buffers sent (10490865)
    0     Number of re-request messages received
    0     Number of request messages this client failed to process
    0     Number of request messages received by this client
    slave db_stat:
    0     Number of PERM messages not acknowledged
    0     Number of messages queued due to network delay
    0     Number of messages discarded due to queue length
    1454     Number of existing connections dropped
    0     Number of failed new connection attempts
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    DB_REPMGR site information:
    10.67.15.147 (eid: 0, port: 30011)
    Environment configured as a replication client
    329544/2916048     Next LSN expected
    330433/2013808     LSN of first log record we have after missed log records
    329543/5500501     Maximum permanent LSN
    0     Next page number expected
    0     Not waiting for any missed pages
    0     Number of duplicate master conditions originally detected at this site
    2147M     Current environment ID (2147483647)
    100     Current environment priority
    49     Current generation number
    50     Election generation number for the current or next election
    5256M     Number of duplicate log records received (5256599432)
    3925284     Number of log records currently queued
    3925285     Maximum number of log records ever queued at once
    4880561     Total number of log records queued
    3578038     Number of log records received and appended to the log
    1912297     Number of log records missed and requested
    0     Current master ID
    1     Number of times the master has changed
    0     Number of messages received with a bad generation number
    12M     Number of messages received and processed (12980442)
    2     Number of messages ignored due to pending recovery
    0     Number of failed message sends
    1912307     Number of messages sent
    0     Number of new site messages received
    0     Number of environments believed to be in the replication group
    0     Transmission limited
    0     Number of outdated conditions detected
    0     Number of duplicate page records received
    0     Number of page records received and added to databases
    0     Number of page records missed and requested
    Startup incomplete
    110568     Number of transactions applied
    80     Number of startsync messages delayed
    0     Number of elections held
    0     Number of elections won
    No election in progress
    0     Number of bulk buffer sends triggered by full buffer
    0     Number of single records exceeding bulk buffer size
    0     Number of records added to a bulk buffer
    0     Number of bulk buffers sent
    0     Number of re-request messages received
    0     Number of request messages this client failed to process
    0     Number of request messages received by this client
    Edited by: 899585 on 2013-1-4 下午10:54
    Edited by: 899585 on 2013-1-4 下午10:55

    Hi,
    Unfortunately, this issue is beyond the level of what is supported over the forum. Performance related issues are extremely complex and require an in-depth understanding of your environment and dedicated support. In a generic sense, you can look at this as a basic queueing problem. You have a server that went down and work is still coming in. When the server gets started it is possible that it may never catch up depending on new work coming in and the rate at processing the old work.
    So what would you do in this case --- one thing would be to reduce the new work coming in. In HA terms this would be slowing the master down and you can increase DB_REP_ACK_TIMEOUT for this. Another thing you could do is add fresh servers to help reduce the workload. In HA terms, this would be the equivalent of restarting the client and give it a fresh look at everything. Another thing you could do is replan the system and load balance. In HA terms, it would mean something like take a hot backup of the master and reinit a client from scratch.
    If you are interested in getting a dedicated support person working on this concern, please let me know and we can move forward down that path. Just respond to the thread with your email address and I will get in contact with you so we can pursue that approach.
    thanks
    mike

  • Outlook 14.4.8 not synchronizing with Exchange 2007 anymore (shows "downloading" but no new messages shown in inbox"

    Outlook 14.4.8 on iMAC Retina and Yosemite 10.10.2 is not synchronizing with Exchange 2007 anymore (shows "downloading" but no new messages shown in inbox".
    Accessing Mails with Webbrowser and from Windows Outlook is working correctly.
    All Macs (also the ones with OS 10.6.8) do not anymore show any new messages in inbox.
    Restarted Server, tried to disable autodiscover on macs and deleting/adding account and repairing database does not fix the problem. Also restarted server several times.
    We have the same problem on 2 imacs retina with yosemite and on 2 mac pro with 10.6.8 and different office 2011 versions.
    i tried to configure the exchange account in apple mail on yosemite and it also states "connected" and does list some folders but no new mails are getting in.
    Windows clients and outlook on them works and syncs fine, and also when connecting via webbrowser at owa it must be a mac-specific/webdav issue.
    exchange 2007 Sp3 Version 8.3 (bild 83.6) and Update Rollup 15 for sp3 (automatic updates "HIGH" for server and clients)
    there is one update popping up again and again even after everytime successull installation: Windows Mlicious Software Removal Tool x64 - October 2010.
    i tried to configure a new user with empty mailbox and configured it with microsoft mail (mac - yosemite)  as exchange and was able to send a mail from there (even if quite delayed).
    but there are not coming in any mails.
    same exchange accounts triggered by imap do work and also via owa.
    Exchange Accounts in Outlook for MAC and also in Mail (Yosemite) do show the folder structures but there is no mails showing up. I can send mails from the exchange accounts created but they seem to be processed with a delay of like 15minutes and outlook
    is giving error "end of file reached" but messages are send after some time.
    Does seem like EWS is extremely slow, to slow perhaps to sync and therefore ending in timeout.
    Also i cannot reach the server from externally over ssl https 443. if testing port 443 of exchange from outside the port seems closed even firewall settings of sbs 2008 and sonicwall ports are correctly open.
    could it be there is something in regarding webdav which is very slow and leading to timeouts ?
    in application log i do have the following two information events every few minute:
    The Exchange Web Services started successfully. Event ID 1
    and
    Process STORE.EXE (PID=3688). Exchange Active Directory Provider has discovered the following servers with the following characteristics: 
     (Server name | Roles | Enabled | Reachability | Synchronized | GC capable | PDC | SACL right | Critical Data | Netlogon | OS Version) 
    In-site:
    SERVER.org.local CDG 1 7 7 1 0 1 1 7 1
     Out-of-site:
    Errors in Application log:
    The Open Procedure for service "BITS" in DLL "C:\Windows\system32\bitsperf.dll" failed. Performance data for this service will not be available. The first four bytes (DWORD) of the Data section 
    The entry <C:\WSUS\WSUSCONTENT\CONTENTFOLDERACLSCHECK.TXT> in the hash map cannot be updated.
    An exception Microsoft.Exchange.Data.Storage.ConversionFailedException occurred while converting message Imap4Message 69447
    Also outlook 2011 clients are asked by time to time to reenter pwds and errors like "connection is closed. 13" 
    Faulting application taskeng.exe, version 6.0.6002.18342, time stamp 0x4cd34898, faulting module ntdll.dll, version 6.0.6002.18881, time stamp 0x51da3d16, exception code 0xc000071b, fault offset 0x0000000000082445, process id 0x3288
    Certificate Services Client Provider pautoenr.dll raised an exception. Exception code 3221225477.
    Backup Exec:
    FULL_BACKUP -- The job failed with the following error: A failure occurred querying the Writer status.
    Volume Shadow Copy Service error: A critical component required by the Volume Shadow Copy service is not registered.  This might happened if an error occurred during Windows setup or during installation of a Shadow Copy provider.  The
    error returned from CoCreateInstance 
    Exchange VSS Writer (instance 2d932ef8-6319-4ab8-a45f-1242480b44ad:15) failed with error code 1295 when processing the backup completion event. 

    Hi,
    Since Outlook running on Windows works well, it seems an issue on the Mac side. I suggest ask Mac for help so that you can get more professional suggestions.
    More information for your reference:
    Please try to verify whether there is any expired certificate from the computer personal store.
    If it is the case, please remove them.
    Thanks
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
    Mavis Huang
    TechNet Community Support

  • Sold to party refernce data not synchroning properly

    Hi Guys,
    Today I came across a new issue...
    In CRM order we have External reference to sold to party. Here we enter PO number at header level and it will synchronize to R/3.with out any problem.
    But when I try to change the PO Number in R/3 order at header level, that value is not synchronizing with CRM header level,
    Only for Billed Itemu2019s PO number is getting changed for remaining items it remains unchanged.
    Is it standard behavior of system or is there anything we need to change?
    Please help me on this,
    Thanks & Regards,
    Shaik

    Hi Shaik,
      Please check the filters in SALESDOCUMENT middleware adapter object in CRM. If proper filters are not in place, it will not send the changes from ECC to CRM.
    //Bhanu

  • My iPad air is not connecting with window 8.1 and is not synchronizing the photos any more

    My iPad air is not synchronizing the photos any more on my dell windows 8.1

    Hi there Raalb,
    You may find the troubleshooting steps in the article below helpful.
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/ts1538
    -Griff W. 

  • SQL query not calculating

    SQL query not calculating
    gross_amount is giving the value of extended_amount and the gross_price_rc is giving the value of unit_selling_price
    select customer_trx_line_id,
    ( extended_amount / 1- (decode(decode(attribute6,null,0)+decode(attribute7,null,0)+decode(attribute8,null,0)+decode(attribute9,null,0)/100,null,0,1,0))) GROSS_AMOUNT,
    ( unit_selling_price /1-(decode(decode(attribute6,null,0)+decode(attribute7,null,0)+decode(attribute8,null,0)+decode(attribute9,null,0)/100,null,0,1,0))) gross_price_rc
    from ra_customer_trx_lines_all
    where attribute6 is not null or attribute7 is not null or attribute8 is not null or attribute9 is not null
    whats the isuue here??
    Thanks

    decode(attribute7,null,0)Looking at it again, this always returns 0 or NULL, so it not really surprising
    DECODE
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions040.htm#i1017437
    CASE
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/expressions004.htm#i1033392

  • White Balance NOT Synchronizing in Bridge CS5

    Instead of LR3 I use Bridge CS5 and the camera raw tool for my edits (it's all the same tools and runs faster.) ANyways, a strange problem i noticed recently after SEVERAL job edits.. I noticed the white balance was not the same on all my files. THIS IS A HUGE *** PROBLEM FOR ME! I tried everything but for some reason Bridge is not synchronizing the white balance, even if I just have white balance selected.. I need to have all my files the same.. I doesn NOT work in the camera raw module and it does NOT work when you right click, go to settings, copy settings and then paste settings..
    Any one else experienced this?
    I have ACR 6.1 installed

    Is the WB As Shot, perhaps?  Synchronizing As Shot as your WB does exactly that, sets the WB to whatever the camera was set to, which if it is Auto WB in the camera, then the Temp/Tint values will be different for each photo.  If you want all the WB settings to be the same Temp/Tint values you must change the WB to Custom or use one of the built-in WB selections that has a constant set of Temp/Tint numbers. 
    What I usually do is modify the As Shot WB to something slightly different by changing the Tint value and then set the Tint value back to what it was if necessary, which will make it say Custom instead of As Shot, and then synchronize with this Custom value.

  • Why i can not synchronous transmission in my ipod touch?

    after i used others ID download the date my touch did not synchronous transmission,how can i do?thank you.

    If the other ID did not belong to you it is not right to use other people IDs to download/purchase media.

  • Why is this query not using the index?

    check out this query:-
    SELECT CUST_PO_NUMBER, HEADER_ID, ORDER_TYPE, PO_DATE
    FROM TABLE1
    WHERE STATUS = 'N'
    and here's the explain plan:-
    1     
    2     -------------------------------------------------------------------------------------
    3     | Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
    4     -------------------------------------------------------------------------------------
    5     | 0 | SELECT STATEMENT | | 2735K| 140M| 81036 (2)|
    6     |* 1 | TABLE ACCESS FULL| TABLE1 | 2735K| 140M| 81036 (2)|
    7     -------------------------------------------------------------------------------------
    8     
    9     Predicate Information (identified by operation id):
    10     ---------------------------------------------------
    11     
    12     1 - filter("STATUS"='N')
    There is already an index on this column, as is shown below:-
         INDEX_NAME INDEX_TYPE     UNIQUENESS     TABLE_NAME     COLUMN_NAME     COLUMN_POSITION
    1     TABLE1_IDX2 NORMAL     NONUNIQUE     TABLE1      STATUS     1
    2     TABLE1_IDX NORMAL     NONUNIQUE     TABLE1     HEADER_ID     1
    So why is this query not using the index on the 'STATUS' Column?
    I've already tried using optimizer hints and regathering the stats on the table, but the execution plan still remains the same, i.e. it still uses a FTS.
    I have tried this command also:-
    exec dbms_stats.gather_table_stats('GECS','GEPS_CS_SALES_ORDER_HEADER',method_opt=>'for all indexed columns size auto',cascade=>true,degree=>4);
    inspite of this, the query is still using a full table scan.
    The table has around 55 Lakh records, across 60 columns. And because of the FTS, the query is taking a long time to execute. How do i make it use the index?
    Please help.
    Edited by: user10047779 on Mar 16, 2010 6:55 AM

    If the cardinality is really as skewed as that, you may want to look at putting a histogram on the column (sounds like it would be in order, and that you don't have one).
    create table skewed_a_lot
    as
       select
          case when mod(level, 1000) = 0 then 'N' else 'Y' end as Flag,
          level as col1
       from dual connect by level <= 1000000;
    create index skewed_a_lot_i01 on skewed_a_lot (flag);
    exec dbms_stats.gather_table_stats(user, 'SKEWED_A_LOT', cascade => true, method_opt => 'for all indexed columns size auto');Is an example.

  • Audio and video not synchronized in recording made with Lync 2013

    There appears to be no forum for the Lync 2013 client yet, so I am posting this in the Lync 2013 server forum.
    Environment: Lync 2013 Server and Lync 2013 32-bit client. Only one Lync pool. Conference call was scheduled using "Lync Meeting" in Outlook about a week before the call. Call recorded on a laptop that was plugged into our LAN with an Ethernet
    cable.
    Problem: User scheduled a conference call with screen sharing (PowerPoint) and recorded the call. The audio and video are not synchronized in the recording. There is several minutes' delay, with the audio lagging behind the PowerPoint. The last slide
    on the call was presented, the call ended, and the presenter ended the recording (I was present for all this and can confirm no user error in these steps); however, in the recording, the slides change before the speaker talks about it, and the last
    couple of minutes are cut off. 
    Any ideas on why this happened? Web research has failed me. Thank you.

    You may need to lower the recording quality as your PC might not be able to keep up the pace.
    Go to Options in Lync client -> Recording -> Select 480p
    Then test again
    - Belgian Unified Communications Community : http://www.pro-lync.be - MCM/MVP/MCT

  • Mismatch query not working. Not sure what I did wrong.

    In my query, I have created two CTE's. One pulls in the records of all people who are assigned to an audience. The other pulls in all people who are assigned to the same audience AND completed a certain course.
    What I wanted to do from there, was to do a mismatch query, not to find the PEOPLE, but just the departments that were represented in the audience, but had no people in the list of those who completed the course. (In other words, say the HR Department had
    three people in the audience... two completed the course, one did not. The HR Department should NOT show up in my mismatch query because some of their people completed the course. Then, say the IT Department had five people in the audience, and none of them
    have completed the course. The IT Department SHOULD show up in my mismatch query. For this case, I don't care about the people who didn't complete it, just the departments where nobody did yet.)
    I thought I was doing the mismatch query correctly, but I guess I must not. I will share the relevant parts of my query below (there is more to my query, but I don't think you necessarily need to see it to assist with this particular problem). (Side note:
    Yes, I know the way I am doing the fiscal calendar is not ideal, but I've looked up other ways to do it, and do not understand it. Given time, I can break it down and understand it, but I am in a rush to finish this report.)
    gm101certtbl
    AS
    select
    dimUser.EmpFK MeasureEmpFK,
    RIGHT(OrgCode2, LEN(OrgCode2) - 2) MeasurePC,
    audusersName MeasureAudName,
    dimActivity.ActivityName MeasureActName,
    dimActivity.Code MeasureActCode,
    CASE
    WHEN OrgCode2 LIKE 'US%' then 'US'
    WHEN OrgCode2 LIKE 'CA%' then 'CA' END
    CountryCode,
    'ACTUALS_GM101' SOURCESYSTEMID,
    Null CURRENCYCODE,
    'GM101CERT' MEASUREID,
    Null MEASUREDOLLARS,
    CASE
    WHEN GETDATE() Between '20131001 00:00:00' AND '20140930 11:59:59' THEN '2014'
    WHEN GETDATE() Between '20141001 00:00:00' AND '20150930 11:59:59' THEN '2015'
    WHEN GETDATE() Between '20151001 00:00:00' AND '20160930 11:59:59' THEN '2016'
    WHEN GETDATE() Between '20161001 00:00:00' AND '20170930 11:59:59' THEN '2017' END
    FiscalYear,
    CASE
    WHEN MONTH(GETDATE()) = '10' THEN '1'
    WHEN MONTH(GETDATE()) = '11' THEN '2'
    WHEN MONTH(GETDATE()) = '12' THEN '3'
    WHEN MONTH(GETDATE()) = '1' THEN '4'
    WHEN MONTH(GETDATE()) = '2' THEN '5'
    WHEN MONTH(GETDATE()) = '3' THEN '6'
    WHEN MONTH(GETDATE()) = '4' THEN '7'
    WHEN MONTH(GETDATE()) = '5' THEN '8'
    WHEN MONTH(GETDATE()) = '6' THEN '9'
    WHEN MONTH(GETDATE()) = '7' THEN '10'
    WHEN MONTH(GETDATE()) = '8' THEN '11'
    WHEN MONTH(GETDATE()) = '9' THEN '12' END
    FiscalMonthNbr
    from
    dimUser INNER JOIN
    audusers ON audusers.DataSetUsers_EmpFK = dimUser.EmpFK INNER JOIN
    Org ON dimUser.PrimaryDomFK = Org.Org_PK INNER JOIN
    factUserRequiredActivity ON factUserRequiredActivity.UserID = dimUser.ID INNER JOIN
    dimActivity ON dimActivity.ID = factUserRequiredActivity.ActivityID INNER JOIN
    dimRequirementStatus ON factUserRequiredActivity.ReqStatusID = dimRequirementStatus.ID LEFT OUTER JOIN
    UsrOrgs ON dimUser.ID = UsrOrgs.UserID LEFT OUTER JOIN
    UsrDoms ON dimUser.ID = UsrDoms.UserID
    WHERE
    dimActivity.ActivityName = 'GM101 Program Completion'
    AND
    dimRequirementStatus.name = 'Satisfied'
    AND
    (audusersName = @audparam)
    gm101availtbl
    AS
    select
    dimUser.EmpFK MeasureEmpFK,
    RIGHT(OrgCode2, LEN(OrgCode2) - 2) MeasurePC,
    audusersName MeasureAudName,
    Null MeasureActName,
    Null MeasureActCode,
    CASE
    WHEN OrgCode2 LIKE 'US%' then 'US'
    WHEN OrgCode2 LIKE 'CA%' then 'CA' END
    CountryCode,
    'ACTUALS_GM101' SOURCESYSTEMID,
    Null CURRENCYCODE,
    'GM101AVAIL' MEASUREID,
    Null MEASUREDOLLARS,
    CASE
    WHEN GETDATE() Between '20131001 00:00:00' AND '20140930 11:59:59' THEN '2014'
    WHEN GETDATE() Between '20141001 00:00:00' AND '20150930 11:59:59' THEN '2015'
    WHEN GETDATE() Between '20151001 00:00:00' AND '20160930 11:59:59' THEN '2016'
    WHEN GETDATE() Between '20161001 00:00:00' AND '20170930 11:59:59' THEN '2017' END
    FiscalYear,
    CASE
    WHEN MONTH(GETDATE()) = '10' THEN '1'
    WHEN MONTH(GETDATE()) = '11' THEN '2'
    WHEN MONTH(GETDATE()) = '12' THEN '3'
    WHEN MONTH(GETDATE()) = '1' THEN '4'
    WHEN MONTH(GETDATE()) = '2' THEN '5'
    WHEN MONTH(GETDATE()) = '3' THEN '6'
    WHEN MONTH(GETDATE()) = '4' THEN '7'
    WHEN MONTH(GETDATE()) = '5' THEN '8'
    WHEN MONTH(GETDATE()) = '6' THEN '9'
    WHEN MONTH(GETDATE()) = '7' THEN '10'
    WHEN MONTH(GETDATE()) = '8' THEN '11'
    WHEN MONTH(GETDATE()) = '9' THEN '12' END
    FiscalMonthNbr
    from
    dimUser INNER JOIN
    audusers ON audusers.DataSetUsers_EmpFK = dimUser.EmpFK INNER JOIN
    Org ON dimUser.PrimaryDomFK = Org.Org_PK LEFT OUTER JOIN
    UsrOrgs ON dimUser.ID = UsrOrgs.UserID LEFT OUTER JOIN
    UsrDoms ON dimUser.ID = UsrDoms.UserID
    WHERE
    audusersName = @audparam
    missingPC
    AS
    select distinct
    NULL MeasureEmpFK,
    gm101availtbl.MeasurePC,
    gm101availtbl.MeasureAudName,
    gm101availtbl.MeasureActName,
    gm101availtbl.MeasureActCode,
    gm101availtbl.CountryCode,
    gm101availtbl.SOURCESYSTEMID,
    gm101availtbl.CURRENCYCODE,
    'GM101CERT' MEASUREID,
    gm101availtbl.MEASUREDOLLARS,
    gm101availtbl.FiscalYear,
    gm101availtbl.FiscalMonthNbr
    from
    gm101availtbl LEFT OUTER JOIN
    gm101certtbl on gm101certtbl.MeasurePC = gm101availtbl.MeasurePC
    WHERE gm101certtbl.MeasurePC IS NULL
    If anybody can help, I would greatly appreciate it. I'm trying to do this so I can pull these records into a final table to count the records from the other two, but then include these as a 0 count where these departments have nobody certified.
    To test if this was working, I created a query using this Mismatch query instead as the main query. Instead, it seemed to give me the exact opposite. It seemed to be giving me all of the Departments (MeasurePC) where the records were represented.

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. We have no sample data, so we cannot even guess. 
    >> In my query, I have created two CTE's. One pulls in the records [sic] of all people who are assigned to an audience. The other pulls in all people who are assigned to the same audience AND completed a certain course. <<
    Please, please learn the basic terms. Rows are not records. And THEN learn what “redundancy” means so you will not write two CTEs in the future. 
    >> What I wanted to do from there, was to do a mismatch query, not to find the PEOPLE, but just the departments that were represented in the audience, but had no people in the list of those who completed the course. (In other words, say the HR Department
    had three people in the audience... two completed the course, one did not. The HR Department should NOT show up in my mismatch query because some of their people completed the course. THEN, say the IT Department had five people in the audience, and none of
    them have completed the course. The IT Department SHOULD show up in my mismatch query. For this case, I don't care about the people who didn't complete it, just the departments where nobody did yet.) <<
    This is a Relational Division. It is one of Dr. Codd's original 8 operations. 
    We do not use the Sybase CURRENT_TIMESTAMP any more. We have DATE data types tody, rtoo. We never tibble in good code; it is a design flaw that used meta-data affixes like “tbl” in schema object _names, PK in column _names, etc. We do not have repeated groups
    like “org_code_2”; we do not use arrays in RDBMS. Why is your data so screwed up you have use 
    CASE 
    WHEN org_code2 LIKE 'US%' THEN 'US'
    WHEN org_code2 LIKE 'CA%' THEN 'CA' END 
    to clean it up in a query; the DDL should have prevented this problem. 
    Why are you doing calendar computing in your query? Where is the Calendar table? 
    “Users.id = UsrOrgs.user_id” says that you have magic, generic “id” that can change its name from table to table. Likewise, a generic, magic “code”, etc. What might be even worse is that totally different data elements have the same name! “Automobiles, squids
    and Lady Gaga” programming is not RDBMS. 
    You have never heard of ISO-11179 and data modeling? 
    Here is a skeleton for fiscal calendar table to replace your current row by row temporal math: 
    CREATE TABLE Calendar 
    (cal_date DATE NOT NULL PRIMARY KEY, 
     fiscal_month CHAR(10) NOT NULL,
    INSERT INTO  Calendar
    VALUES 
    ('2014-10-01', '2015-01-00', ..), 
    ('2014-09-30', '2015-12-00', ..), 
    You can use a spread sheet and a text edit to fill in the table for 50 or 100 years. 
    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'
    --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

  • Cancel Query not working

    Problem Summary
    Cancel Query not working on 11.5.10
    Problem Description
    While finding orders, window pops up the cancel query but when user tries to click the cancel button, query does not cancel.

    jemar98 wrote:
    Problem Summary
    Cancel Query not working on 11.5.10
    Problem Description
    While finding orders, window pops up the cancel query but when user tries to click the cancel button, query does not cancel.Please post the details of the application release, database version and OS.
    Was this working before? If yes, any changes been done recently?
    Please review (Canceling Long Running Queries in Oracle Applications 11i [ID 138159.1]) and make sure you complete all the steps.
    Thanks,
    Hussein

  • Oracle date parameter query not working?

    http://stackoverflow.com/questions/14539489/oracle-date-parameter-query-not-working
    Trying to run the below query, but always fails even though the parameter values matches. I'm thinking there is a precision issue for :xRowVersion_prev parameter. I want too keep as much precision as possible.
    Delete
    from CONCURRENCYTESTITEMS
    where ITEMID = :xItemId
    and ROWVERSION = :xRowVersion_prev
    The Oracle Rowversion is a TimestampLTZ and so is the oracle parameter type.
    The same code & query works in Sql Server, but not Oracle.
    Public Function CreateConnection() As IDbConnection
    Dim sl As New SettingsLoader
    Dim cs As String = sl.ObtainConnectionString
    Dim cn As OracleConnection = New OracleConnection(cs)
    cn.Open()
    Return cn
    End Function
    Public Function CreateCommand(connection As IDbConnection) As IDbCommand
    Dim cmd As OracleCommand = DirectCast(connection.CreateCommand, OracleCommand)
    cmd.BindByName = True
    Return cmd
    End Function
    <TestMethod()>
    <TestCategory("Oracle")> _
    Public Sub Test_POC_Delete()
    Dim connection As IDbConnection = CreateConnection()
    Dim rowver As DateTime = DateTime.Now
    Dim id As Decimal
    Using cmd As IDbCommand = CreateCommand(connection)
    cmd.CommandText = "insert into CONCURRENCYTESTITEMS values(SEQ_CONCURRENCYTESTITEMS.nextval,'bla bla bla',:xRowVersion) returning ITEMID into :myOutputParameter"
    Dim p As OracleParameter = New OracleParameter
    p.Direction = ParameterDirection.ReturnValue
    p.DbType = DbType.Decimal
    p.ParameterName = "myOutputParameter"
    cmd.Parameters.Add(p)
    Dim v As OracleParameter = New OracleParameter
    v.Direction = ParameterDirection.Input
    v.OracleDbType = OracleDbType.TimeStampLTZ
    v.ParameterName = "xRowVersion"
    v.Value = rowver
    cmd.Parameters.Add(v)
    cmd.ExecuteNonQuery()
    id = CType(p.Value, Decimal)
    End Using
    Using cmd As IDbCommand = m_DBTypesFactory.CreateCommand(connection)
    cmd.CommandText = " Delete from CONCURRENCYTESTITEMS where ITEMID = :xItemId and ROWVERSION = :xRowVersion_prev"
    Dim p As OracleParameter = New OracleParameter
    p.Direction = ParameterDirection.Input
    p.DbType = DbType.Decimal
    p.ParameterName = "xItemId"
    p.Value = id
    cmd.Parameters.Add(p)
    Dim v As OracleParameter = New OracleParameter
    v.Direction = ParameterDirection.Input
    v.OracleDbType = OracleDbType.TimeStampLTZ
    v.ParameterName = "xRowVersion_prev"
    v.Value = rowver
    v.Precision = 6 '????
    cmd.Parameters.Add(v)
    Dim cnt As Integer = cmd.ExecuteNonQuery()
    If cnt = 0 Then Assert.Fail() 'should delete
    End Using
    connection.Close()
    End Sub
    Schema:
    -- ****** Object: Table SYSTEM.CONCURRENCYTESTITEMS Script Date: 1/26/2013 11:56:50 AM ******
    CREATE TABLE "CONCURRENCYTESTITEMS" (
    "ITEMID" NUMBER(19,0) NOT NULL,
    "NOTES" NCHAR(200) NOT NULL,
    "ROWVERSION" TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL)
    STORAGE (
    NEXT 1048576 )
    Sequence:
    -- ****** Object: Sequence SYSTEM.SEQ_CONCURRENCYTESTITEMS Script Date: 1/26/2013 12:12:48 PM ******
    CREATE SEQUENCE "SEQ_CONCURRENCYTESTITEMS"
    START WITH 1
    CACHE 20
    MAXVALUE 9999999999999999999999999999

    still not comming...
    i have one table each entry is having only one fromdata and one todate only
    i am running below in sql it is showing two rows. ok.
      select t1.U_frmdate,t1.U_todate  ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID  AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf 
       from  [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
       on t0.DocEntry = t1.DocEntry
       inner join ohem t2
       on t2.empID = t0.U_empid  where  t0.U_empid between  '830' and  '850'  and t1.U_frmdate ='20160801'  and  t1.u_todate='20160830'
    in commond promt
      select t1.U_frmdate,t1.U_todate  ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID  AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf 
       from  [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
       on t0.DocEntry = t1.DocEntry
       inner join ohem t2
       on t2.empID = t0.U_empid  where  t0.U_empid between  {?FromEmid} and  {?ToEmid} and t1.U_frmdate ={?FDate} and  t1.u_todate={?TDate}
    still not showing any results..

  • Query not working on BSIS

    SELECT BUKRS HKONT DMBTR FROM BSIS
      INTO  TABLE IT_BSIS
      WHERE HKONT = '511125'
      AND BUKRS = P_VKORG.
    this query not giving any data.. and in bsis table already i found this data..
    if u remove hkont condition it's working fine but with hkont condition giving me 0 data...
    and in table actully data exist for this selection..
    Edited by: Julius Bussche on Sep 10, 2008 10:10 AM

    Hi,
    Check carefully in the BSIS table.
    1. U have to pass the hkont field with leading zeros.
    2. is p_bukrs has some value???
    3. is it p_vkorg or p_bukrs???
    I think second one is causing the problem.
    While executing table u might not be entering BUKRS. But since it is parameter in select query it compares with blank.
    Pass some value to p_bukrs and check. u should get the data.
    another way is instead of parameter declare p_bukrs as below.
    SELECT-OPTIONS so_bukrs FOR bsis-bukrs NO INTERVALS NO-EXTENTION.
    In select query instead of = operator use IN operator
    SELECT .....
    INTO TABLE...
    FROM ...
    WHERE....
    AND bukrs IN so_bukrs.
    Hope it solves ur issue.
    Check this and get back in case of any issues.
    thanks,
    Vinod.

  • OSTC Query Not Showing Correct Percent If Component is Changed

    Hello gurus and experts...here is an interesting question:
    Question:  Why does a query not report proper Sales Tax Code percentage from OSTC table when a component is updated?
    Sales Tax Code (STC) of CA-37B, with a rate of 10.25% is made up of three parts:
    California (CA) State Tax Jurisdiction of "CA" with a rate of 7.00%,
    County Tax Jurisdiction of "CA-37" at a rate of 1.75%,
    City Tax Jurisdiction of "CA-37B" with a rate of 1.50%, and the effective date is set at 31 Dec 2008 (in the past).
    When the City Tax Jurisdiction is changed to 1.00% and date of 31 Dec 2009, the OSTC of CA-37B should be 9.75%.
    However, when a query is run on the OSTC table it strangely reports the old 10.25% (on the Sales Tax Code window it shows correctly as 9.75%).
    Here is the query - very simple...as about as simple as it gets...
    SELECT
    T0.Code,
    T0.Name,
    T0.Rate AS 'Total Tax Percentage',
    T0.Freight AS 'Freight Taxable?'
    FROM OSTC T0
    ORDER BY T0.Code
    IF we go back to the Sales Tax Code Window and change anything (description, one of the components, etc) and hit the update button, then the query reports the correct percentage.
    Am I missing something here?  I would imagine that the system must be doing something and I cannot believe the workaround is just go back and update something in the Sales Tax Code window - there are a ton of updates to do with taxes each year!  Trying to remember which component was updated can cause real confusion.  SAP B1 does a ton of automatic updates all over the system - why would it just be this area of information in OSTC???
    Thanks for reading the post, and many more thanks for your help and suggestions - Zal

    OK - Question Answered - had nothing to do with the query - user did not hit "Update" two times when doing the City Tax Jurisdiction Update...
    I knew SAP would be doing an auto update - has to!!!
    Thanks all - Zal

Maybe you are looking for