Problems with List Implementation

I have a list implementation that is like a linked list but contains 'n' elements in each node, set to 8 by default.
The list has a head node, and a tail node.
This is a revisit on an assignment, I'm trying to fix it.
The problem is when a number of elements have been added and then deleted from the end of the list. Then more elements are added.
I'm using a JUnit test case to test this, and what happens is about 25 elements are added and removed, but when it gets to adding a new elements after recently deleting some items towards the end of the list. My list fails because, I am unable to assign value to my tail from within my iterator.
The compiletime error I get is:
Type mismatch: cannot convert from chunklist.ChunkList<T>.Chunk<T> to chunklist.ChunkList<T>.Chunk<T>
I need to assign my tail to the previous Chunk (node), because in my iterator when I delete a Chunk the tail doesn't get automatically assigned to the previous.
Anyone know how I can get around this retarded error? or what I can do to solve my problem?
Edit: casting to Chunk<T> doesn't work either it's the same compiletime error
I have deleted all irrelevant methods and comments from this: The error is in the deleteChunk() method. I need to point tail back to the previous node there.
package chunklist;
import java.util.AbstractCollection;
import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;
public class ChunkList<T> extends AbstractCollection<T>
    @SuppressWarnings({ "unchecked", "hiding" })
    private class Chunk<T>
        private T[] data;
        private Chunk<T> next;
        private int chunkSize;
        public Chunk()
            this.data = (T[])new Object[ARRAY_SIZE];
            this.next = null;
            this.chunkSize = 0;
        public boolean equalsChunk(Chunk<T> c)
            if (c == null)
                return false;
            else if (this.chunkSize != c.chunkSize)
                return false;
            else if (this.next != c.next)
                return false;
            else
                for(int i=0; i<this.chunkSize; ++i)
                    if (!(this.data.equals(c.data[i])))
return false;
return true;
}// end of Chunk<T>
@SuppressWarnings({ "hiding", "unchecked" })
private class ChunkItr<T> implements Iterator<T>
private Chunk<T> currentChunk;
private Chunk<T> previousChunk;
private Chunk<T> nextChunk;
private int currentElement;
public ChunkItr()
currentChunk = (Chunk<T>) head;
previousChunk = null;
nextChunk = (Chunk<T>) head.next;
currentElement = 0;
@Override
public boolean hasNext()
if (currentChunk == null)
return false;
else
if (currentElement < currentChunk.chunkSize)
return true;
return (currentChunk.next != null);
@Override
public T next()
if (!hasNext())
throw new NoSuchElementException();
T elementToReturn = null;
while (elementToReturn == null)
if ((currentElement == ARRAY_SIZE) ||
(currentElement == currentChunk.chunkSize))
previousChunk = currentChunk;
currentChunk = currentChunk.next;
currentElement = 0;
if (nextChunk != null)
nextChunk = currentChunk.next;
if (currentChunk.data[currentElement] != null)
elementToReturn = (T) currentChunk.data[currentElement];
++currentElement;
return elementToReturn;
@Override
public void remove()
if (currentChunk == null)
throw new IllegalStateException();
else
for (int i=currentElement-1;i<currentChunk.chunkSize;++i)
{ // shift everything down
if ( (i != 7) && (i >= 0) )
currentChunk.data[i] = currentChunk.data[i+1];
else if (i==7)
break;
currentChunk.data[currentChunk.chunkSize-1] = null;
--currentChunk.chunkSize;
--numOfElements;
--currentElement;
if (currentElement < 0)
currentElement = 0;
if (currentChunk.chunkSize <= 0)
deleteChunk();
public void deleteChunk()
if (previousChunk == null) //* @head *//
if (head.next != null)
head = head.next;
currentChunk = (Chunk<T>) head;
nextChunk = currentChunk.next;
currentElement = 0;
else currentElement=0;
else if (nextChunk == null) //* @tail *//
currentChunk = previousChunk;
currentChunk.next = null;
nextChunk = currentChunk.next;
currentElement = currentChunk.chunkSize;
tail = currentChunk; // THIS DOESN'T WORK, << ERROR HERE
else //* @middle *//
currentChunk = currentChunk.next;
previousChunk.next = currentChunk;
nextChunk = currentChunk.next;
currentElement = 0;
// back @ head? (just deleted Chunk before head)
if (currentChunk.equalsChunk((Chunk<T>) head))
previousChunk = null;
} // end ChunkItr
private static final int ARRAY_SIZE = 8;
private Chunk<T> head;
private Chunk<T> tail;
private int numOfElements;
public ChunkList()
head = null;
tail = null;
numOfElements = 0;
public void addNewChunk()
if (head == null)
head = new Chunk<T>();
tail = head;
else
tail.next = new Chunk<T>();
tail = tail.next;
@Override
public boolean add(T t)
if (t == null)
throw new IllegalArgumentException();
if (head == null)
addNewChunk();
if (tail.chunkSize == ARRAY_SIZE)
addNewChunk();
tail.data[tail.chunkSize] = t;
numOfElements++;
tail.chunkSize++;
return true;
@Override
public Iterator<T> iterator()
return new ChunkItr<T>();
@Override
public boolean remove(Object o)
// creates iterator and calls iterators remove method when it finds o.
Edited by: G-Unit on Nov 14, 2010 5:07 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

YoungWinston wrote:
Possibly, but I suspect you'll need to be prepared to defend your design choice with more than just test results. Why did you choose this pattern? Because it's an assignment. I will do some reading when I get around it to it. But for now I don't have time, and don't care to make time. This assignment was annoying as... So many fiddly little errors that took me too long to figure out. For now I hate Lists, I'm happy using the default ones.
1. Introduction
This document is the Project Specification for a ChunkList class to be developed by DBSD202 students this semester.
2. What you must do
The requirements specifications are detailed below:
ChunkList
In this first part of the assignment we will create a data structure called a ChunkList. The ChunkList class implements the Collection interface and >>serves a replacement for ArrayList or LinkedList. A ChunkList is like a regular linked list, except each node contains a little fixed size array of elements >>instead of just a single element. Each node also contains its own "size" int to know how full it is.
The ChunkList will have the following features...
The ChunkList object contains a head pointer to the first chunk, a tail pointer to the last chunk, and an int to track the logical size of the whole >>collection. When the size of the list is 0, the head and tail pointers are null.
Each chunk contains a fixed size T[] array, an int to track how full the chunk is, and a next pointer. The constant ARRAY_SIZE = 8; in the chunk >>class defines the fixed size of the array. Elements should be added to the array starting at its 0 index. The elements in each little array should be >>kept in a contiguous block starting at 0 (this will require shifting elements around in the little array at times). (You may want to do some testing >>with ARRAY_SIZE set to smaller values, but turn it in set to 8.)
ChunkList should be a subclass of AbstractCollection which provides some basic facilities built on top of your add(), iterator(), size() etc. primitives. >>Chunk should be an inner class defined inside of ChunkList. Only ChunkList will see or use the Chunk class directly. It's stylistically ok if ChunkList >>accesses the state (.next, .data, ...) of the Chunk objects, since Chunk essentially is just an integrated part of ChunkList. Add utility methods to >>Chunk where it helps to keep things receiver-
relative (remove for example). ChunkIterator should be a private inner class as in the lecture example.
ChunkList must support the messages: constructor, add(), size(), and iterator(). The iterator must support hasNext(), next(), and remove(). It's >>valid for the client to add "null" as an element, so you cannot use null as some sort of special marker in the array -- use your size int in each chuck. >>Make sure that size() and hasNext() are consistent about the size of the collection.
The empty collection should be implemented as null head and tail pointers. Only allocate chunks when actually needed.
The add() operation should add new elements at the end of the overall collection -- i.e. new elements should always go into the tail chunk. If the >>tail chunk is full, a new chunk should be added and become the new tail. We are not going to trouble ourselves shifting things around to use >>empty space in chunks in the middle of the list. We'll only look at the tail chunk.
Do not use a dummy node because (a) it does not help the code much, and (b) dummy nodes are lame.
Keep a single "size" variable for the whole list that stores the total number of client data elements stored in the list, so you can respond to size() in >>constant time. Similarly, keep a separate size in each chunk to know how full it is. Likewise, add(), hasNext(), next(), and remove() should all run in >>O(1) constant time (they may do computations proportional to ARRAY_SIZE, but not proportional to the overall collection length).
When using iterator.remove() to remove an element from a Chunk, overwrite the pointer to that element with a null to help the garbage >>collector. This is not a requirement, but it's a nice touch.
When an iterator.remove() operation causes a chunk to contain zero elements, that chunk should be removed from the list immediately. The code >>for deletion is quite tricky. You may store a "previous" pointer in each chunk if you wish. It is possible to code it without previous pointers by >>keeping extra pointers in the iterator to remember the two previously seen chunks during iteration. Chunk deletion will need to work for many >>boundary cases -- the first chunk, the last chunk, and so on. This is probably the trickiest part of the whole thing.
When called with correct inputs, ChunkList should return the correct result. However, when called with incorrect inputs -- e.g. iterator.remove() >>without first calling next() -- ChunkList does not need to do anything in particular. It's fine if
your code just gives the wrong output or throws a null pointer or other exception. This is a slight relaxation of the formal Collection interface which >>guarantees to throw particular exceptions for particular errors.
ChunkList Advice — Tight Code
The ChunkIterator is a tricky bit of code. There are about 4 different cases to get right, depending on if the removed chunk was first or last in the >>list. Don't have a separate copy of the remove code for each special case. If you find yourself copying and pasting code, you're doing it wrong. >>Clean up the solution so there is one copy of the remove code and then a few lines to deal with the special cases. This is just general coding style >>advice – avoid proliferating copies of the code for slightly different cases. Try to factor the code down so one copy of the code deals with many >>cases. The remove() method should be about 15 lines long.
Testing
The ChunkList is extremely well suited to unit-testing. This is good, since the ChunkList has such a large number of tricky little boundary cases >>where it can go awry. We will unit-test the ChunkList aggressively, since it's the best way to get the code right.
1. ChunkList Basic Testing
To get started, write some basic unit tests that build up a ChunkList of Strings with add(), and then iterate over it and remove a few elements, >>checking that the list look right before and after the removes. These tests will get the most basic add()/iterator()/remove() code working.
2. ChunkList Super Test
I will provide code for an extremely aggressive test on the ChunkList. Only try this after your basic tests are working. Because the ArrayList (known >>to be correct) and the ChunkList both implement the Collection interface, we can use a unit-test strategy where we do the same operation on >>both an ArrayList and ChunkList, and then verify that they get the same output after each operation.
The SuperTest creates both an ArrayList and a ChunkList. We'll call an "operation" either a single addition or an iteration down the collection doing >>a few random removes. Do the same random operation to both the ArrayList and ChunkList, and then check that the two look the same, element >>by element. Then loop around and do that 4999 more times, checking the two again after each random operation. We want to push on the >>ChunkList
to get every weird combination of list length and this or that chunk being full or empty at the time of add or series of removes in some position.
When you get it take a look at the SuperTest code. It creates a Random(1) for its random number generation, object passing 1 as the seed. In >>this way, the series of "random" operations is the same every time the test is run.
3. ChunkList SpeedTest
The unit-tests should work on the correctness of the ChunkList, and that's the most important thing. Look at the source of the provided >>ChunkSpeed class and try running it. It runs a timing test on the ArrayList, LinkedList, and ChunkList classes. The test is a crude simulation of >>collection add/remove/iterate use. ChunkSpeed prints the milliseconds required to do the following representative mix of operations...
- Use add() to build a 50,000 element collection
- Create an iterator to iterate halfway through the collection
- Use the iterator to remove 10,000 elements at that point
- Creates and runs iterators to run over the whole collection 5 times
The speeds seen depend on many factors, including the ARRAY_SIZE, the specific hardware, the system load, JVM version, etc., and some runs >>will be way off because the GC thread runs during part of the test. Broadly speaking, on average the ChunkList should be roughly as fast or faster >>than the LinkedList, and a lot faster (a factor of 10 or so) than the ArrayList. The speed numbers have a lot of noise in them, so don't worry about >>a single run. The ChunkList might be slower than the LinkedList on occasion. However, if your ChunkList is consistently slower than the Linked List >>or ArrayList, there is probably something wrong with your ChunkList algorithm -- some operation that is supposed to be O(1) is O(n). The most >>important methods to be fast are hasNext() and next(), since they are the most commonly called by the client.Edited by: G-Unit on Nov 15, 2010 7:31 AM
Edited by: G-Unit on Nov 15, 2010 7:44 AM

Similar Messages

  • Problem with list and map in GWT

    I have a problem with map and list in GWT. I need to put a map in to a list but GWT does not support ArrayList and HashMap since they are not serialized types.
    Exactly I want to create following list with out using ArrayList and HashMap
    ArrayList<HashMap<String, Object>> map = new ArrayList<HashMap<String,Object>>(); Thank you for new ideas,
    Regards

    If try to use ArrayList then I receive following exception when I make a rpc call.
    Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'java.util.ArrayList' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.:

  • Problem with JPA Implementations and SQL BIGINT in primary keys

    I have a general Question about the mapping of the SQL datatype BIGINT. I discovered, that there are some different behaviour depending on the JPA implementation. I tested with TopLink Essentials (working) and with Hibernate (not working).
    Here is the case:
    Table definition:
    /*==============================================================*/
    /* Table: CmdQueueIn */
    /*==============================================================*/
    create table MTRACKER.CmdQueueIn
    CmdQueueInId bigint not null global autoincrement,
    Type int,
    Cmd varchar(2048),
    CmdState int,
    MLUser bigint not null,
    ExecutionTime timestamp,
    FinishTime timestamp,
    ExecutionServer varchar(64),
    ScheduleString varchar(64),
    RetryCount int,
    ResultMessage varchar(256),
    RecordState int not null default 1,
    CDate timestamp not null default current timestamp,
    MDate timestamp not null default current timestamp,
    constraint PK_CMDQUEUEIN primary key (CmdQueueInId)
    The java class for this table has the following annotation for the primary key field:
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "CmdQueueInId", nullable = false)
    private BigInteger cmdQueueInId;
    When using hibernate 3.2.1 as JPA provider I get the following exception:
    avax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:218)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:176)
    at $Proxy16.persist(Unknown Source)
    at com.trixpert.dao.CmdQueueInDAO.save(CmdQueueInDAO.java:46)
    at com.trixpert.test.dao.CmdQueueInDAOTest.testCreateNewCmd(CmdQueueInDAOTest.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at
    Caused by: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
    at org.hibernate.id.IdentifierGeneratorFactory.get(IdentifierGeneratorFactory.java:59)
    at org.hibernate.id.IdentifierGeneratorFactory.getGeneratedIdentity(IdentifierGeneratorFactory.java:35)
    at org.hibernate.id.IdentityGenerator$BasicDelegate.getResult(IdentityGenerator.java:157)
    at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:57)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2108)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2588)
    at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
    at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
    at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
    at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180)
    at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108)
    at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
    at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:212)
    ... 34 more
    This means, that their ID generator does not support java.math.BigInteger as datatype.
    But the code works if I take TopLink essentials as JPA Provider.
    Looking at the spec shows the following:
    In chapter 2.1.4 "If generated primary keys are used, only integral types will be portable." Integral datatypes are byte, short, int, long and char. This would mean, that the Hibernate implementation fits the spec but there seem to be a problem in general with BIGINT datatypes.
    I use a SYBASE database. There it is possible to declare a UNSIGNED BIGINT. The range of numbers is therefore 0 - 2^64 - 1. Since in Java a long is always signed it would mean its range is from -2^63 -1 to 2^63 -1. So a mapping of BIGINT to java.lang.long could result in an overflow.
    The interesting thing is, that I used NetBeans to reverse engineer an existing database schema. It generated for all Primary Keys of Type BIGINT automatically a java.math.BigInteger. But for other fields (not being keys) it mapped BIGINTs to java.lang.long.
    It looks like there are some problems with either the spec itself or the implementation of it. While TopLink seems to handle the problem correctly, Hibernate doesn't. But Hibernate seems to fulfill the spec.
    Is anybody familiar with the Spec reading this and can elaborate a little about this situation?
    Many thanks for your input and feedback.
    Tom

    Not sure if I clearly understand your issue, would be good if you can explain it a bit more clearly.
    "I select a value from LOV and this value don't refresh in the view"
    If you mean ViewObject, check if autoSubmit property is set to true.
    Amit

  • ADF: Problem with List and ListOfValues bindings

    In my page I have panelSplitter.
    In first facet I have panelCollection with ADF tree. For the tree definition I have Iterator binding, which contains the elements with no parent and one accessor, which define a recursive master-detail hierarchy. For the tree node I have specified TragetIterator property, that look up second iterator binding, which containes all tree elements (parents and their children).
    In second facet I have panelForm with input fields, based on second iterator binding. So when the user clicks on any node in the tree, it can see and edit in input fields the data for this node.
    In panelCollection I have placed two buttons to create a new node and to delete current node.
    By creation of new node I do the following:
    1) From currently selected node I get the value of one attribute named Code, which is alternate unique key;
    2) From second iterator binding I get the ViewObject, create a new Row and for the "parent" attribute I set the value derived from step 1.
    3) I rerender through PPR tree component and PanelForm with input fields.
    As result I have a new empty node in the tree and empty input fields in second facet, which must be populated and submitted (commited).
    My problem happens after I populate all fields in panelForm, when I commit changes (press Button with Commit action binding) and rerender page content. The exception, which is trown is listed below.
    I want to make the follwing additional remarks:
    1) My primary key in ViewObject is ROWID. I need this attribute to uniquely identify created new rows.
    2) The problem happens only when in panelForm I have field based on Model driven List or ListOfValues binding (<af:selectOneChoice> or <af:inputListOfValues>).
    When I create a new row the ADF BC assign to it one "dummy" ROWID (for example 317499) and after Commit this ROWID is replaced wtih actual ROWID from database. But I don't understand, why after commit of changes on the page the method findByKey of oracle.jbo.server.ViewObjectImpl is called with initial "dummy" ROWID (317499)?
    When there is no field based on List or ListOfValues binding, then there are no calls of findByKey method and there is no such problem.
    And that is the exception:
    2009-7-29 18:04:54 oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
    WARNING: ADFc: ORA-01410: невалиден ROWID
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT OU.CODE, OU.NAME, OU.ABBREVIATION, OU.ORGUNIT_TYPE, OU.PARENT_UNIT, OU.IS_VALID, OU.ROWID FROM ORG_UNITS OU WHERE (OU.ROWID = :1)
         at oracle.jbo.server.BaseSQLBuilderImpl.processException(BaseSQLBuilderImpl.java:3837)
         at oracle.jbo.server.OracleSQLBuilderImpl.processException(OracleSQLBuilderImpl.java:4621)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:1150)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:762)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:5681)
         at nsi.isbs.dmc.common.IsbsViewObjectImpl.executeQueryForCollection(IsbsViewObjectImpl.java:56)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1005)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:1162)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:1082)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:1076)
         at oracle.jbo.server.ViewObjectImpl.retrieveByKey(ViewObjectImpl.java:13994)
         at oracle.jbo.server.ViewObjectImpl.retrieveByKey(ViewObjectImpl.java:13758)
         at oracle.jbo.server.ViewObjectImpl.retrieveByKey(ViewObjectImpl.java:13752)
         at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:4891)
         at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:4679)
         at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:4673)
         at oracle.jbo.server.ViewObjectImpl.findByKey(ViewObjectImpl.java:9456)
         at oracle.jbo.server.ApplicationModuleImpl.getListBindingName(ApplicationModuleImpl.java:8421)
         at oracle.adf.model.bc4j.DCJboDataControl.getListBindingName(DCJboDataControl.java:2244)
         at oracle.jbo.uicli.binding.JUCtrlListBinding.initDefFromServerBinding(JUCtrlListBinding.java:2366)
         at oracle.jbo.uicli.binding.JUCtrlListBinding.getAttributeDefs(JUCtrlListBinding.java:2327)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDef(JUCtrlValueBinding.java:497)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDef(JUCtrlValueBinding.java:487)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.isInternalAttributeUpdateable(JUCtrlValueBinding.java:3262)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.isAttributeUpdateable(JUCtrlValueBinding.java:1617)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.isAttributeUpdateable(JUCtrlValueBinding.java:1695)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.isUpdateable(JUCtrlValueBinding.java:2512)
         at oracle.jbo.uicli.binding.JUCtrlListBinding.isUpdateable(JUCtrlListBinding.java:3357)
         at oracle.adfinternal.view.faces.model.AdfELResolver._isReadOnly(AdfELResolver.java:85)
         at oracle.adfinternal.view.faces.model.AdfELResolver.isReadOnly(AdfELResolver.java:101)
         at javax.el.CompositeELResolver.isReadOnly(CompositeELResolver.java:353)
         at com.sun.faces.el.FacesCompositeELResolver.isReadOnly(FacesCompositeELResolver.java:113)
         at com.sun.el.parser.AstValue.isReadOnly(AstValue.java:128)
         at com.sun.el.ValueExpressionImpl.isReadOnly(ValueExpressionImpl.java:230)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.getReadOnly(EditableValueRenderer.java:400)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.wasSubmitted(EditableValueRenderer.java:341)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.decodeInternal(EditableValueRenderer.java:113)
         at oracle.adfinternal.view.faces.renderkit.rich.SimpleInputListOfValuesRendererBase.decodeInternal(SimpleInputListOfValuesRendererBase.java:88)
         at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.decodeInternal(LabeledInputRenderer.java:55)
         at oracle.adf.view.rich.render.RichRenderer.decode(RichRenderer.java:236)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.__rendererDecode(UIXComponentBase.java:1089)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.decode(UIXComponentBase.java:714)
         at oracle.adf.view.rich.component.UIXInputPopup.processDecodes(UIXInputPopup.java:134)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:970)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:956)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:812)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:970)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:956)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:812)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:970)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:956)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:812)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:970)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:956)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:812)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:970)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:956)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes(UIXComponentBase.java:812)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$ApplyRequestValuesCallback.invokeContextCallback(LifecycleImpl.java:1113)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.invokeOnComponent(ContextSwitchingComponent.java:153)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.invokeOnComponent(ContextSwitchingComponent.java:153)
         at oracle.adf.view.rich.component.fragment.UIXPageTemplate.invokeOnComponent(UIXPageTemplate.java:208)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
         at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:664)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:303)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:175)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:181)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:279)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:239)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:196)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:139)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:85)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:257)
         at oracle.security.jps.wls.JpsWlsSubjectResolver.runJaasMode(JpsWlsSubjectResolver.java:250)
         at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:100)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:65)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.sql.SQLException: ORA-01410: невалиден ROWID
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:116)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:177)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:947)
         at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:891)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3425)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1490)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:1040)
         ... 104 more
    ## Detail 0 ##

    I have resolved my problem. I have changed the type of list binding to be Dynamic List (not Model Driven List).

  • Problem with Queue Implementation

    Hi there !
    I can't solve the implementation of an exercize about Queue.My teacher wrote down just the interface Queue and the first part of the class ArrayQueue implementation.They are the following :
    public interface Queue<E>
       public int size();
       public boolean isEmpty();
       public E front() throws EmptyQueueException;
       public void enqueue (E element);
       public E dequeue() throws EmptyQueueException;
    public class ArrayQueue<E> implements Queue<E>
       public ArrayQueue(int cap)
          capacity = cap;
          Q = (E[]) new Object[capacity];
       public ArrayQueue()
          this(CAPACITY);
    }So the teacher asked to complete the code. I have tried and retried so many times for 3 days.I know it's so easy and I understood how it should work but when I try to write down the code I can't get the final solutions but only mistakes.
    During my attempts my better code was this :
    package queue;
    public class ArrayQueue<E> implements Queue<E>
         @SuppressWarnings("unchecked")
         public ArrayQueue(int cap)
            capacity = cap;
            Q = (E[]) new Object[capacity];
         public ArrayQueue()
            this(CAPACITY);
         public String toString()
            int count = 0;
            for(E element : Q)
                 return count +")"+(String)element;
            count++;
            return null;
         public void enqueue(E element)
              try
                   if(element == null)
                        throw new IllegalArgumentException();
                   if (size() == capacity)
                     throw new FullQueueException();
                   if(Q[rear] == null)
                      Q[rear] = element;
                      rear++;
              catch (FullQueueException e)
                   System.out.println("The Queue is Full !");
         public E dequeue() throws EmptyQueueException
              try
                 E temp;
                 if (isEmpty())
                      Q = (E[]) new Object[capacity];
                      front = 0;
                      rear = 0;
                     throw new EmptyQueueException();
                temp = Q[front];
                 Q[front] = null;
                 front++;
                 return temp;
              catch(EmptyQueueException e)
                   System.out.println("The Queue is Empty !");
              return null;
         public E front() throws EmptyQueueException
              try
                 if(Q[front] == null)
                           front++;
                 if (isEmpty())
                     throw new EmptyQueueException();
                 return Q[front];
              catch(EmptyQueueException e)
                   System.out.println("The Queue is Full !");
              return null;
         public int size()
              return (front + rear);
         public boolean isEmpty()
            return (front == rear);
        public Object[] getQueue()
            return Q;
         protected int capacity;
         public static final int CAPACITY = 1000;
         protected E Q[];
         protected int front = 0;
         protected int rear = 0;
    }But the problems are that I can add the element through the method enqueue() and delete it through dequeue() then,but after deleting it the array size is the same and when I print the array elements I see some null,so if I add a new element I get the message of the class FullQueueException because of the size which it's the same.
    Moreover if I delete all the elements and then I print the value returned by the method front() I get the NullPointerExceptionError because the returned value is null,but I think it should print it ! But he doesn't!
    How should I fix these problems ?
    I also wondered during all my attempts how to repeat this procedure after the array size limit is reached.What I really mean is if I delete the element Q[0] and the index front = 1 and rear = n - 1 for example,how can I add with the method enqueue() a new element in Q[0] again ?
    Can you help me courteously ?
    I hope my explanation was clear because of my English !
    Thanks in Advance !

    Thanks for all your suggestions men ^^ !
    I changed some things in the code :
    package queue;
    public class ArrayQueue<E> implements Queue<E>
         @SuppressWarnings("unchecked")
         public ArrayQueue(int cap)
            capacity = cap;
            Q = (E[]) new Object[capacity];
         public ArrayQueue()
            this(CAPACITY);
         public String toString()
              String s = "[";
              int count = 0;
              for (int i = front; i < rear; i++) {
                   count++;
                   s += Q.toString() + (i < rear - 1 ? "," : "");
              s += "] (" + count + " elements)";
              return s;
         public void enqueue(E element)
              try
                   if (size() == capacity - 1)
              throw new FullQueueException();
                   Q[rear] = element;
                   rear = (rear + 1) % capacity;
              catch (FullQueueException e)
                   System.out.println("The Queue is Full !");
         public E dequeue() throws EmptyQueueException
              try
              E temp;
              if(isEmpty())
              throw new EmptyQueueException();
         temp = Q[front];
              Q[front] = null;
              front = (front + 1) % capacity;
              return temp;
              catch(EmptyQueueException e)
                   System.out.println("The Queue is Empty !");
              return null;
         public E front() throws EmptyQueueException
              try
              if (isEmpty())
              throw new EmptyQueueException();
              return Q[front];
              catch(EmptyQueueException e)
                   System.out.println("The Queue is Empty !");
              return null;
         public int size()
              return (capacity - front + rear) % capacity;
         public boolean isEmpty()
    return (front == rear);
         protected int capacity;
         public static final int CAPACITY = 1000;
         protected E Q[];
         protected int front;
         protected int rear;
    }Now after I delete an element and I use the method enqueue() to add a new one the algorithm does,but
    after I delete all the elements I get an element null when I add the element in the array position n - 1.
    I have fixed the method toString() as pgt told me to do and it's really great,but dunno why sometimes when I delete an element it says the array has 0 elements also if the array is almost full !
    About my code changements,according to my university friend I should reduce front and rear mod the capacity and that's what marlin314 suggested me to do too and I had to change the expression if(size() == capacity) to if(size() == capacity - 1).But the algorithm doesn't work as it should do !                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Problem with WM_ENHANCMENT implementation

    Hi all,
    I deeply need to use  throughout transaction LT04 (Create Transfer Order from TR) the BADI
    WM_ENHANCMENT wich would allow me to export and record some essential data along with the saving and creation of the order,
    I don't expressly use the existing user exit EXIT_SAPLL03T_001 as it doesn't work within that transaction.
    Problem is I can't find a proper way to implement WM_ENHANCMENT Badi,
    Sure thing it doesn't provide the classic implementation mode in SE18 (Implement.->Create) stopping message is:
    "BAdI definition WM_ENHANCMENT is only provided for SAP internal use",
    Beside: no way to Implementation by using enhancement spot, and/or copying interfaces, classes so on, may be I'm not taking properly the required steps, (I'm still not used to build Badi's implamentation by new way),
    Please; Does anybody would provide me the true goods step by step moves to implement this perculiar Badi from SE18 or SE19, (I repeat the classic Badi impl. can't be done),
    Many thanks in advance,
    Sergio,

    Hi Chauxu, actually I didnu2019t try to use that BADI yet, as we ran for a temporary different solution, at present we schedule a custom program wich goes alone for all new created orders and fill in
    additional data we need, anyway I think I'll give some afford to modify that badi when lu2019ll gett some moment,
    Goodbye,
    Sergio,

  • Problem with list box in table control (Module pool) .

    Hi,
    I'm facing a problem while populating values in List Box..
    While I'm clicking a value from the list box it is not being hold in that box...box got blanked.
    Please help me to solve this.

    process before output.
    module pop_drop_down.
    module pop_drop_down output.
      name1 = 'IO5'.
      REFRESH list1.
      LOOP AT it_zpoitshead INTO wa_zpoitshead.
        value1-key = wa_zpoitshead-createdt.
        value1-key = wa_zpoitshead-its_ebeln.
        APPEND value1 to list1.
      ENDLOOP.
      CLEAR value1.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id                    = name1
          values                = list1
       EXCEPTIONS
         ID_ILLEGAL_NAME       = 1
         OTHERS                = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endmodule.                 " pop_drop_down  OUTPUT

  • SQL dynamic query returning (problem with list of value)

    Hi, I'm having trouble with my query. I want to make where statement based on my selectlist, but the problem is that I couldnt write the correct string in my where condition.
    :P61_STATUS has this following display, return value
    Bewerber     Bewerber     
    PRA_Kandidat     PRA_Kandidat          
    abgelehnt     abgelehnt          
    angenommen     angenommen          
    Thema     Thema     
    angemeldet     angemeldet          
    abgegeben     abgegeben          
    abgeschlossen     abgeschlossen          
    bestätigt     bestätigt
    DECLARE
      q varchar2(4000);
      list_betreuer htmldb_application_global.vc_arr2;
      list_semester htmldb_application_global.vc_arr2;
      list_status htmldb_application_global.vc_arr2;
    BEGIN
    -- variable to store the list
    list_betreuer := HTMLDB_UTIL.STRING_TO_TABLE(:P61_BETREUER);
    list_semester := HTMLDB_UTIL.STRING_TO_TABLE(:P61_SEMESTER);
    list_status := HTMLDB_UTIL.STRING_TO_TABLE(:P61_STATUS);
    -- Query begins
    q:= 'select p1.name, p1.vorname , a1.tel, a2.tel, ';
    q:= q||'ab.thema, ab.status, ab.typ, s.bezeichnung, p2.name ';
    q:= q||'from person p1, person p2, adresse a1, adresse a2, ';
    q:= q||'zuordnungp_a zpa1,zuordnungp_a zpa2, ';
    q:= q||'abschlussarbeit ab, semester s ';
    q:= q||'WHERE ab.SEMESTER = s.OBJECTID (+) ';
    q:= q||'AND ab.STUDENT = p1.OBJECTID (+) ';
    q:= q||'AND ab.BETREUER = p2.OBJECTID (+) ';
    q:= q||'and p1.objectid = zpa1.person (+) ';
    q:= q||'and zpa1.adresse  = a1.objectid (+) ';
    q:= q||'and zpa1.art (+)= ''Privat'' ';
    q:= q||'and p1.objectid = zpa2.person (+) ';
    q:= q||'and zpa2.adresse  = a2.objectid (+) ';
    q:= q||'and zpa2.art (+)= ''Geschäft'' ';
    -- Loop for betreuer list
    FOR i in 1..list_betreuer.count
    LOOP
        IF i = 1 THEN
        q:= q||'AND (ab.betreuer = '||list_betreuer(i);
        ELSE
        q:= q||' OR ab.betreuer  = '||list_betreuer(i);
        END IF;
    END LOOP; if (list_betreuer.count>0)THEN q:= q||')'; END IF;
      -- Loop for semester list
    FOR i in 1..list_semester.count
    LOOP
        IF i = 1 THEN
        q:= q||'AND (ab.semester = '||list_semester(i);
        ELSE
        q:= q||'OR ab.semester = '||list_semester(i);
        END IF;
    END LOOP; if (list_semester.count>0)THEN q:= q||')'; END IF;
    -- Loop for status list
    FOR i in 1..list_status.count
    LOOP
        IF i = 1 THEN
        q:= q||'AND (ab.status = '||list_status(i)||'';
        ELSE
        q:= q||'OR ab.status = '||list_status(i)||'';
        END IF;
    END LOOP; if (list_status.count>0)THEN q:= q||')'; END IF;
      htp.p(q);
    return q;
    END;result
    select p1.name, p1.vorname , a1.tel, a2.tel, ab.thema, ab.status, ab.typ, s.bezeichnung, p2.name from person p1, person p2, adresse a1, adresse a2, zuordnungp_a zpa1,zuordnungp_a zpa2, abschlussarbeit ab, semester s WHERE ab.SEMESTER = s.OBJECTID (+) AND ab.STUDENT = p1.OBJECTID (+) AND ab.BETREUER = p2.OBJECTID (+) and p1.objectid = zpa1.person (+) and zpa1.adresse = a1.objectid (+) and zpa1.art (+)= 'Privat' and p1.objectid = zpa2.person (+) and zpa2.adresse = a2.objectid (+) and zpa2.art (+)= 'Geschäft' AND (ab.status = abgegeben) the problem is in this statement
    q:= q||'AND (ab.status = '||list_status(i)||'';that statement produce this following statement
    ab.status = abgegebenbut what I need is this statement
    ab.status = 'abgegeben';how can I achieve this statement?
    thank you very much

    raitodn wrote:
    ah ok , I was confused with this q:= q||'AND (ab.status = '''||list_status(i)||'''';I think I get it now
    basically stop the string and write double quotes before the variable
    'AND (ab.status = ' + ''||list_status(i)||'' + ''No, more like "wherever I want a single quote within a string, I put two single quotes instead and that tells oracle it's a quote and not the end of the string".
    q:= q||'AND (ab.status = '''||list_status(i)||'''';
           ^                 ^^^                  ^^^^
           |                 |/|                  ||/|
           |                 | |                  || \-- single quote indicates end of string
           |                 | |                  ||
           |                 | |                  |\-- two quotes indicate a single quote required
           |                 | |                  |
           |                 | |                  \-- single quote to open a new string
           |                 | |
           |                 | \-- single quote indicates end of string
           |                 |
           |                 \-- two quotes indicate single quote required
           \-- Open String

  • Problem with list of value (LOV) in BI publisher.

    I have created a report in BI publisher with two parameters (tier, accnum) and two list of value (LOV) for the menu to select from a drop down list.
    while crateing the parameters I selected the options: *1) can select all and all value passed*
    but in the view when I select 'ALL' option from the list, its showing the following error message:
    ORA-00933: SQL command not properly ended.
    but if I select a particular tier and accnum it is worikg fine.
    I have used the following query in the dataset:-
    select ACCOUNT.ACCOUNT_NUM as ACCOUNT_NUM,
    ACCOUNT.LAST_BILL_DTM as LAST_BILL_DTM,
    ACCOUNT.ACCOUNT_NAME as ACCOUNT_NAME,
    ACCOUNTATTRIBUTES.DISTRICT_ID as DISTRICT_ID,
    ACCOUNTATTRIBUTES.TIER as TIER
    from GEN_OWNER.ACCOUNTATTRIBUTES ACCOUNTATTRIBUTES,
    GEN_OWNER.ACCOUNT ACCOUNT
    where ACCOUNT.ACCOUNT_NUM=ACCOUNTATTRIBUTES.ACCOUNT_NUM
    and ACCOUNTATTRIBUTES.TIER=:tier
    and ACCOUNTATTRIBUTES.ACCOUNT_NUM =:accnum

    and ACCOUNTATTRIBUTES.ACCOUNT_NUM in (:accnum)use in clause

  • Problem with List Item in oracle forms

    Hello Experts,        
                         I am new in oracle forms and i am using oracle forms 11g with weblogic 10.3.5 at windows 7.
    I have 3 database tables say(tbl_city,tbl_state,tbl_address).
    tbl_city
    C_ID
    C_name
    S_ID
    0
    None
    0
    1
    XYZ
    1
    2
    AS
    2
    3
    AXD
    2
      tbl_state
    ID
    s_ID
    S_Name
    0
    None
    1
    XY
    2
    ASD
    tbl_address
    A_ID
    A_Street
    S_ID
    C_ID
    1
    ABC
    1
    1
    Now I have made an oracle form having data block tbl_address with base table name tbl_address. In the form there are two list: one(list_state) for State_Name & State_ID and another(list_city) for City Name & C_ID display.
    Here I want when I set State_name to ASD then List item list_city should be populated with the values having State_NAME=ASD not of State_Name=XY or None.I have tried it to make but not succeeded.I have made a procedure to populate list_city list item as:
    -- here item_nm-->List item Name,  sel_val & sel_val2 for selecting C_ID and C_NAME,   tablNm---->tbl_CITY,  whr for where condition,   mtch--->selected value of list_State(list item in form)
    PROCEDURE list_item(block_nm varchar2,item_nm varchar2,sel_val varchar2,sel_val2 varchar2,tablNm varchar2,whr varchar2,mtch varchar2) IS
    group_id RecordGroup;
    group_name varchar2(10) :='abc';
    status NUMBER;
    query1 varchar2(350);
    item_name varchar2(20);
    match varchar2(50);
    BEGIN
        match:=mtch;
        item_name:=block_nm||'.'||item_nm;
      group_id := find_group(group_name);
    if not id_null(group_id) then
    delete_group(group_id);
    end if;
    --if whr='' then
    --    match:='0';
    --    end if;
    query1:='select '|| sel_val || ',TO_CHAR('|| sel_val2 || ') from '|| tablNm ||' where '||whr||' = '||mtch;
    message(query1);
    group_id := Create_Group_From_Query(group_name,query1);
    /* Select statement must have two column*/
    status := Populate_Group(group_id);
    Populate_List(item_name,group_id);
    exception
        when others then
        message('error');
    END;
    I am not  able to guess what trigger  in oracle forms should be used to populate list item(list_city). Please help by giving useful suggestion.
    Thank You
    regards
    aaditya

    979801 wrote:
    If I use LOV in place of List Item,Then I have to populate a LOV at run time.How could I maintain a record group n attach to LOV at run time?
    On my previous post I have mentioned record group as follows:
    select * from tbl_state where s_id=:tbl_address.s_id;
    If :tbl_adress.s_id chaned during the time of run, then output values of list_city (LOV) is also changed.

  • Problem with Listing of Articles in Assortment Management

    Hi,
    I am new to SAP IS Retail. In fact new to SAP itself.
    I was working on Assortment Management.
    I created my own Merch. Category  and created products under them. 
    In Assort.Management I progressed in following way [ as mentioned in the Best Practices document ] -
    1. I have created a General Assortment using WSOA1[The layout module was also created immediately].
    2. I created the layout module version using WLMVN
    3.Article assignment to layout module and assortment using WLWBN.
    4. Assigned the assortment user [ through WSOA6]
    5. Release layout module and created listing condition[ by WLWBN again]
    6. When I do listing for the articles under the assortment , it shows me the message - listing is started.
    But if I see in WSL11 with the Merch. Category / Assortment name, the system says - No listing condition found.
    Question is - What could be the issue here ?
    It would be really helpful if anyone can sort this issue out. I am stuck at this point.

    Hi Eric,
    I am using Listing procedure B1.[ Basic procedure : mat grp / assortment ]
    Regards,
    Kumar

  • Problem with SQLData implementation

    Hi,
    I am facing a problem while retrieving an ARRAY.
    I am using jdbc thin driver 8.1.7.1 (patched version) to connect to the 9i Database(9.0.1.2.0).
    Code:
    public class Employee implements SQLData
         public int iEmpNumber;
         public String strName;
         Address[] objEmpAddress;
         String sql_type="APPS.EMPLOYEE";
         public Employee()
         public String getName()
              return strName;
         public Employee(int iEmpNumber,String strName,Address[] objEmpAddress)
              try
                   this.iEmpNumber=iEmpNumber;
                   this.strName=strName;
                   this.objEmpAddress=objEmpAddress;
              }catch(Exception e){}
         public String getSQLTypeName() throws SQLException
         return sql_type;
         public void readSQL(SQLInput stream, String typeName)
         throws SQLException
              sql_type =typeName ;
              iEmpNumber = stream.readInt();
              strName = stream.readString();
              Array b=stream.readArray();
    ****Here I am getting b as null**********************************
    Object[] d=(Object[])b.getArray();
              Address[] e=new Address[d.length];
              for(int i=0;i<d.length;i++)
                   e=(Address)d[i];
              objEmpAddress=e;
         public void writeSQL(SQLOutput stream)
         throws SQLException
              try{
              OracleConnection conn=(OracleConnection)DriverManager.getConnection ("jdbc:oracle:thin:@nandini:1510:crp","sadas", "asd");
              stream.writeInt(iEmpNumber);
              stream.writeString(strName);
              ArrayDescriptor desc = ArrayDescriptor.createDescriptor("APPS.ADDTABLE",conn);
              ARRAY a=new ARRAY(desc,conn,objEmpAddress);
              stream.writeArray(a);
              }catch(Exception e){ System.out.println("Exception Occured in writeSQL of Employee"+e);}
    Any suggestion would be greatly helpful.
    Thanks and Regards,
    Ramesh Jetty.

    Hi Curt,
    I could do that also but this would sort of defeat the purpose of taking advantage
    of using the DB Control in Workshop. The DB Control is supposed to take care
    all of the DB connection logic for us.
    Bao.
    "Curt Smith" <[email protected]> wrote:
    >
    That tact I would have take wuold have packaged the std logic to get
    initialcontext
    and lookup on my other conn pool JNDI name. I can't imagine why this
    tact would
    fail.
    What's your thoughts?
    curt

  • Problem with listing thumbnails within c:forEach loop

    I'm currently developing a photo gallery application using Struts. In the JSP code listed below I retrieve a list of "photo" beans (succesfully) and I use <html:link> tag as a link to a desired photo. Links for all the listed photos work well.
    The ONLY problem is that all the thumbnails are copies of the last one retrieved in the loop (but they refer to different photos as required). The "/showthumb" servlet (alias for appropriate servlet) inserts the thumbnails into the page using the session scoped "blob". I'm presuming that all the thumbs are result of the last invocation of the servlet and in fact use the last value of the "blob" session scoped variable.
    Does anybody has an idea how to solve this problem and show all the thumbs instead of a copies of the last one in a JSP page ?
    <c:forEach varStatus="status" var="photo" begin="0" items="${glazDB.photos}">
                    <jsp:setProperty name="prevNext" property="add" value="${photo.photoId}"/>
                    <td>
                        <c:remove var="blob"/>
                        <c:set var="blob" value="${photo.thumb}" scope="session" />
                        <c:url var="url" value="\showpicture.do" >
                          <c:param name="pic" value="${status.count}" />
                        </c:url>
                        <html:link page="${url}"><html:img page="/showthumb"/></html:link>
                    </td>
                    <c:if test="${status.count mod 4 == 0}">
                        </tr><tr>
                    </c:if>
            </c:forEach>

    Think about the ordering of things here.
    Your jsp runs, it sends back an HTML page.
    Only when the client sees the HTML page can it start making requests for the images.
    All the <html:img> tag does is put the text for an image tag onto the page to be evaluated later. So your continual setting of the session variable is pretty much useless, as only the last one is in session when you execute the servlet.
    You have to make the request load the image in some other way.
    request each blob seperately via parameters. eg /showthumb?id=xxxx
    Whether you keep all the images in session memory at one time, or you load each individual one is up to you.

  • Problem with List View in Calendar

    Hi,
    On my iPhone 4 running 4.3.3, I can't see any entries older than one year under 'list view'.  Ironically, the entries appear under Day and Month view so I know they are there, but nothing older than one year under List view.  I have tried resetting to no avail.  I sync via iTunes (not mobile me) but there is nothing that points to why only one view on my iPhone would have this restriction.  Please help.
    Thanks

    Here's a workaround that I discovered: duplicate a previous individual event that printed correctly, i.e., without the empty "Location:" line shown; then edit that information for the new event as desired -- an ugly solution, but it works!

  • Problem with listing directory after upgrade to Lion

    Hi all,
    I have a script that I used for months that "suddenly" stopped working after i switched to OSX Lion
    #target illustrator
    var listFolder = Folder.selectDialog( "Select a folder", "~" );
    alert(listFolder);
    if ( listFolder != null )
      var folders = new Array();
      var files = new Array();
      var folderCount = 0;
      var fileCount = 0;
      var fList = listFolder.getFiles();
      for ( i = 0; i < fList.length; i++ )
       theFile = fList[i];
       if ( fList[i] instanceof File )
         files.push( fList[i] );
         fileCount++;
    else {
         folders.push( fList[i] );
         folderCount++;
    // Create a file that lists the folders and files
      var reportFile = new File(listFolder + "/Filelist.txt");
      reportFile.open("write");
      reportFile.writeln("Folders:");
      for (i = 0; i < folderCount; i++)
    reportFile.writeln("\t" + folders[i]);
    reportFile.writeln("Files:");
      for (i = 0; i < fileCount; i++)
       reportFile.writeln("\t" + files[i]);
      reportFile.close();
      alert("Folders: " + folderCount + "\n  Files: " + fileCount);
    first alert returns file:///Volumes/e/TEST
    second alert returns 0 even tho there is plenty of files/folders in the TEST folder
    same script run from PS or ID works fine but the path returned looks like this:
    ~/Volumes/e/TEST
    and second alert returns correct counts of files and folders.
    What happened to my Illustrator?
    Thanks in advance.
    Matt

    Matt, I saw your post over at PS Scripts… I did not respond as I don't have Lion… Personally don't upgrade until last version of OS's… I would suspect the in-built getFiles() function… Although I have no idea why Illustrator would only be effected… Have you tried passing a filter argument? Does it make any difference… eg:
    getFiles('*.pdf');
    I saw that you wanted the PDF files… I doubt this is going to change anything thou.

Maybe you are looking for