Writing a delegating CharsetDecoder?

I want to write a CharsetDecoder that wraps an arbitrary existing decoder. Basically I want to run a standard decoder, but do special things for all the malformed input, not just the first bad sequence.
The CharsetDecoder interface requires that I do this by implementing decodeLoop(). Unfortunately I cannot just wrap the delegate's decodeLoop(), because it's a protected method. That only leaves the two decode() methods. The problem with both is that I (inside my decodeLoop) don't know if endOfInput should be set. The single-parameter decode() method assumes it, and for the other decode() method I have to supply it. If I set it true when I'm invoked from a StreamDecoder there's a risk of spurious failures because the input buffer might only have part of a multi-byte sequence at any time, but the rest will show up later. If I use the second method and set it false there's a risk that I'll never get to process trailing malformed input, as the decode() method that invoked me will generate its own malformed result at the end of the buffer.
The crucial information is stored as the ST_END state, but my own state is hidden from me in decodeLoop().
Does anyone know how this is supposed to work? It seems like the CharsetDecoder interface got a bit carried away with OO.

I had a similar problem when I wanted to delegate to a Swing drag-and-drop object, which had a protected method.
You can use Reflection to get the appropriate Method from the Class of the decoder you're delegating to. Then call setAccessible(true) on the Method; after that you can call invoke() on the Method even though it's protected.

Similar Messages

  • Delegation and folder permissions via outlook

    I've a question about delegation via outlook.
    There are 2 different requests from our users:
    1) share the mailbox for reading and writing. (without delegation)
    2) delegate access to calendar without mail/contacts.
    How is delegation working in Beehive?
    I've found 2 ways of giving access to your mail:
    1) set the permissions for a user on a folder by rightclicking on the folder. via permissions.
    2) via tools/options/delegates.
    What is the best way to give other users access to your mailfolder?
    Thanks, Edward

    To my knowledge, delegation is not in the user preferences, but can be found withing beehive central (e.g. http://myserver:myport/bcentral/action?page=delegation).
    We tested that delegation successfully using the outlook client.
    We would like to see an option to centrally administer such delegations: an employee that has fallen ill may contact the administrator, telling him: please allow my colleague ... to check my mail / have a look into my calender, without giving away his user credentials.
    Regards, Thomas

  • Contravariance and overloading

    One of the requested features in the Bug Database is covariance and contravariance. Although I think covariance of return types is easy to achieve without modifying JVMs, contravariance of parameter types might be more of a problem.
    Take the following inheritance structure:
    C extends B extends A
    Y extends X
    X defines a method 'foo(C)'
    Y defines methods 'foo(B)' and 'foo(A)'
    What should happen if the following code is executed:
    X my_x = new Y();
    X.foo(some_c);
    The current Java implementations would execute 'foo(C)' from class X.
    Using contravariance a subclass may override a method using a weaker parameter type, but Y has two such methods: 'foo(B)' and 'foo(A)'. Which method should the JVM choose? I have seen suggestions to choose the most specific parameter type. In this case this would be 'foo(B)'.
    But this only works for simple method signatures. Things get more complicated with methods having multiple arguments and with interfaces thrown into the type hierarchy.
    Suppose X also has a method 'foo(C, C)' and Y has methods with all possible combinations of A, B and C as parameter types, except 'foo(C, C)': 'foo(A, A)', 'foo(A, B)', 'foo(A, C)', 'foo(B, A)', 'foo(B, B)', 'foo(B, C)', 'foo(C, A)', 'foo(C, B)'. Which one to choose now? If you choose 'foo(B, C)' instead of 'foo(C, B)', why is the first parameter stronger than the second parameter? Shouldn't all parameters be equally strong?
    Suppose C also implements interface I and Y has a method 'foo(I)'. Is 'foo(B)' or 'foo(I)' the more specific one? If you choose 'foo(B)', why is a class stronger than an interface or vice versa? Shouldn't all types be equally strong?
    Of course, a simple solution to this problem is to write a simple delegation method in class Y:
    void foo(C the_c) {
    foo((B)the_c);
    It is my opinion that contravariance can only be achieved in languages which only use the name as the signature of an operation. That way it is always clear that a method overrides the equally named method in the superclass. The compiler can then also easily check whether the parameter types are contravariant.
    Also, I think Java could be made suitable for contravariance, but only if you specify for a method in the subclass exactly which method to override from the superclass using a method signature (saves writing a delegation method). Class Y should then be changed to:
    class Y extends X {
    void foo(A) overrides foo(C) {
    void foo(B) {
    What is the value of this possible extension to the Java language? Is it worth changing the language specification, the class file format specification and possibly other specifications?
    I really would like to know other people's opinions on this subject.
    Johan Stuyts
    P.S. I do not want to discuss contravariance of return types or covariance of parameter types in this thread. I am a supporter of design by contract. Design by contract allows weakening of preconditions and strengthening of postconditions. Contravariance of return types weakens postconditions and covariance of parameter types strengthens preconditions. Whether my opinion on this subject is correct should be discussed in a different thread.

    Your suggested language extension
    public void foo(X x) overrides bar(A a)
    solves other problems too. If you want to implement two interfaces which happen to use the same methodname and signature, you have to write a single method which overrides both. The interfaces may have different authors and intended semantics that are independent of one another.
    In fact (dare I say it) with this language feature multiple parent classes becomes possible too - it allows you to solve the "diamond inheritance diagram" problem.

  • Writing own event for Reservation creation BUS object

    I am trying to create a workflow that should get triggered when a new reservation is created for approval. I am using the BOR object for material reservation but it does not contain an event of creation. I wish to create a new event and then add code to the event so that a mail to an approver can be sent. Using the approval received I need to confirm the reservation else render it cancelled.
    I require help in creating the event and writing the event code for it.
    Thanks for taking time to go through my query
    Zankruti Parikh

    Hello Zankruti,
        Indeed, there's no such event for BUS2093. And if you try to do this to object BUS2093, you will come across error: "No change document object for business object type BUS2093".
        Given this, in your case, I am afraid that you will have to extend object BUS2093 by using delegation - then you will be able to add events CREATED or CHANGED, if necessary. Use transaction SWO1 to this, click on "settings" delegate, delegation type = ZBUS2093(for example) - you will delegate your ZBUS2093 type to BUS2093. After that, you will be able to create the events.                                                                               
    Following the idea, I believe that the easiest way to do this is thorugh enhancement MBCF0007 (Customer function exit: Updating a reservation). Click on components, and then you will see EXIT_SAPMM07R_001. Within this exit, you can call SWE_EVENT_CREATE_IN_UPD_TASK (you trigger the events you will have created above).  
    Regards,
    Andre Sousa
    Edited by: Andre Sousa on Jan 4, 2008 9:35 PM

  • Checking to see if current logged in user is delegated by user on a task

    Hello all.
    I am looking to produce a report that will be run from a users home page (and thus can't take input at run time). It is to show the status of all tasks and appointments.
    The tricky bit is that I need it only to show tasks where the currently logged in user is the user who last delegated the task. I can make this work for the "owner" but not "delegated by".
    As a fall back position I might be able to get away with it looking to check if the current logged in user is the same as the "created by" user, as activities will only rarely be reassigned on.
    Any help appreciated.
    Bob.

    Hi,
    I am writing in to see if there is any update regarding this issue.
    Thanks,
    Linda
    Linda Li
    TechNet Community Support

  • Delegation or Inhertance

    Hi y'all,
    What should one prefer when writing classes.
    Delegation or inheritance.
    Example for inheritance:
    public class MyApp1 extends JFrame{
      public MyApp1(String name) {
        super(name);
    }Example for delegation:
    public class MyApp2 {
      private JFrame frame;
      public MyApp1(String name) {
        this.frame = new JFrame(name);
    }I don't want to specially know this for javax.swing but in a global way
    Some ideas on this:
    Inheritance:
    - probly. more functionality than wanted, bad side effects. In order to prevent this you need do overwrite methods where the certain functionality is not needed.
    - you also can regard the above mentioned issue as advantage.
    Delegation
    - Gain better control of Objects. The public methods just show what really can be manipulated.
    Is there a global working answer to that question? - What is your experience?
    Thanks for joining the debate.
    best greetings
    greyshine

    Many programmers use inheritance on examples like this, you also may read that in some educational java books.
    But it is no good style:
    (1) the decoupling of classes is not good. In an application you could use patterns like MVC, trying to separate the view from the logic and data. Here your applications superclass is a view class...
    (2) inheritance is semantically wrong here, because your application class "is" not a JFrame. You`re not creating a subclass of JFrame, which adds properties for a specialised JFrame. You actually just use the JFrame.
    Delegation is far better than this !
    Adrian Ofterdinger

  • Vi error on nfs mount; E212: Can't open file for writing

    Hi all,
    I've setup a umask of 0 for testing on both NFS client (Centos 5.2) and NFS server (OSX 10.5.5 server).
    I can create files as one user and edit/save out as another user w/o issue when directly logged into the server via ARD.
    However, when I attempt the same from an NFS mount on a client machine, even as root I get the following error using vi;
    "file" E212: Can't open file for writing
    Looking at the system.log file on the server, I see;
    kernel[0]: add_fsevent: no name hard-link! dropping the event. (event 2 vp == 0xa5db510 (-UNKNOWN-FILE)).
    This baffles me. My umask is 0 meaning files I create and attempt to edit as other users are 777, but I cannot save out edits unless I do a wq! in vi. At that point, the owner of the file changes to whomever did the vi.
    This isn't just a vi issue as it happens using any editor, but I like to use vi.
    Any help is greatly appreciated. Hey, beer is on me!

    Hi all,
    Thanks for the replies
    I've narrowed it down to a Centos client issue.
    Everything works fine using other Linux based OS's as clients.
    Since we have such a huge investment in Centos, I must figure out a workaround. Apple support wasn't much help as usual however they were very nice.
    There usual response is "its unsupported".
    If Apple really wants to play in the enterprise of business space, they really need to change there philosophy. I mean telling me that I shouldn't mount home directories via NFS is completely rediculus.
    What am I supposed to use then, Samba of AFP? No, I don't think so. No offense to Microsoft but why would I use a Windows based file sharing protocol to mount network shares in a Nix env???

  • Writing to file limiting system performanc​e

    Hello,
    I really could use some help with my VI in terms of writing data.  I’ve had a LOT of help optimizing my code and am trying to enhance the performance in terms of data acquisition.  However, it seems as though writing to a data file is really limiting the frequency I can sample at.  I’ve done some research and understand that writing data at every iteration of the while loop and the build array function slows things down.  How would I modify the code so that the array buffer would store maybe 5000 data points before writing to a file, then clearing the array?  That would keep the array size small, as well as reduce the number of times the program is performing the write to file function.  Is there a better way of doing this?  I’m open to any other ideas as well.    
    I am taking data from 14 channels, and would like to sample at 1 kHz each.  The task right now is created within Measurement and Automation Explorer, and the number of samples is at 100.  I also use a buffer indicator, which will generally grow out of control, no matter how much I modify the number of samples and the frequency.  The length of my test can last upwards to 6 hours, so it needs to work that long without crashing.     
    The code and attached subVI’s is attached.  Hopefully it's all there.
    Thanks for your help,
    Alex
    Attachments:
    Test Program.zip ‏295 KB

    Lynn,
    Yea, I'll have to keep on the block diagram size in the future.  Can get unwieldy.
    I tried incorporating the Recent History Buffer example into my code.  I did have a few hang ups, which are giving me some trouble.  Mostly, how do I connect my waveform data to the Buffer VI?  Will I be able to have all my channels connect to this?  Also, ultimately I will have two write to file VI's.  Can the buffer differentiate between which file to write?
    Thanks,
    Alex
    Attachments:
    Instrument Panel V1.1 (Labview 8.0).vi ‏159 KB

  • Error while updating DocumentDefinition AIP-11052:Writing following objects

    Hi All,
    I am getting this error while updating ecs in Document Definition. I was able to do it properly on the same environment a few weeks back but now its throwing an error:
    Error -: AIP-11052: Writing following objects: Document Definition failed due to following constraint violation: DOCUMENTDEFINITION. CAN NOT UPDATE UNVERSIONABLE OBJECT IN A VALIDATED CONFIGURATION
    I read in some of the OTN forums that this may be an environment issue. So i restarted the B2B server as suggested but the error seems to still exist.
    Kindly reply how to proceed. Its little critical.
    Thanks in advance.

    Make sure there is no agreement in deployed/validated state which is using this document definition. Retire and purge all existing configurations which are using this doc def and make sure there is no agreement in validated state. If there is an agreement in validated state and then change/just update anything in agreement and save it to bring it back into draft state.
    Regards,
    Anuj

  • Access denied error while writing a file to the file system - myfileupload.saveas() throws system.unauthorizedexception

    hi,
    as part of my requirement , i have to perform read and  write  operations of  few files [ using the file upload control in my custom visual web part] and on submit button click.
    but while writing these files - with the help of  fileupload control - and when i use  myfileupload.saveas(mylocation);
    - i am saving these files into my D:\ drive of my server , where i am executing my code -, am getting access denied error.
    it throws system.unauthorizedexception.
    i have given full control on that folder where i was trying to store my attached files. and also  after following asp.net forums,
    i have added  iusr group added and performed all those steps such that, the file is saved in my D:\ drive.
    but unfortunately  that didnt happen.
    also
    a) i am trying the code with runwithelevatedprivileges(delegate() )  code
    b) shared the drive within the  d :drive where i want o save the files.
    c) given the full privieleges for the app pool identity- in my case , its
    network service.
    the  other strange thing is that, the same code works perfectly in  other machine, where the same sp, vs 2012  etc were installed .
    would like to know, any other changes/ steps i need to make it on this  server, where i am getting the  error.
    help is  appreciated!

    vishnuS1984 wrote:
    Hi Friends,
    I have gone through scores of examples and i am failing to understand the right thing to be done to copy a file from one directory to another. Here is my class...So let's see... C:\GetMe1 is a directory on your machine, right? And this is what you are doing with that directory:
    public static void copyFiles(File src, File dest) throws IOException
    // dest is a 'File' object but represents the C:\GetMe1 directory, right?
    fout = new FileOutputStream (dest);If it's a directory, where in your code are you appending the source file name to the path, before trying to open an output stream on it? You're not.
    BTW, this is awful:
    catch (IOException e)
    IOException wrapper = new IOException("copyFiles: Unable to copy file: " +
    src.getAbsolutePath() + "to" + dest.getAbsolutePath()+".");
    wrapper.initCause(e);
    wrapper.setStackTrace(e.getStackTrace());
    throw wrapper;
    }1) You're hiding the original IOException and replacing it with your own? For what good purpose?
    2) Even if you had a good reason to do that, this would be simpler and better:
    throw new IOException("your custom message goes here", e);
    rather than explicitly invokign initCause and setStackTrace. Yuck!

  • To avoid writing database code in the front end

    Hello,
    I am working on a database application using 10g database as backend and dotnet as front end. I wish to execute only oracle stored procedure for all the select (to avoid hard parse and use of bind variable), DDL and DML operations; just to avoid writing database code in the front end. Can anyone please give me a little examples of :
    1.Select query's output to be return as resultset by stored procedure.
    2.DML example by stored procedure.
    3.Any DDL example by stored procedure.
    using scott.emp, so that i would just call the stored procedure, rather than giving select,DML and/or DDL commands in the front end. Even though i have read in the documentation, but a clear cut examples will help me to get into clear concept as well.
    Thanks & Regards
    Girish Sharma

    Hi...
    -->Select example
    create or replace procedure get_emp(rc out sys_refcursor)
    is
    begin
    open rc for select * from emp;
    end;
    -->DML example
    create or replace procedure do_dml_emp(pempid in number,
    pempname varchar2,
    result out number)
    is
    begin
    insert into emp(empid,empname) values(pempid,pempname) returning empid into result;
    exception
    when others then
    result:=-1;
    end;
    -->DDL example
    create or replace procedure ddl_emp(colname varchar2,
    coltype varchar2,
    result out number)
    is
    begin
    result:=-1;
    execute immediate 'alter table emp add column ' || colname || ' ' || coltype ;
    result:=1;
    end;

  • My disconnected external HDD is somehow writing itself to my internal HDD!

    Ok, so the other night I got a notification from OS X that I was almost out of disk space, which I found very odd, because the last time this happened was when I had my external hard drive connected, and it was somehow writing itself onto my internal hard drive (it is formatted so that I can use it for both my MBP and the Windows machine at home). You can understand my puzzlement when I got the message, as I did not have my external connected at the time, and had not had it connected since the day before. I had, however, noticed some significant lagging in Safari and Adium, which I found very odd as being the only things affected. As of writing this, I will have cleaned off what has been written to my hard drive twice now (each time 50+ GB!), and I am starting to get very frustrated, with finals and projects coming due very fast now. It appears that the writing starts after I leave Safari/Adium idle for a while, which is very odd, as I can't imagine why either of these programs being idle would initiate this unexplained writing.
    I have, however, noticed that there seems to be something invisible in the trash folder that will simply not delete, and has been there since I had the initial problem of my external writing to the internal drive. The Trash constantly tells me there is "1 item" in the trash, but nothing shows up. When I go to Secure Empty I get the little window that tells you the completion status on the emptying, and it always says "4 Items to delete." Even after showing all hidden files and folders, nothing shows up in the trash, despite there always being "1 Item" in there. My guess is that this could be what is causing the writes. What I don't understand is how in the world it managed to store my 100+ GB of stuff on my external in an invisible file that is taking up next to no space on my system, because when I do a scan using Grand Perspective, it doesn't show anything out of the ordinary files and folders that I know should be there. Certainly not 100+ GB of what I have on my external, as I know what I have where, and what are duplicates, and duplicates only show up after the external files have written themselves.
    Some additional details for consideration:
    Bootcamped hard drive, 15GB for my Windows partition, have only used it to play Roller Coaster Tycoon, and have only connected to the internet on Windows a total of 3 times, each time to download Firefox, iTunes, and Safari, no additional browsing.
    External HDD is a LaCie Firewire 400 drive, 320GB formatted for both Windows and Mac (HFS+, right?), haven't connected it in at least two days. Last time this happened it was actually connected, but this time has not been connected when the files have magically appeared on my internal HDD.
    There is an invisible file (or multiple files) somehow not showing up AT ALL that is hanging around in the trash. I believe this invisible file(s) to be the culprit, though I'm puzzled as to how. Each time the mysterious writes have happened, Safari/Adium have been idle and open.
    If you're wondering how in the world this is happening, don't worry. The first time this happened when my drive was actually connected, I took my MBP to the Apple Store in Indianapolis and totally stumped three employees, including the store manager. If he thought that was odd, wait until I tell him its now writing to my HDD without being connected!

    Each time the problem is in the /Volumes/LaCie folder, which is hidden. This leads me to believe its a ghost from my external HDD, rather than from my Bootcamp partition. The 50+ GB that it has written so far has not been duplicates of less than 10GB of information on my Windows partition, it is all files and folders from my approx. 130+GB of information on my external.
    In talking with a friend on my floor last night, he thinks it might be a ghost image, as some people have evidently gotten this problem in their email accounts here at the school lately. This ghost image is on my OS X partition, and I'm almost 100% certain it isn't a problem with my Bootcamp partition, as nothing appears in my trash on the Windows side. I have also never used my external with my Windows partition. Like I said, everything being written is from my external hard drive.
    Thanks for the link, checking it out now.

  • When I am writing an email, I get an alert message that says "The message could not be copied or moved to the drafts folder. Writing to the folder failed. To ga

    When I am writing an email, I get an alert message that says “The message could not be copied or moved to the drafts folder. Writing to the folder failed. To gain disc space, choose Empty Deleted and choose Compact Folders and try again.”
    If I do that, I get a message saying “There was an error copying to the Sent folder,, retry?”
    If I retry it sends the uncompleted email. All I can do is keep deleting the message and carry on. Then the whole business might repeat itself.
    Help!
    Frank

    Because the location for each song in your library is on your hard drive.  If the hard drive isn't there, how can iTunes play it?
    You'll have to move/copy the music from your hard drive to your computer's hard drive.
    Basically, EASIEST way to do all this, if you don't care about your play counts, etc...
    -Delete EVERYTHING from iTunes, so that your library is now empty.
    -Go to "Advanced" inside of the "Preferences" window, found in the "Edit" drop-down.  You can also access Preferences by pressing Ctrl+, (Press Ctrl and the comma key)
    -Change your iTunes Media Folder Location to something simple, but on your computer. I use C:/iTunes.  Make sure "Keep iTunes Media Folder Organized" and "Copy files to...." are both checked.  You can close Preferences now.
    -Now, drag and drop your music from your hard drive into your iTunes library.  iTunes will automatically add the music to your library, as you would expect, and also creates a copy of each file to place into that iTunes Media Folder you just created.
    Shouldn't have any more problems...

  • Adobe Media Encoder (Error compiling movie) Unknown error when writing to Isilon OneFS 6.5.5.18

    Adobe Media Encoder (Error compiling movie) Unknown error when writing to Isilon OneFS 6.5.5.18 while using Adobe Premiere Pro.
    Process:         Adobe Premiere Pro CC 2014
    Path: /Applications/Adobe Premiere Pro CC 2014/Adobe Premiere Pro CC 2014.app/Contents/MacOS/Adobe Premiere Pro CC 2014
    Identifier: com.adobe.AdobePremierePro
    Version:         8.1.0 (8.1.0)
    Code Type: X86-64 (Native)
    Parent Process: launchd [2538]
    Responsible:     Adobe Premiere Pro CC 2014
    Date/Time: 2015-01-06 14:04:23.500 -0700
    OS Version:      Mac OS X 10.9.2 (13C64)
    Report Version:  11
    Crashed Thread: 55  Dispatch queue: com.apple.root.default-priority
    Exception Type: EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
    Customer created test export with 777 permissions and set mount parameters to the following:
    mount_nfs -o vers=3,tcp,rdirplus,intr,nolocks,async,rsize=32768,wsize=32768
      -- Original mount options:
         General mount flags: 0x40 async
         NFS parameters: vers=3,tcp,nolocks,rsize=32768,wsize=32768,rdirplus
      -- Current mount parameters:
         General mount flags: 0x4000058 async,nodev,nosuid multilabel
         NFS parameters: vers=3,tcp,port=2049,nomntudp,hard,nointr,noresvport,negnamecache,callumnt,nolocks,quota, rsize=32768,wsize=32768,readahead=16,dsize=32768,rdirplus,nodumbtimr,timeo=10,maxgroups=16 ,acregmin=5,acregmax=60,acdirmin=5,acdirmax=60,nomutejukebox,nonfc,sec=sys
    The pcap shows once the movie is created a lockup call is responded from Isilon with Error: NFS3ERR_NOENT
    478         V3 CREATE Call (Reply In 479), DH: 0xea5f731c/QBRSN-0-0-1.mov Mode: UNCHECKED
    479         V3 CREATE Reply (Call In 478)
    484         V3 LOOKUP Call (Reply In 485), DH: 0xea5f731c/._QBRSN-0-0-1.mov
    485        V3 LOOKUP Reply (Call In 484) Error: NFS3ERR_NOENT
    V3 LOOKUP Reply (Call In ....) Error: NFS3ERR_NOENT  -   This is by design of OneFS, we coalesce files and then flush them out to disk which is why the commit time is accurate but the file is not immediately available. however when an async option is used within the mount options this should be avoided if writing asynchronously to the cluster.  Has anyone else seen this behavior lately? (current workaround is to store locally and transfer to the cluster via Finder)

    That error can happen for many reasons...one of the reasons that I occassionaly get it is because I try exporting a movie to an external drive that has been formated in the old FAT32 instead of the NTSF standard.  FAT32 only allows for file sizes up to 2 gigs.  And as soon as it reaches that...I would get that error.  I don't know if that is why you are getting that error...but it would be easy to check.  1) are you generating a file that is over 2 gigs?  2) is your drive that you are exporting to FAT 32 (just right click the drive in My Computer and select "properties" then just look for what it says next to "file system".

  • Help needed for writing query

    help needed for writing query
    i have the following tables(with data) as mentioned below
    FK*-foregin key (SUBJECTS)
    FK**-foregin key (COMBINATION)
    1)SUBJECTS(table name)     
    SUB_ID(NUMBER) SUB_CODE(VARCHAR2) SUB_NAME (VARCHAR2)
    2           02           Computer Science
    3           03           Physics
    4           04           Chemistry
    5           05           Mathematics
    7           07           Commerce
    8           08           Computer Applications
    9           09           Biology
    2)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2) SUB_ID1(NUMBER(FK*)) SUB_ID2(NUMBER(FK*)) SUB_ID3(NUMBER(FK*)) SUBJ_ID4(NUMBER(FK*))
    383           S1      9           4           2           3
    384           S2      4           2           5           3
    ---------I actually designed the ABOVE table also like this
    3) a)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2)
    383           S1
    384           S2
    b)COMBINATION_DET
    COMBDET_ID(NUMBER) COMB_ID(FK**) SUB_ID(FK*)
    1               383          9
    2               383          4
    3               383          2
    4               383          3
    5               384          4
    6               384          2          
    7               384          5
    8               384          3
    Business rule: a combination consists of a maximum of 4 subjects (must contain)
    and the user is less relevant to a COMB_NAME(name of combinations) but user need
    the subjects contained in combinations
    i need the following output
    COMB_ID COMB_NAME SUBJECT1 SUBJECT2      SUBJECT3      SUBJECT4
    383     S1     Biology Chemistry      Computer Science Physics
    384     S2     Chemistry Computer Science Mathematics Physics
    or even this is enough(what i actually needed)
    COMB_ID     subjects
    383           Biology,Chemistry,Computer Science,Physics
    384           Chemistry,Computer Science,Mathematics,Physics
    you can use any of the COMBINATION table(either (2) or (3))
    and i want to know
    1)which design is good in this case
    (i think SUB_ID1,SUB_ID2,SUB_ID3,SUB_ID4 is not a
    good method to link with same table but if 4 subjects only(and must) comes
    detail table is not neccessary )
    now i am achieving the result by program-coding in C# after getting the rows from oracle
    i am using oracle 9i (also ODP.NET)
    i want to know how can i get the result in the stored procedure itsef.
    2)how it could be designed in any other way.
    any help/suggestion is welcome
    thanks for your time --Pradeesh

    Well I forgot the table-alias, here now with:
    SELECT C.COMB_ID
    , C.COMB_NAME
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID1) AS SUBJECT_NAME1
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID2) AS SUBJECT_NAME2
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID3) AS SUBJECT_NAME3
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID4) AS SUBJECT_NAME4
    FROM COMBINATION C;
    As you need exactly 4 subjects, the columns-solution is just fine I would say.

Maybe you are looking for

  • Issue in determination of planned delivery data in PR.

    Hello, I have an issue in PR, where planned delivery time is picked wrongly. PR is created through MRP. In info record, the planned delivery time is 8, in vendor master record planned delivery time is 0, and no contract exists. But when PR is created

  • How Do I Strip the Body of an Room Request Before Forwarding to a Delegate?

    We have several conference rooms in our Exchange 2010 environment that are mostly delegated by the auto-attendant. We also have a few rooms delegated by an actual person who must approve or decline the request manually. Those rooms have the "Forward

  • StoredProcedures Logical Unit of Work (Transactionality)

    I haven't experimented yet about the bahaviour when calling multiple storedProcedures in a single XI-JDBC call. When I call multiple stored procedures and if the transaction was partially successfull which means One storedProcedure call executed succ

  • Pre-selecting from Spry Data Select Box

    Hi I am new here so sorry if this is in the wrong section/format I am using Two Spry XML Datasets to populate 2 dropdown boxes with  vehicle makes and the connected model names (there are other fields but for the sake of clarity I will only show thes

  • Curves or Channel Mixer - which is better?

    Which do you think is better for colour correcting/adjustment (especially CMYK images)