Items in session state not behaving as expected

And again...
(I hope I'm not asking too much, posting 2 new questions in under 5 min....)
This is something new I experienced: I need to show the value of an item (P210_EXTERNAL_ID) on a page (P215)
... not a big thing I thought... BUT when I tried to do this I hit the ground pretty rough (I thought I had actually gained some knowledge about html-db.)
My problem is that I pass on a lot of values from P200 (the report) to P215 (the form) and I reached the limit of characters, that can be used to specify the link (to P215).
So I thought to myself: Well, lets do it different!
I tried:
- specifying a default for the item on P215: P215_EXTERNAL_ID,
- specifying the source for P215_EXTERNAL_ID,
- creating a computation on P215_EXTERNAL_ID,
- filling P215_EXTERNAL_ID 'manually' with a process...
none of these did play the trick for me.
(By the way, I used both syntaxes to reference :P210_EXTERNAL_ID and &P210_EXTERNAL_ID.)
I used Display as Text (saves state) for the item on P215: P215_EXTERNAL_ID,
the item on P210: P210_EXTERNAL_ID is a Text Field.
The unexpected thing I experienced, was that the Item on P215 stayed empty or lagged behind:
- visit P210 with P210_EXTERNAL_ID = 1234
--- branch to P215 (P215_EXTERNAL_ID is empty)
- revisit P210 with P210_EXTERNAL_ID = 5
--- branch to P215 (P215_EXTERNAL_ID = 1234)
- revisit P210 with P210_EXTERNAL_ID = 66
--- branch to P215 (P215_EXTERNAL_ID = 5)
After realizing this I took a look at the session (with the link at the bottom of each page).
And in the Session State the value of P210_EXTERNAL_ID was the old value (always one behind)!!!
Has anybody ever seen something like this??
I'm really running out of ideas here.
-David-

Bill,
Usually I use the pass-on-only-the-PK method too, but here I built something like a consolidated view on a table: one row in the report doesn't correspond to one row in the table, but a group of rows, that are located in the same freezer, same shelf, same rack and same box. So the PK woun't work here b/c I don't have one in the first place... But the thing with referencing other pages items might do the trick to bring down the number of other values I pass on.
Another thought with the example:
- visit P210 with P210_EXTERNAL_ID = 1234
--- branch to P215 (P215_EXTERNAL_ID is empty)
- revisit P210 with P210_EXTERNAL_ID = 5
--- branch to P215 (P215_EXTERNAL_ID = 1234)
- revisit P210 with P210_EXTERNAL_ID = 66
--- branch to P215 (P215_EXTERNAL_ID = 5)
When I click on the edit button on P210 to go to P215, is the page P210 not submitted?
If that's the case, I understand why P210_EXTERNAL_ID in Session State has the last, but not the current value.... Since I branche off that page before submit, the items current values are not written to session state.
Anyone any thoughts to that???
-David-

Similar Messages

  • Submitting the value of an item with session state

    Hi,
    I've a Master / Detail Form on different pages, like master report page no.19, master form page no. 20 and detail form page no. 21. I've created this form using Form, master detail form wizard. I've set deptid as a primary key in master, and foreign key in details table. In page 21, i've set the source for deptid, source used : Always, replacing any existing value in session state, source type : Item (application or page item name), source value : P20_DEPTID. While executing the form deptid is showing the value, but, while submitting of the form, it's not saving in the table. What will be the problem??
    Thanks and Regards,
    Sudha.

    Sudha,
    OK.
    Go to the pagedefintion in page 20, click on the wordt report (of your master form).
    You will get a new screen.
    Click on the pencil-icon of your column.
    Again a new screen.
    Select the six tab (it's called LINK).
    Enter item-name and value something like :p21_dept_id and #DEPT_ID#
    where P21_dept_id is the item of the form for the dept_id
    Hope this helps.
    Leo

  • Problem with application item and session state

    Okay, let's see if I can explain this problem coherently.
    I have a small app (one page), with an application item, F_WHERE_CLAUSE.
    This page has three regions in which there are items that the users can populate for search conditions. A couple of these items are "select list with submit" (I still need to upgrade to the AJAX method, I know). There is another region which has one hidden field, called P1_WHERE_CLAUSE. This field is defined to "Always, replacing any value in session state..." with source type of "Item (application or page.....", and a source value of F_WHERE_CLAUSE with no default value.
    I have a button called "Search" which submits the page and fires a PL/SQL process which builds a where condition based upon the other page items and stores the value to the application item F_WHERE_CLAUSE (correctly).
    For testing, I've made the P1_WHERE_CLAUSE field visible so that I can see what's going on. I've also clicked the debug and session buttons to help trace this. After I click the "Search" button and the page submits, debug shows:
    0.02: ...Session State: Save "P1_WHERE_CLAUSE" - saving same value: "1=1"
    followed later by:
    0.05: ...Session State: Saved Item "F_WHERE_CLAUSE" New Value="lower(primary_class) = 'rock' and country = 'Spain'"
    The field P1_WHERE_CLAUSE displays with the correct search criteria as signified by F_WHERE_CLAUSE above. However, If I click the "session" button to view the session state values, P1_WHERE_CLAUSE shows up as:
    P1_WHERE_CLAUSE Textarea    1=1    U while F_WHERE_CLAUSE displays the correct value still.
    The reason this "problem" came up, is that this page also has three SQL report regions which use &P1_WHERE_CLAUSE. for the where condition. While they display the correct results on-screen, each report region also has the "Export to csv" enabled, and the export seems to be using the "1=1" condition (from the "session" window) instead of the search criteria that the on-screen region is using (F_WHERE_CLAUSE and the displayed P1_WHERE_CLAUSE), resulting in a retreival of all records.
    Anybody have any idea what's going on and why, and how to get the csv export to use the correct value for the where condition?
    Thanks,
    Bill Ferguson

    It appears the "Export to CSV" functionality requires the item value to be set in session state. The P1_WHERE_CLAUSE item value never gets saved to session state. The page is rendered and the value is put in the item on the page but until you submit the page session state doesn't know what P1_WHERE_CLAUSE is.
    Create a before header computation or process to set the value of P1_WHERE_CLAUSE (which will save it to session state). It is interesting that the report regions didn't need to look at the value in session state but the "export to csv" does.
    --Jeff                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Query referencing session state not consistently returning data

    Hi,
    I have a form that summarizes expense data by category for employees, per fiscal year, fiscal period, and project.
    Clicking on a button next to a particular category takes the user to a new page that should display the detail of those expenses, based on expense_code.
    The expense_code is passed via URL to the second page, and the query region for the detail has the following source:
    select exp_code, JRNL_ID_NO, DESCRIPTION, REFERENCE, CUR_PER_TRAN, CUM_YTD
    from fgspec_ac where exp_code between :P118_EXPENSE_CODE_FROM and :P118_EXPENSE_CODE_TO and project=:P114_PROJECT and fis_year=:P114_FIS_YEAR and fis_period=:P114_FIS_PERIOD
    :P118_EXPENSE_CODE_FROM and :P118_EXPENSE_CODE_TO are passed via URL, and the :P114_% fields reference data on the initial form.
    The problem is that when I click on the button to bring up the detail for the first time, the query returns no rows. If I return to the original form and click on the button a second time, the query the displays the required data. This behavior is consistent, regardless of expense category, fiscal period, etc. The first time I try to access detail, no records returned, but the second time, it works.
    I have used the 'SESSION' link to debug and view the session state in each case, and the results are IDENTICAL whether the query returns data or not. That is, all 5 variables contain the exact same data.
    Do you know what I might be doing wrong?
    Thanks,
    Michelle

    Hi guys,
    Thanks very much for your replies. In fact, I have tried both methods. Yes, I am navigating from page 114 to 118, and passing values to page 118 from page 114 (ie: P114_PROJECT passes to P118_PROJECT, etc...). In my query, I have tried referencing both, with the same results.
    When checking values in session state (by using the 'SESSION' link), values from page 114 are available in both cases (when the query returns rows and when it does not). It is very strange behavior.
    I have been developing with HTMLDB for over a year now, and never seen anything like it!!! I will try loading this on HTMLDB.oracle.com, and see if it replicates, and if so, maybe you can have a look...............
    Thanks!
    Michelle

  • Question on Processing Pattern Sessions - not behaving as expected

    I have implemented some schedulable jobs in my extensible cache configuration that are scheduled at a fixed rate and then use the processing pattern to submit work to the grid.
    However I am seeing some unexpected behaviour which does not seem to make much sense. My jobs are submitted to the grid as follows (some code edited for brevity):-
    @Override
         public void run() {
              ProcessingSession session = null;
              try {
              session = new DefaultProcessingSession(StringBasedIdentifier.newInstance("MySession"));
              SubmissionOutcome outcome = session.submit(this, new DefaultSubmissionConfiguration(),
         new TaskSubmissionCallback(taskName));
              catch (Throwable t) {
                   log.error("Failed to Submit Process Pattern Task [{}] For Session [{}]", taskName, nodeName);
              finally {
                   try {
                        session.shutdown();
                   catch (Throwable t) {
                        log.error("[{}] Failed to Shutdown Processing Pattern Session [{}]", this, nodeName);
    My tasks get scheduled and then submiited and executed in the grid. I am currently only running a single node through eclipse for testing.
    But after the task has excecuted my TaskSubmissionCallback class gets invoked and the onDone() gets called and returns my result:-
    public void onDone(Object oResult)
         log.debug("[{}] Submission done - Result = [{}]", m_sTaskName, oResult);
    So all is working. However a couple of milliseconds later I see the following in the logs:-
    2012-04-03 17:15:50.407/19.274 Oracle Coherence GE 3.6.0.4 <Error> (thread=DistributedCache:DistributedServiceForProcessingPatternSubmissionResults:EventDispatcher, member=1): The following exception was caught by the event dispatcher:
    2012-04-03 17:15:50.407/19.274 Oracle Coherence GE 3.6.0.4 <Error> (thread=DistributedCache:DistributedServiceForProcessingPatternSubmissionResults:EventDispatcher, member=1):
    java.util.concurrent.RejectedExecutionException
         at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1760)
         at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
         at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:216)
         at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:366)
         at java.util.concurrent.ScheduledThreadPoolExecutor.execute(ScheduledThreadPoolExecutor.java:438)
         at com.oracle.coherence.patterns.processing.internal.DefaultProcessingSession.removeCacheObjectsAsynch(DefaultProcessingSession.java:313)
         at com.oracle.coherence.patterns.processing.internal.DefaultProcessingSession.handleResultChange(DefaultProcessingSession.java:288)
         at com.oracle.coherence.patterns.processing.internal.DefaultProcessingSession$1.onMapEvent(DefaultProcessingSession.java:204)
         at com.tangosol.util.MultiplexingMapListener.entryUpdated(MultiplexingMapListener.java:42)
         at com.tangosol.util.MapEvent.dispatch(MapEvent.java:270)
         at com.tangosol.util.MapEvent.dispatch(MapEvent.java:226)
         at com.tangosol.util.MapListenerSupport.fireEvent(MapListenerSupport.java:557)
         at com.tangosol.coherence.component.util.SafeNamedCache.translateMapEvent(SafeNamedCache.CDB:7)
         at com.tangosol.coherence.component.util.SafeNamedCache.entryUpdated(SafeNamedCache.CDB:1)
         at com.tangosol.util.MapEvent.dispatch(MapEvent.java:270)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap$ProxyListener.dispatch(PartitionedCache.CDB:22)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap$ProxyListener.entryUpdated(PartitionedCache.CDB:1)
         at com.tangosol.util.MapEvent.dispatch(MapEvent.java:270)
         at com.tangosol.coherence.component.util.CacheEvent.run(CacheEvent.CDB:18)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.Service$EventDispatcher.onNotify(Service.CDB:26)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:619)
    I have managed to solve this by removing the session.shutdown() call in the class that submits the job for processing using the Processing Pattern. However this seems odd to me
    as the submitter should not need to hang around until the job completes (as that is surely the point of the Callback handler). I can of course code around this by having a Singleton
    class which keeps the Processing session alive constantly and stores this in the Environment. But the question is why ???
    This is running Coherence 3.6 and coherence-processingpattern-1.3.423238.
    Would be grateful to know if this is a bug or my understanding is somehow confused !
    TIA
    Martin

    I agree, believe me. However, one goes to war with the army one has, not the army one wishes one had, to quote somebody who, um... okay, failed miserably. Hmm...
    It's a flat-rate project, so the troubleshooting isn't costing them any more, and their IT department wags the rest of the company and won't buy stuff. Eventually they'll have CS4 and these problems will go away, but probably not until next year.
    If I were willing to give up the CS4-specific features (which I'm not; maximum efficiency in long documents is the core competency of my business), working in CS3 still wouldn't be an option because I don't own it. I'm also not likely to be able to talk the client into the idea that I'll take care of the last-minute tweaks instead of their having to do it all.
    (Keep in mind, too, that there's more behind the scenes than I'm necessarily sharing in a quick forum post. If I can keep the typesetting from shifting in the .inx for now, I'm good.)
    I filed that bug report--thanks!
    UPDATE: Client says it looks right. Off we go...

  • Venue 11 Pro - Slim Keyboard not behaving as expected or it should.

    I recently received the slim keyboard from dell for my Venue 11 Pro - Baytrail tablet.    Overall I like the quality and functionality, although I too like others have encountered the intermittent non-functional keyboard, but that's not the subject of this post.
    I have noticed a couple items in its behavior that don't work as you would expect and I hope can be corrected via software. 
    1. When the keyboard is attached but folded back behind the tablet (ie the keyboard is not in use) the on screen keyboard will not appear.  This makes it hard to use the device as a tablet as anytime data entry is required you need to unfold the keyboard and hold it somehow while you type then fold it back behind the screen to continue tablet use.   When folding the keyboard behind the unit its just as important to make the on screen keyboard available as it is to stop the keyboard itself from functioning,  right now the keyboard stops working as it should be no alternative input is available. 
    2. In much the same way as item #1.  When the keyboard is attached but folded back behind the tablet orientation is locked so the screen will not rotate to portrait or landscape mode at need.  So if you were carrying it with the cover / slim keyboard on and opened it up, folding the keyboard behind the screen the screen is stuck in landscape mode.   The only method ive found to change its orientation is to go to desktop and run the intel graphics app to edit the orientation.
    Combined this makes the slim keyboard worse than useless in several usage scenarios.   I want the slim keyboard for the occasional need to input more data than is practical on the touch screen AND to protect the tablet.... but if your usage is more tablet than notebook you will find yourself constantly working around these limitations.   
    You have a great product here, but you really need to take a page from the surface playbook here.   They kind of set the standard and expectations for how keyboard covers on tablets should work and while I really like the hardware the usage is awkward as it stands. 

    Just got our first Venue 11 into the office and was very disappointed to find this thread already active.  Yes, this is a very simple use-case where someone will have the slim keyboard connected and then flip it back to use the onscreen keyboard for the modern UI.  Auto screen rotation and pop-up onscreen keyboard really are a must when the keyboard is flipped back.  Not sure how that very basic behavior could have been missed in testing.  Hoping for a resolution soon...

  • GPP item-level targeting filter not working as expected

    I am trying to set the Internet Explorer homepage via user Group Policy Preferences (GPP) registry setting for a very specific group of users.  I am using item-level targeting to accomplish this but am having trouble getting the logic working as expected.
    Here is my item-level targeting filter:
    The user is a member of the security group CONTOSO\FireRescueDept
    AND this collection is false
         The user is a member of the security group CONTOSO\EmergencyManagementDept
         OR the user is a member of the security group CONTOSO\PublicSafetyDivision
    The user in question is a member of both CONTOSO\FireRescueDept and CONTOSO\EmergencyManagementDept.  I believe this means that this particular registry GPP setting should NOT apply to the user in question and that is the outcome I desire.
    Here is how I'm thinking about it:
    The user is a member of CONTOSO\EmergencyManagementDept; therefore, "The user is a member of the security group CONTOSO\EmergencyManagementDept" evaluates to TRUE.
    Since the other item in the collection is connected with the boolean OR operator, the collection evaluates to TRUE regardless of the evaluation of "The user is a member of the security group CONTOSO\PublicSafetyDivision."
    The item-level targeting filter is looking for the collection to evaluate to FALSE.  Since the collection has evaluated to TRUE, the evaluation "This collection is false" is FALSE.
    Because of the AND operator in front of "This collection is false", both "The user is a member of the security group CONTOSO\FireRescueDept" and "This collection is false" must evaluate to TRUE in order for the item-level targeting
    filter to determine that the user in question to apply the GPP setting the filter is attached to.  However, since "This collection is false" has already evaluated to FALSE, the filter as a whole should evaluate to FALSE and this GPP setting
    should not apply.
    However, according to gpresult it does apply.
    Please advise.  I want this particular setting to apply to users in the CONTOSO\FireRescueDept group unless they are a member of CONTOSO\EmergencyManagementDept and/or CONTOSO\PublicSafetyDivision.

    Am 21.05.2013 16:22, schrieb Scott W. Sander:
    > Does item-level targeting not work with Universal security groups
    > because the group policy client isn't able to determine that the user
    > is a member of groups of that type?
    In my experience, it DOES work with universal groups... Are you
    suffering from token bloat? How many groups is the user a member of?
    http://blogs.technet.com/b/shanecothran/archive/2010/07/16/maxtokensize-and-kerberos-token-bloat.aspx
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    Wenn meine Antwort hilfreich war, freue ich mich über eine Bewertung! If my answer was helpful, I'm glad about a rating!

  • CFLogin Not Behaving as Expected

    Hello,
    I'm creating a login system based on one in the live articles (found here: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24 -7c30.html#WSc3ff6d0ea77859461172e0811cbec0c8f9-7fdf ) Basically, am trying to modify the files so that the Application.cfc sets variables and returns them to the loginform (if login fails) or redirects to a secured page if login succeeds.
    Here's my modified code: (I've added comments here in blue to explain my logic)
    Application.cfc
    <cfcomponent>
    <cfset This.name = "LoginAdminTool">
    <cfset This.Sessionmanagement="True">
    <cfset This.loginstorage="session">
    <cffunction name="OnRequestStart">
        <cfargument name = "request" required="true"/>
        <cfif IsDefined("Form.logout")>
            <cflogout>
        </cfif>
        <cflogin>
            <cfif NOT IsDefined("cflogin")>
                <cfinclude template="loginform.cfm">
                <cfabort>
            <cfelse>
                <cfset Session.loginErrEmptyString = "False"> This resets values of variables in the login form
                <cfset Session.loginErrInvalidString = "False"> This resets values of variables in the login form
                <cfif cflogin.name IS "" OR cflogin.password IS ""> 
                    <cfoutput>
                        <cfset Session.loginErrEmptyString = "True"> If the string is empty, set the variable to true, return to login
                        <cflocation url="loginform.cfm">
                    </cfoutput>
                    <cfabort>
                <cfelse>
                    <cfquery name="loginQuery" dataSource="myds"> If there is a  value, validate it against my db...
                    SELECT userName, userPass, userRole
                    FROM security
                    WHERE
                        userName = '#cflogin.name#'
                        AND userPass = '#cflogin.password#'
                    </cfquery>
                    <cfif loginQuery.userRole NEQ "">
                        <cfloginuser name="#cflogin.name#" Password = "#cflogin.password#" roles="#loginQuery.userRole#">
                        <cfset Session.userLoggedIn = "True"> if a result comes back, setuser logged in to true and redirect him to index.cfm
                        <cflocation url="index.cfm">
                    <cfelse>
                        <cfoutput>
                            <cfset Session.loginErrInvalidString = "True"> Otherwise login is invalid... return to form
                            <cflocation url="loginform.cfm">
                        </cfoutput>    
                        <cfabort>
                    </cfif>
                </cfif>    
            </cfif>
        </cflogin>
    </cffunction>
    </cfcomponent>
    And here is the form:
                    <cfoutput>
                    <form action="#CGI.script_name#?#CGI.query_string#" method="Post">
                    <fieldset>
                    <ul class="logIn">
                        <li><label for="userName">Username</label></li>
                        <li><input type="text" name="j_username" id="userName"></li>
                        <li><label for="userPass">Password</label></li>
                        <li><input type="password" name="j_password" id="userPass"></li>
                        <li><input type="submit" value="Log In"></li>
                    </ul>
                    </fieldset>             
                    </form>
                    </cfoutput>
                </div><!--/box_sml-->
                <div class="box">
                    <cfif Session.LoginErrEmptyString IS "True"> If the strings were empty error comes back, the page displays this error code
                        <cfoutput>
                        <h2>You must enter text in both the Username and Password fields.</h2>
                        </cfoutput>
                    <cfelse>                   
                        <cfif Session.LoginErrInvalidString IS "True"> If login is invalid, it does that
                            <cfoutput>
                            <h2>The login information entered is invalid. Please Try again.</h2>
                            </cfoutput>
                        </cfif>
                    </cfif>
                    <cfdump var="#cgi#">
                    <cfdump var="#session#">
    The problem i am having is that, even when I am logging in correctly, the Application.cfc is not redirecting to index.cfm.... does anyone know the cause of this issue? Any help would be great appreciated... I'm sure there are many ways to code my logic better, but my intent was to avoid Application.cfc dumping html tags above the include="loginform.cfm" tag as per original script. I want to create my error messages within the form page itself..

    Test by replacing <cfif loginQuery.userRole NEQ ""> with <cfif loginQuery.recordcount GT 0>

  • Bean not behaving as expected

    OK, I have a JSP running the following script section.
    <% irCollection mgrq = new irCollection(); 
          mgrq.setMgrid("Chris Novish");
          mgrq.populateCollection();
          int pagenum;
          if (request.getParameter("p") != null) {
            String pagedatum=request.getParameter("p");
            pagenum = Integer.parseInt(pagedatum);
          } else { pagenum = 0; }
          for (int i=0;i<10;i++) {
            int rownum = pagenum * 10 + i;
            InquireRecord currec = mgrq.getCurRecords(rownum);
            out.println(currec.getID()); %>irCollection has an ArrayList property that stores a several InquireRecord objects. It gets this data from a database using the mgrid as (set in line 2 there) as the matching term.
    But I'm getting an IndexOutOfBounds exception on what appears here as line 11.
    I've done some tests, and I'm pretty sure that it's because populateCollection() isn't getting things done. I have a getSize method that gives me a size of 0.
    I made a test class in Eclipse to make sure all my methods were working:
    package com.serco.inquire;
    public class test {
         public static void main (String[] args) {
              String mgr = "Chris Novish";
              irCollection bob = new irCollection();
              bob.setMgrid(mgr);
              bob.populateCollection();
              InquireRecord fred = bob.getCurRecords(1);
              System.out.println(fred.getID());
    }That test class produces exactly what I'd expect.
    Other than the names of some of the local variables, I can't see what I'm doign different in the JSP.
    So... tell me, what noobish mistake did I make?
    for the sake of being thorough, here's the populateCollection() method:
    public void populateCollection() {
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   String filename = "inquire.mdb";
                   String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
                   database+= filename.trim() + ";DriverID=22;READONLY=true}";
                   Connection con = DriverManager.getConnection( database ,"","");
                   Statement s = con.createStatement();
                   s.execute ("SELECT * FROM inquiries WHERE manager = '" + mgrid + "'");
                   ResultSet rs = s.getResultSet();
                   int cur;
                   if (rs != null) {
                   while (rs.next()) {
                        cur = rs.getRow();
                        cur -- ;
                        int curID = rs.getInt("ID");
                        this.newIR.setID(curID);
                        String cursub = rs.getString("submitter");
                        this.newIR.setSubmitter(cursub);
                        this.iRecords.add(cur, this.newIR);
                   this.size = iRecords.size();
                   this.pages = this.size / 10;
                   int remain = this.size % 10;
                   if (remain > 0) { this.pages++; }
                             } else { System.out.println("no records."); }
              catch (Throwable e) {
                   System.out.println(e);
         }Edited by: EJP on 21/06/2011 09:15: added {noformat}{noformat} tags. Please use them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    But I'm getting an IndexOutOfBounds exception on what appears here as line 11.Line 11 of what? You've posted three separate pieces of code.
                   Statement s = con.createStatement();
                   s.execute ("SELECT * FROM inquiries WHERE manager = '" + mgrid + "'");
    PreparedStatement s = con.prepareStatement("SELECT * FROM inquiries WHERE manager = ?'", Statement.NO_GENERATED_KEYS);
    s.setObject(1, mgrid);
                   ResultSet rs = s.getResultSet();
                   int cur;
                   if (rs != null) { 'rs' cannot be null. Test is pointless.
                        cur = rs.getRow();
                        cur -- ;
    cur = rs.getRow()-1;
                        this.iRecords.add(cur, this.newIR);
    this.iRecords.add(this.newIR);'newIR' mustn't be a member variable, it should be local, and refer to a newly created instance every time around the loop. At the moment you are overwriting previous elements of 'iRecords'.
                   this.pages = this.size / 10;
    this.pages = (this.size+9)/10;
                   if (remain > 0) { this.pages++; }
                             } else { System.out.println("no records."); }Wrong message. If 'remain' is zero there may be any multiple of 10 records. You can remove this entire block: adding 9 above does all you need.

  • BDC not behaving as expected

    Hi all,
    I had done BDC for FB05. It was working fine.
    Now the requirement changed a bit and I need to pass one more field special gl indicator.
    So I added a line in the FM i created using the recording and expected that bdc should work fine. But it didn't . The filed get populated correctly but then the next screen data is not getting populated . Any Idea what could be the problem.
    perform bdc_field       using 'RF05A-NEWUM'
                                  SPL_GL_LINE_1.
    FUNCTION ZFM_FB05_BDC_BILL.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(CTU) LIKE  APQI-PUTACTIVE DEFAULT 'X'
    *"     VALUE(MODE) LIKE  APQI-PUTACTIVE DEFAULT 'N'
    *"     VALUE(UPDATE) LIKE  APQI-PUTACTIVE DEFAULT 'L'
    *"     VALUE(GROUP) LIKE  APQI-GROUPID OPTIONAL
    *"     VALUE(USER) LIKE  APQI-USERID OPTIONAL
    *"     VALUE(KEEP) LIKE  APQI-QERASE OPTIONAL
    *"     VALUE(HOLDDATE) LIKE  APQI-STARTDATE OPTIONAL
    *"     VALUE(NODATA) LIKE  APQI-PUTACTIVE DEFAULT '/'
    *"     VALUE(BLDAT_001) LIKE  BDCDATA-FVAL DEFAULT '09/09/2010'
    *"     VALUE(BLART_002) LIKE  BDCDATA-FVAL DEFAULT 'sa'
    *"     VALUE(BUKRS_003) LIKE  BDCDATA-FVAL DEFAULT 'K101'
    *"     VALUE(BUDAT_004) LIKE  BDCDATA-FVAL DEFAULT '09/09/2010'
    *"     VALUE(MONAT_005) LIKE  BDCDATA-FVAL DEFAULT '9'
    *"     VALUE(WAERS_006) LIKE  BDCDATA-FVAL DEFAULT 'USD'
    *"     VALUE(DOCID_007) LIKE  BDCDATA-FVAL DEFAULT '*'
    *"     VALUE(NEWBS_008) LIKE  BDCDATA-FVAL DEFAULT '09'
    *"     VALUE(NEWKO_009) LIKE  BDCDATA-FVAL DEFAULT '1000021'
    *"     VALUE(SPL_GL_LINE_1) LIKE  BDCDATA-FVAL DEFAULT '2'
    *"     VALUE(WRBTR_010) LIKE  BDCDATA-FVAL DEFAULT '100'
    *"     VALUE(ZFBDT_011) LIKE  BDCDATA-FVAL DEFAULT '09/09/2010'
    *"     VALUE(AGBUK_012) LIKE  BDCDATA-FVAL DEFAULT 'K101'
    *"     VALUE(AGKON_013) LIKE  BDCDATA-FVAL DEFAULT '100000'
    *"     VALUE(AGKOA_014) LIKE  BDCDATA-FVAL DEFAULT 'D'
    *"     VALUE(AGUMS_015) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(XNOPS_016) LIKE  BDCDATA-FVAL DEFAULT ''
    *"     VALUE(ABPOS_017) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(ABPOS_018) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(ABPOS_019) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(ABPOS_020) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(XPOS1_01_021) LIKE  BDCDATA-FVAL DEFAULT ''
    *"     VALUE(XPOS1_03_022) LIKE  BDCDATA-FVAL DEFAULT 'X'
    *"     VALUE(SEL01_01_023) LIKE  BDCDATA-FVAL DEFAULT '100000002'
    *"     VALUE(ABPOS_024) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(ABPOS_025) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(ABPOS_026) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(PSZAH_01_027) LIKE  BDCDATA-FVAL DEFAULT '             50'
    *"     VALUE(ABPOS_028) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(ABPOS_029) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(XPOS1_01_030) LIKE  BDCDATA-FVAL DEFAULT ''
    *"     VALUE(XPOS1_03_031) LIKE  BDCDATA-FVAL DEFAULT 'X'
    *"     VALUE(SEL01_01_032) LIKE  BDCDATA-FVAL DEFAULT '100000000'
    *"     VALUE(ABPOS_033) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(ABPOS_034) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(ABPOS_035) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(PSZAH_01_036) LIKE  BDCDATA-FVAL DEFAULT '             50'
    *"     VALUE(ABPOS_037) LIKE  BDCDATA-FVAL DEFAULT '1'
    *"     VALUE(DOC_LIST) TYPE  ZTT_DOC_LIST
    *"  EXPORTING
    *"     VALUE(SUBRC) LIKE  SYST-SUBRC
    *"  TABLES
    *"      MESSTAB STRUCTURE  BDCMSGCOLL OPTIONAL
    data wa_doc_list type zst_doc_list.
    subrc = 0.
    perform bdc_nodata      using NODATA.
    perform open_group      using GROUP USER KEEP HOLDDATE CTU.
    perform bdc_dynpro      using 'SAPMF05A' '0122'.
    perform bdc_field       using 'BKPF-BLDAT'
                                  BLDAT_001.
    perform bdc_field       using 'BKPF-BLART'
                                  BLART_002.
    perform bdc_field       using 'BKPF-BUKRS'
                                  BUKRS_003.
    perform bdc_field       using 'BKPF-BUDAT'
                                  BUDAT_004.
    perform bdc_field       using 'BKPF-MONAT'
                                  MONAT_005.
    perform bdc_field       using 'BKPF-WAERS'
                                  WAERS_006.
    perform bdc_field       using 'FS006-DOCID'
                                  DOCID_007.
    perform bdc_field       using 'RF05A-NEWBS'
                                  NEWBS_008.
    perform bdc_field       using 'RF05A-NEWKO'
                                  NEWKO_009.
    *perform bdc_field       using 'RF05A-NEWUM'
    *                              SPL_GL_LINE_1.  " Uncomment this line and the next screen '0301' values don't get populated.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-NEWUM'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF05A' '0301'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BSEG-WRBTR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SL'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  WRBTR_010.
    perform bdc_field       using 'BSEG-ZFBDT'
                                  ZFBDT_011.
    perform bdc_dynpro      using 'SAPMF05A' '0710'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-AGUMS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=PA'.
    perform bdc_field       using 'RF05A-AGBUK'
                                  AGBUK_012.
    perform bdc_field       using 'RF05A-AGKON'
                                  AGKON_013.
    perform bdc_field       using 'RF05A-AGKOA'
                                  AGKOA_014.
    perform bdc_field       using 'RF05A-AGUMS'
                                  AGUMS_015.
    perform bdc_field       using 'RF05A-XNOPS'
                                  XNOPS_016.
    perform bdc_dynpro      using 'SAPDF05X' '3100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=PART'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-ABPOS'.
    perform bdc_field       using 'RF05A-ABPOS'
                                  ABPOS_017.
    perform bdc_dynpro      using 'SAPDF05X' '3100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=OMX'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-ABPOS'.
    perform bdc_field       using 'RF05A-ABPOS'
                                  ABPOS_018.
    perform bdc_dynpro      using 'SAPDF05X' '3100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=Z-'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-ABPOS'.
    perform bdc_field       using 'RF05A-ABPOS'
                                  ABPOS_019.
    * here !!
    loop at doc_list into wa_doc_list.
    perform bdc_dynpro      using 'SAPDF05X' '3100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=OSU'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-ABPOS'.
    perform bdc_field       using 'RF05A-ABPOS'
                                  ABPOS_020.
    perform bdc_dynpro      using 'SAPDF05X' '2000'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-XPOS1(03)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=GO'.
    perform bdc_field       using 'RF05A-XPOS1(01)'
                                  XPOS1_01_021.
    perform bdc_field       using 'RF05A-XPOS1(03)'
                                  XPOS1_03_022.
    perform bdc_dynpro      using 'SAPDF05X' '0731'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-SEL01(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=GO'.
    perform bdc_field       using 'RF05A-SEL01(01)'
    *                              SEL01_01_023.
                                   wa_doc_list-belnr.
    perform bdc_dynpro      using 'SAPDF05X' '3100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=OMX'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-ABPOS'.
    perform bdc_field       using 'RF05A-ABPOS'
                                  ABPOS_024.
    perform bdc_dynpro      using 'SAPDF05X' '3100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=Z+'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-ABPOS'.
    perform bdc_field       using 'RF05A-ABPOS'
                                  ABPOS_025.
    perform bdc_dynpro      using 'SAPDF05X' '3100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'DF05B-PSZAH(01)'.
    perform bdc_field       using 'RF05A-ABPOS'
                                  ABPOS_026.
    perform bdc_field       using 'DF05B-PSZAH(01)'
    *                              PSZAH_01_027.
                                  wa_doc_list-WRBTR.
    "here
    perform bdc_dynpro      using 'SAPDF05X' '3100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=OSE'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'DF05B-PSZAH(01)'.
    perform bdc_field       using 'RF05A-ABPOS'
                                  ABPOS_028.
    endloop.
    *perform bdc_dynpro      using 'SAPDF05X' '3100'.
    *perform bdc_field       using 'BDC_OKCODE'
    *                              '=OSU'.
    *perform bdc_field       using 'BDC_CURSOR'
    *                              'RF05A-ABPOS'.
    *perform bdc_field       using 'RF05A-ABPOS'
    *                              ABPOS_029.
    *perform bdc_dynpro      using 'SAPDF05X' '2000'.
    *perform bdc_field       using 'BDC_CURSOR'
    *                              'RF05A-XPOS1(03)'.
    *perform bdc_field       using 'BDC_OKCODE'
    *                              '=GO'.
    *perform bdc_field       using 'RF05A-XPOS1(01)'
    *                              XPOS1_01_030.
    *perform bdc_field       using 'RF05A-XPOS1(03)'
    *                              XPOS1_03_031.
    *perform bdc_dynpro      using 'SAPDF05X' '0731'.
    *perform bdc_field       using 'BDC_CURSOR'
    *                              'RF05A-SEL01(01)'.
    *perform bdc_field       using 'BDC_OKCODE'
    *                              '=GO'.
    *perform bdc_field       using 'RF05A-SEL01(01)'
    **                              SEL01_01_032.
    *                              wa_doc_list-WRBTR.
    *perform bdc_dynpro      using 'SAPDF05X' '3100'.
    *perform bdc_field       using 'BDC_OKCODE'
    *                              '=OMX'.
    *perform bdc_field       using 'BDC_CURSOR'
    *                              'RF05A-ABPOS'.
    *perform bdc_field       using 'RF05A-ABPOS'
    *                              ABPOS_033.
    *perform bdc_dynpro      using 'SAPDF05X' '3100'.
    *perform bdc_field       using 'BDC_OKCODE'
    *                              '=Z+'.
    *perform bdc_field       using 'BDC_CURSOR'
    *                              'RF05A-ABPOS'.
    *perform bdc_field       using 'RF05A-ABPOS'
    *                              ABPOS_034.
    *perform bdc_dynpro      using 'SAPDF05X' '3100'.
    *perform bdc_field       using 'BDC_OKCODE'
    *                              '/00'.
    *perform bdc_field       using 'BDC_CURSOR'
    *                              'DF05B-PSZAH(01)'.
    *perform bdc_field       using 'RF05A-ABPOS'
    *                              ABPOS_035.
    *perform bdc_field       using 'DF05B-PSZAH(01)'
    *                              PSZAH_01_036.
    *"here
    perform bdc_dynpro      using 'SAPDF05X' '3100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'DF05B-PSZAH(01)'.
    perform bdc_field       using 'RF05A-ABPOS'
                                  ABPOS_037.
    perform bdc_transaction tables messtab
    using                         'FB05'
                                  CTU
                                  MODE
                                  UPDATE.
    if sy-subrc <> 0.
      subrc = sy-subrc.
      exit.
    endif.
    perform close_group using     CTU.
    ENDFUNCTION.
    INCLUDE BDCRECXY .

    I agree with Sujay.......redo recording...
    The reason of error maight be the GL Indicator.....
    Check the combination of Posting Key & GL Indicator exits or not.......by posting directly thru txn FB05....
    With the GL indicator & Posting key...might be the next screen no. changes.....just check...wild guess....
    If so....Redo the recording for each combination of PK & GL Ind.
    Thnx
    RK

  • Reader not behaving as expected...

    I'm trying to read from a java.io.Reader and I am not getting the -1 at the end of the input as expected. My code is below.
    The while(true) loop, which is the outerloop, should be broken out of as soon as the -1 is read. The problem is that the -1 is never read and the loop ends up looping infinitely.
    Any ideas?
    Reader reader = parser.getReader();
    String text = "";
    outerloop:while (true)
        if ( ! reader.ready()) Thread.sleep(50);
        innerloop:while (rdr.ready())
            int c = rdr.read();
            if (c==-1)  break outerloop;
            text += (char)c;
    }

    1) if the reader wasn't ready what assures that it
    will be ready after 50 ms?Nothing does. However, if it is not ready, then the following loop will simply not execute and the main loop will start over and it will wait another 50 ms. The alternative of putting the Thread.sleep(50) line in a loop as follows...
    while ( ! reader.ready()) Thread.sleep(50);...has gotten me in trouble in the past when the reader is finished and so is never ready, so I just end up sleeping over and over again. Of course my current implementation is also giving me an infinite loop since I'm never reading the -1, so I guess I haven't gained much.
    2) to what is that reader connected? If the reader is connect to, say, the
    standard input (keyboard), it won't return -1 unless you type ctrl-D (unix
    flavour) or ctrl-Z (ms flavour). If the reader is connected to a socket, the
    other side has to close the socket in order for your reader to detect an
    EOF condition.The reader provided by an objecet in the Apache Jakarta Lucene package. It is an HTML Parser that takes an HTML document and is supposed to write out just the text after stripping all the tags. I am supposed to be able to read this text using the Reader.
    It has occured to me that perhaps the object is not writing -1 when it is finished or is not closing the stream. In this case it would appear that whoever programmed that class did not do what he was supposed to. I'm skeptical of this line of reasoning, however, because the Apache Jakarta stuff is pretty reputable and I don't think this is just a mistake on their end.
    The object that I get the reader from launches a new thread when I call the getReader() method. Somehow this thread has to signal that it is done with the processing and I have received all the input I am ever going to get. I just don't know what this signal is. The "-1" signal that the API tells me I should get never arrives.
    Thanks for your help. Any more help would be appreciated.

  • Trigger not behaving as expected

    I have the following trigger on my table. I want to log in records which fail to insert into my main table RTS_EXCEL_UPLOAD into my audit table RTS_EXCEL_UPLOAD_BK. However, when I try to insert a bad record into my main table it throws an exception but does not log the record into RTS_EXCEL_UPLOAD_BK.
    CREATE OR REPLACE TRIGGER TRG_RTS_EXCEL_UPLOAD_BF_I
    BEFORE INSERT ON RTS_EXCEL_UPLOAD
    FOR EACH ROW
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    INSERT INTO RTS_EXCEL_UPLOAD_BK
    (LG_NAME,LG_CODE,PRODUCT_CODE,RTS_PERCENTAGE,LAST_UPDATE_DATE,LAST_UPDATE_USER,COUNTRY_ID)
    VALUES
    (:new.LG_NAME,:new.LG_CODE,:new.PRODUCT_CODE,:new.RTS_PERCENTAGE,:new.LAST_UPDATE_DATE,:new.LAST_UPDATE_USER,:new.COUNTRY_ID)
    DBMS_OUTPUT.PUT_LINE('TRIGGER FIRED');
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('TRIGGER NOT FIRED');
    END;
    CREATE TABLE RTS_EXCEL_UPLOAD_BK
    (LG_NAME VARCHAR2(256)
    ,LG_CODE VARCHAR2(256)
    ,PRODUCT_CODE VARCHAR2(256)
    ,RTS_PERCENTAGE VARCHAR2(256)
    ,LAST_UPDATE_DATE VARCHAR2(256)
    ,LAST_UPDATE_USER VARCHAR2(256)
    ,COUNTRY_ID VARCHAR2(256));
    CREATE TABLE RTS_EXCEL_UPLOAD
    ((LG_NAME VARCHAR2(256)
    ,LG_CODE NUMBER
    ,PRODUCT_CODE VARCHAR2(256)
    ,RTS_PERCENTAGE VARCHAR2(256)
    ,LAST_UPDATE_DATE VARCHAR2(256)
    ,LAST_UPDATE_USER VARCHAR2(256)
    ,COUNTRY_ID VARCHAR2(256));
    INSERT INTO RTS_EXCEL_UPLOAD (LG_CODE)VALUES('A1');
    this is not inserting record into my audit table RTS_EXCEL_UPLOAD_BK as expected.

    Hi,
    You can use FORALL SAVE EXCEPTIONS to audit in your backup table.
    Let us see the example below :
    create table test_tab
    col1 number,
    col2 varchar2(20),
    constraint test_tab_ck check  ( col1 in (1,2,3))
    create table test_tab_bk
    col1 number,
    col2 varchar2(20)
    SET serveroutput ON
    DECLARE
         CURSOR cur_insert
         IS
         SELECT
              ROUND(dbms_random.value(1,4)) AS col1,
              '#######'                     AS col2
         FROM
              dual
         CONNECT BY level <= 10;
         TYPE rec_insert_tbl IS   TABLE OF cur_insert%ROWTYPE INDEX BY PLS_INTEGER;
         insert_tbl rec_insert_tbl;
         /* Exceptions */
         dml_errors EXCEPTION;
         PRAGMA EXCEPTION_INIT(dml_errors, -24381);
         /*Variables*/
         w_error_count NUMBER;
    BEGIN
         OPEN cur_insert;
         FETCH cur_insert bulk collect INTO insert_tbl;
         BEGIN
         FORALL idx IN insert_tbl.FIRST .. insert_tbl.LAST SAVE EXCEPTIONS
         INSERT
         INTO
           test_tab
              col1,
              col2
           VALUES
              insert_tbl(idx).col1,
              insert_tbl(idx).col2
         EXCEPTION
              WHEN dml_errors THEN
              w_error_count := SQL%BULK_EXCEPTIONS.count;
              FOR i  IN 1 .. w_error_count
              LOOP
                dbms_output.put_line ( 'Error: ' || i || ' Array Index: ' || SQL%BULK_EXCEPTIONS(i).error_index
                || ' Message: ' || SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE) ) ;
                  /* Again looping through the data which is to inserted */
                   FOR idx IN  insert_tbl.FIRST .. insert_tbl.LAST
                   LOOP
                        /* If the index of the cursor is same as error index, insert in the Backup table */
                        IF idx = SQL%BULK_EXCEPTIONS(i).error_index THEN
                             INSERT
                             INTO
                               test_tab_bk
                                  col1,
                                  col2
                               VALUES
                                  insert_tbl(idx).col1,
                                  insert_tbl(idx).col2
                          END IF;
                     END LOOP;
              END LOOP;
         END;
         CLOSE cur_insert;
      commit;
    END;
    select * from test_tab;
    select * from test_tab_bk;This will work, but not sure if it can be implemented in your code.
    This solution is also not great performance wise as for backup table we are inserting row by row.
    LOG ERRORS INTO is still the best solution(both in usability and performance wise) and if possible try to use it.

  • Case statement not working as expected

    I get this error having the group by clause: ORA-00979: not a GROUP BY expression
    I get this error with out it: ORA-00937: not a single-group group function
    If I add sp.PUBLISHER_ID to the group by, my data comes out on separate lines like this:
    BT jlloyd ALLEN IVERSON B 0 3 0
    BT jlloyd ALLEN IVERSON B 1 0 0
    What am I doing wrong?
    select distinct office_id,user_id,
    nvl(customer, profile_name),
    nvl(account, profile_name),
    profile_name,
    profile_type,
    case when sp.PUBLISHER_ID = 503
    then count(distinct sp.instance_id)
    else 0 end as MR_Reports ,
    case when sp.PUBLISHER_ID = 501
    then count(distinct sp.instance_id)
    else 0 end as QV_Reports,
    case when sp.PUBLISHER_ID = 3533
    then count(distinct sp.instance_id)
    else 0 end as BS_Reports
    from vw_profile_info p join SOLD_PUBLISHERS sp
    on p.profile_id = sp.profile_id
    join SOLD_SEGMENTS ss
    on ss.profile_id = sp.PROFILE_ID
    and ss.instance_id = sp.instance_id
    and ss.BASKET_ID = sp.basket_id
    join publishers p
    on p.publisher_id = sp.publisher_id
    where sp.publisher_id in (501,503,3533)
    and sp.PUBLISHED_DATE between to_date('10/01/2005','mm/dd/yyyy') and
    to_date('10/31/2005','mm/dd/yyyy')
    and profile_name = 'ALLEN IVERSON
    group by office_id,user_id,
    nvl(customer, profile_name),
    nvl(account, profile_name),
    profile_name,
    profile_type

    There are couple of ways, one of them would be
    select office_id,
           user_id,
           nvl(customer, profile_name),
           nvl(account , profile_name),
           profile_name,
           profile_type,
           sum(decode(sp.PUBLISHER_ID,  503, 1, 0) MR_Reports,
           sum(decode(sp.PUBLISHER_ID,  501, 1, 0) QV_Reports,
           sum(decode(sp.PUBLISHER_ID, 3533, 1, 0) BS_Reports
    from vw_profile_info p join SOLD_PUBLISHERS sp
         on p.profile_id = sp.profile_id
         join SOLD_SEGMENTS ss
         on ss.profile_id = sp.PROFILE_ID
         and ss.instance_id = sp.instance_id
         and ss.BASKET_ID = sp.basket_id
         join publishers p
         on p.publisher_id = sp.publisher_id
    where sp.publisher_id in (501,503,3533)
    and sp.PUBLISHED_DATE between to_date('10/01/2005','mm/dd/yyyy') and to_date('10/31/2005','mm/dd/yyyy')
    and profile_name = 'ALLEN IVERSON'
    group by office_id,
             user_id,
             nvl(customer, profile_name),
             nvl(account , profile_name),
             profile_name,
             profile_type

  • Selection statement not working as expected

    The hotter and cooler methods are the ones in question. It just prints "Cannot go below the minimum temperature" ,no matter what value I set increment, min, or max to. It also does not change the value of temperature.
    I've already tried adding parentheses like this : if ((temperature - incremen)t <= min)
    public class Heater
        //the current temperature
        private int temperature;
        //the minimum temperature
        private int min;
        //the maximum temperature
        private int max;
        private int increment;
        public Heater(int minimum, int maximum)
            min = minimum;
            max = maximum;
            increment = 5;
            temperature = 15;
        //decreases the temperature by 5
        public void cooler()
            if (temperature - increment <= min)
            temperature = temperature - increment;
            else
            System.out.println("Cannot go below the minimum temperature");
        //increases the temperature by 5
        public void hotter()
            if (temperature + increment >= max)
            temperature = temperature + increment;
            else
                System.out.println("Cannot go above the maximum temperature");
       //sets the amount to increment the heat by
        public void setIncrement(int incrementAmount)
            if (incrementAmount > 0)
            increment = incrementAmount;
            else
            System.out.println("Please enter a positive amount");
        //returns the current temperature
        public int getTemperature()
            return temperature;
    }

    Hi,
    you mixed the conditions. you want to stay above minimum and below maximum:
    if (temperature - increment >= min)
    if (temperature + increment <= max)

  • Cache Management: Firefox does not behave as expected when setting cache preferences

    I presently play a game online and override my cache management. I Set in the preferences the following parameters.
    browser.cache.disk.max_entry_size = 2000:
    browser.cache.disk.smart_size.enabled = false
    However, when I check the properties of the cache folder it currently shows 2200.
    Here is a subset of the problem I am experiencing. There are alot of files stored in cache_001, 002 and 003 which do not get stored on disk. I use mozillacacheview to view the cache. Is there a way to remove these files without deleting the entire cache.

    no problem, i'm not sure if understand your follow-up question correctly. _cache_001_ 002, 003 contain a mix of index files, metadata and data of the cache itself, so it woudn't be safe to delete those whole files in windows when you want to keep the integrity of the cache intact. i don't know if mozillacacheview offers the option to selectively remove files from the cache, but i think this extension does: [https://addons.mozilla.org/firefox/addon/cacheviewer-continued/]

Maybe you are looking for

  • Error while ipmorting dev configuration in NWDS

    HI          I am getting error as "<i>No configurations on server or server error</i>" while trying to import development configuratios in NWDS 2.0.7. I am using WAS 6.40 sp 9 . plz provide me some idea what to do.          I thought may be its becau

  • Posting date and posting periods

    HI Experts, I am practicing IDES for SD. While using T VL02N for post good Issue I got this error: <b>Posting only possible in periods 2006/12 and 2006/11 in company code 1000 Message no. M7053 Diagnosis The posting date entered is not within one of

  • Strange e4200 FTP problem

    I have an odd problem with the FTP server. I currently hooked up a 250GB portable HDD which is formatted in NTFS. A single folder in the root of the drive is mounted as the FTP server. Every time I upload a zip or far, the file comes out ends up bein

  • Inspection Time in planning

    Hi, We are using CTM mfor Production Planning, inspection time is defined for the product in ECC. The code for product before and after inspection activity is same, and no seperate operation is defined for product. In ECC we are using standard proces

  • How to upgrade Kernal for ECC 5.0?

    Hi, I have installed a new SAP ECC 5.0 system. The release verion shows the current Release as 6.4 and Patch Level 43. Now I want to apply the latest patch on Kernal. Can any one please provide me the steps for 1). How to proceed with the Kernal upga