How to do where clause within the where clause?

Hello.
I have had a look in the previous postings, OWB help and user guide - and can't seem to find how to do the following in OWB:
insert into table A (col1, col2, etc)
(select col1, col2 etc from table B where col2 is (select col3 from table C where col3 = 'I'));
Filter doesn't want to cope with this. Key lookup - doesn't want to cope with this either.
If you know how to do it - please help. It is a vry simple query ( i always seem to be struggling with simple stuff and all the fancy stuff works fine!) :) but i don't know how to do it in OWB. Double-filter somehow? Is there some wonderful operator somewhere that i am not using to a full potential?
Thank you very much for all your help and support
Warmest Regards
Vix

insert into table A (col1, col2, etc)
(select col1, col2 etc from table B where col2 = 'I');
Hi Arnab :)
If only!
The query looks like this:
insert into table A (col1,col2)
select (col1,col2) from table B
where col2 in (select col3 from table C where col3 = 'I'));
hope it makes sense. It should only insert records into table A from table B if records have corresonding entry in table C and this one ofthe attrubutes of this entry = 'I'.
I am trying to convince here that we should be using more views so hopefully i would be able to; joiner is too cluncky and not as fast. As for now i solved it with:
function that check if col2 has corresponding rec in table C then passed either value or null into filter. Filter then compares the two and if value is not null - it will insert this record from table A into table B. Phew!
BTW - i am now trying to get an answer to this misterious java.lang.exeption (my other topic) as soon as i hear anything - will keep you posted.
Thank you very much for all your help and understanding.

Similar Messages

  • How can I create cursors within the cursor?

    How can I create cursors within the cursor?
    Table1 2001 - 2007 data
    Account_no
    Account_eff_dt
    No_account_holder
    Num
    Seq_Num
    Value1
    Value2
    Table2_Historical (doesn't have Num as a field) 1990 - 2000 data
    Account_no
    Account_eff_dt
    No_account_holder
    Seq_Num
    Value1
    Value2
    Table3_06
    Account_no
    Account_eff_dt
    No_account_holder
    Num
    My result table should be:
    Table_result_06
    Account_no
    Account_eff_dt
    No_account_holder
    Num
    Value1_min (the minimum value for the minimum of record_sequence)
    Value2_max (the maximum value for the maximum of record_sequence)
    I have to get data from Table1 and Table2_Historical. If one account was open in 1998 and is still effective, the minimum value of that account is in the Table2_Historical.
    Let's say I open a cursor:
    cursor_first is
    select * from table3_06;
    open csr_first
    loop
    fetch cursor_first into
    v_Account_no
    v_Account_eff_dt
    v_No_account_holder
    v_Num
    EXIT WHEN csr_first%NOTFOUND;
    How can I open a second cursor from here that will get the Seq_Num from Table1
    csr_second
    select Seq_Num from Table1 where
    v_Account_no = Account_no
    v_Account_eff_dt <= Account_eff_dt
    v_No_account_holder=No_account_holder
    v_Num = Num
    How does it works???
    Thanks a lot

    Thanks so much for replying back. Here is what I am trying to do.
    I have to create a table for each year 2002, 2003, 2004, 2005, 2006 that has all the account numbers that are active each year plus some other characteristics.
    Let’s say I will create Table_result_06. This table will have the following fields. The account number, account effective date, Number of the account holder and the field Num (The primary key is a combination of all 4 fields), the beginning look of value 1 in 2006, the last look of value 1 in 2006.
    Table_result_06
    Account_no key
    Account_eff_dt key
    No_account_holder key
    Num key
    Value1_min (the minimum value for the minimum of record_sequence)
    Value2_max (the maximum value for the maximum of record_sequence)
    All the active account numbers with the Account_eff_dt, No_account_holder and Num are in the Table3. As such I can build a query that connects Table3 with table Table1 on all 4 fileds, Account_no, Account_eff_dt, No_account_holder, Num and find the Value1_min for the min of req_sequence in 2006 and Value1_max for the max of req_sequence in 2006. Here my problem starts.
    Table 1 doesn’t have a new entry if nothing has changed in the account. So if this account was open in 1993 and nothing has changed I don’t have an entry in 2006 but this doesn’t mean that this account doesn’t exist in 2006. So to find the minimum value I have to go back in 1993 and find the max and min for that year and that will be max and min in 2006 as well.
    As such I have to go to Table_2 historical and search for min and max. But this table doesn’t have the field NUM and if I match only on the Account_no, Account_eff_dt and No_account_holder I don’t get a unique record.
    So how can I connect all three tables, Table 1 for max and min, if it doesn’t find anything will go to table 2 find the two values and populate Table_result_06.
    Thanks so much again for your hep,

  • How can I POST data within the same page if I have a A HREF -tag as input?

    How can I POST data within the same page if I have a <A HREF>-tag as input? I want the user to click on a line of text (from a database) and then some data should be posted.

    you can use like this or call javascript fuction and submit the form
    <form method=post action="/mypage">
    cnmsdesign.doc     
    </form>

  • With acrobat 7, how do I make links (within the pdf) open in a new window-tab?

    With acrobat 7, how do I make links (within the pdf) open in a new window-tab?

    No love? From anyone?

  • How to find referenced photos within the Photos app

    Problem:
    Upon instructing Photos to use iCloud Photo Library, the app informed me:
    "104 referenced files in your library will not upload to iCloud Photo Library. Select referenced files in your library and choose 'Consolidate' from the File menu to copy the original files into the library."
    I do not know which 104 images in my library are referenced, and therefore cannot use "Consolidate" to import the masters into the library.
    Can anyone tell me how to find referenced files, within the active library in the Photos app?
    I am not asking how to use the "Show Referenced File in Finder" menu command. I need to identify a file as referenced first, hence this post!

    Gotcha - came up with a workaround... since the photos were living in the Photo Library packaged itself, and not simply in another regular folder, I right clicked on the library and said show packaged content, then search for what folders the files lived in, then copied the files out of the packaged library into a folder. Then I was able to give the Photos Library access to the new folder with the files.
    With all my files now references, I enabled iCloud Photo Library and am uploading now.
    Hopefully my new local Photo Library will be smart enough to optimize local images and shrink to give me more space.
    Thanks.

  • HOW points get you privileges within the community

    1. Create an account.
    2. Receive welcome email: "Welcome to Apple Support Communities! ... "Participate: Check out the community by reading existing discussions and see what the latest buzz is about. Got answers? Post responses, enlighten the community, and earn points! See how points get you privileges within the community."
    3. Go to link to see how points get you privileges.
    4. Read what points are...
    OK, so it explains how to get points and that they give you privileges, but no mention of how points get you privileges or link to that information. Not that I really care, but pointing it out. Is it just another "status" in our communities for people to feel good about [authoratative, look at me], or does it really provide something worthwhile relative to being helpful and providing Apple's support for them?

    Refer to ... 'More like this', this page, right hand column, bottom entry ... 'What's the benefit of accruing points in Apple communities'
    Carolyn Samit's excellent answer details all the levels and the justification for taking part in community discussions.
    Personally, simply scouting around the different sections is an education in itself and I would heartily recommend you to take an interest.

  • How to - correct episode order within the Remote App

    Recently I found that when i was using the Remote App to control my iTunes Library, all my TV Show episodes where in alphabetical order instead of episode number order.
    after searching on how to solve this and speaking with Apple Support (who couldn't figure out why this was happening) i couldn't find the answer and noticed that many people were having this same issue and were in the same boat as me.
    i managed to solve the issue and wanted to share. sorry if i have posted this in the wrong area, first time giving advise on here.
    ill run through this using The Walking Dead - Season 1 as an example, but this can obviously be done with any TV Show.
    Even with the correct episode numbers, iTunes displays the episode in the correct order -
    but in alphabetical order within your library on the remote app -
    in iTunes - highlight all episodes and get info
         2. under the Options Tab, change the Media Kind to Music Video and click OK at the bottom
         3. Then head over to where you Music Videos are stored
         4. select each of the episodes, get info
         5. under the Details Tab, you will now have more options to select
         6. scroll to the bottom of the Details Tab, and within the Album Artist section, type in "The Walking Dead"
         7. in the Disc Number section, you want to add which season of how many seasons there are. example - I have 4 seasons of The Walking Dead within my library, and as this is season 1, i will enter 1 of 4
         8. next, in the Track section, you want to add which episode of how may episodes in that season. example - this is episode 1 of 6 in the season
         9. next go into the Options Tab, and change the Media Kind back to TV Show
         10. click OK at the bottom
         11. once you have done this for each episode, head back into your TV Shows
         12. when you now get info for each of the episodes, the Album Artist, Disc Number and Track sections should be at the bottom of the Details Tab (if they were not there before)
         13. if this has been done correctly - all episodes should be correctly listed within the remote app by episode order
    Hopefully this has helped somebody out there!

    Gotcha - came up with a workaround... since the photos were living in the Photo Library packaged itself, and not simply in another regular folder, I right clicked on the library and said show packaged content, then search for what folders the files lived in, then copied the files out of the packaged library into a folder. Then I was able to give the Photos Library access to the new folder with the files.
    With all my files now references, I enabled iCloud Photo Library and am uploading now.
    Hopefully my new local Photo Library will be smart enough to optimize local images and shrink to give me more space.
    Thanks.

  • How do you list tables within the tablespace?

    Does anyone know how to list and view the tables within the tablespace. I am new to Oracle and I would like to view the tables, but my documentation is telling me how to create everything, but not to view it. Please advise, and thanks again.

    select owner, table_name
      from user_tables  -- or all_tables, or dba_tables
    where tablespace_name = :ts_name;

  • How is index data managed within the cluster?

    Hello
    We are in the process of evaluating Coherence.
    With regard to indexes, am I correct in thinking that the data for the index is stored in an (internally managed) cache on the same node as the attendant indexed values? I'm not interested in getting at the index data, but rather just understanding how the index data itself is treated/stored within the cluster.
    So in a 2 node cluster where an index is applied to a distributed cache that only has 2 entries, will there be an index cache on each node that has 1 {Binary,key} entry where the key points to the value that is stored on that same node? That is, I trust that the index data is spread out across the cluster in the case of a partitioned topology?
    Regards
    Peter

    user11279467 wrote:
    Hello
    We are in the process of evaluating Coherence.
    With regard to indexes, am I correct in thinking that the data for the index is stored in an (internally managed) cache on the same node as the attendant indexed values? I'm not interested in getting at the index data, but rather just understanding how the index data itself is treated/stored within the cluster.
    So in a 2 node cluster where an index is applied to a distributed cache that only has 2 entries, will there be an index cache on each node that has 1 {Binary,key} entry where the key points to the value that is stored on that same node? That is, I trust that the index data is spread out across the cluster in the case of a partitioned topology?
    Regards
    PeterHi Peter,
    up to 3.4.x indexes were supported only on partitioned topology, and yes, indexes on each node contain only data corresponding to entries which have their primary copy on that node (referred to as local entries from now on).
    The indexes are not stored in a cache but they are managed as part of the information Coherence maintains about the backing map (the map which contains local entries).
    The indexes are made of 2 parts:
    - forward index: this is a mapping from the cache key in an internal representation (backing map keys from now on) to the value extracted with the extractor used to create the index from the entry belonging to the cache key (extracted value from now on)
    - reverse index (aka. reverse map): this is a mapping from the extracted value to a set of backing map keys of entries from which the reverse index key was extracted with the extractor used to create the index
    The index can be sorted which means that the reverse index will be a SortedMap (so sorting order is the ordering of extracted values)
    Let's see an example. Assuming you have the following cache content within a particular storage-enabled node :
    A --> Object (getX=5 ,...)
    B --> Object (getA=3 ,...)
    C --> Object (getA=3 ,...)
    D --> Object (getA=4 ,...)
    The forward index in that node will contain:
    Binary(A) --> 5
    Binary(B) --> 3
    Binary(C) --> 3
    Binary(D) --> 4
    The reverse index will contain:
    3 --> { Binary(B), Binary(C) }
    4 --> { Binary(D) }
    5 --> { Binary(A) }
    Where Binary(...) means the internal (binary) representation of the ... object.
    If the index is not ordered, then the order of iteration on entries in the reverse index are not deterministic.
    If the index is ordered, then the iteration of entries in the reverse index will be as shown above. Also, you can cast the reverse index to SortedMap so you have the very useful headMap and tailMap and firstKey and lastKey methods.
    Hope this helps.
    Best regards,
    Robert

  • How to determine InfoCube name within the update rule start routine?

    We are attempting to delete all the records where all key figure values are zeroes. We have about 15% of such records and we really don't need them.
    We have yearly InfoCubes. We copy the InfoCube and update rules at the end of every year. So, we don't want to hard code any field names within the update rules.
    If I could determine the target InfoCube name within the update rule start routine, I can find out all the key figures dynamically. But, I don't see a way of finding out the InfoCube name.
    If you would share any ideas, I would really appreciate.
    Thanks.
    Sudhi Karkada.

    Hi Sudhi,
    I dont know if this is what you are looking for.
    if you want to delete a record from being inserted when all the Key figure values are ZERO then you can use a Update Routine for some characteristic in the below way
    If looking for the InfoCube:
    if COMM_STRUCTURE-KF1 = 0 and COMM_STRUCTURE-KF2 AND....
      RETURNCODE = 4.
    else
      RESULT = COMM_STRUCTURE-ChanracteristicObject.
    endif.
    If it is to an ODS / InfoCube in the start routine.
      DELETE DATAPACKAGE where KF1=0 and kf2=0 and .....
    Hope it helps.
    Regards,
    Praveen.
    ENDLOOP.
    Message was edited by: Praveen

  • How Can I open Report within the same window instead of separate Window

    Hi All,
    I want to open report in my MDI form instead of opening it into a separate Oracle Report Navigator(i.e. Window which shows the report). How to do that? When I click the Report from Menu it should open it within the MDI Form. Any suggestion or reply would be greatly appreciated.
    One more question is how can i open report with in a maximized state. Actaully, the report will be opened in the normal state. How to open in maximized state instead of normal state. Is there any property in reports to acheive this?
    Thanks in Advance.
    Regards
    Gopinath Kona

    hello,
    reports is a separate application that is called from forms and therefore is running outside the context of the forms MDI window.
    you can use the commandline parameter MAXIMIZE=YES to start the runtime in full-screen-mode.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to create an object within the same class???

    hi im just a newbie
    i v been always creating an object from the main class..
    but how to create an object inside the same class??
    i got main and students class
    the main got an array
    Students[] stu = new Students[]
    and i got
    stu[i] = new Students(id,name);
    i++;
    but i wanna do these things inside the Students class..
    i tried ..but i got errors.....
    how to do this
    .

    javaexpert, :)
    I really have no idea what you are trying to do since you say you've always been creating an object from the main class, yet you always want to create an object inside the same class.
    I'll assume that you have an object in the main class that you are trying to access from the Students class.
    If you are trying to access objects that are contained within the main class FROM the Students class, then know that there are two ways of doing so, one being static, and the other dynamic (look up definitions if unclear):
    1.) make the objects in the main class both static and public and access the the objects using a convention similiar to: Main.object; It's important to note that Main is the name of your main class, and object is a static object. There are better ways of doing this by using gettter/setter methods, but I'll omit that tutorial.
    2.) Create a new instance of the main class and access the objects using a similiar fashion: Main myInstance = new Main(); myInstance.myObject;
    You should really use getter and setter methods but I'll omit the code. In terms of which approach is better, step one is by far.
    I don't mean to be condecending, but you should really brush up on your programming skills before posting to this forum. This is a fundamenetal concept that you will encounter time and time again.

  • How do you order topics within the Project Manager?

    Hi all,
    I notice that the workflow in RH is that first you use the
    Project Manager (PM) to build a sort of structured topic database,
    and then you use the database to generate a TOC.
    Ok, so far so good, but the immediate little issue I am
    having is that I see that the PM arranges my topics within each
    folder in alphabetical order. Since, by default, the TOC is
    generated with the topics in this default order, I would like to
    change the order in which the topics are arranged within the PM. I
    don't seem to find any way to do this. I can't drag and there are
    no Move buttons for this pod. What am I missing?
    TIA
    - avi

    Hi Avi
    You aren't missing anything. That's the way it works with the
    Project Manager Pod. It simply lists your topic files in
    alphabetical order.
    For starters, I would never recommend that anyone always
    automatically create the TOC. I might suggest using that only as a
    first step in building a TOC. After it has been built initially,
    any added or amended topics would then be manually added and
    rearranged by you after the changes have been made.
    Unless you are happy with things that way (and I assume you
    aren't as you are posting to ask how to make it different) you will
    find yourself constantly frustrated. Note that if you auto create
    the TOC, you get ALL topics inside. And in many help files there
    are topics that never see the light of day in the TOC structure.
    All that aside, I do see a great many folks that want to have
    an ability to arrange topics in their Project Manager pod as they
    want. For you and anyone else that wants this, you should consider
    submitting a Wish Form to ask for the feature.
    Click
    here to view the WishForm/Bug Reporting Form
    Cheers... Rick

  • How to use multiple profiles within the same instance of Thunderbird

    About a month ago, I had Thunderbird configured with three profiles,
    and all three could be used within a single startup/instance of
    Thunderbird. That PC is now gone. I have re-configured the three
    profiles on a new PC, but am having trouble making all three
    useable within the same instance of Thunderbird. Can you help?
    Both PCs are/were Windows-7 64 bit.

    Thunderbird only opens on the default if one profile
    or
    if Profile Manager is instructed to ask at startup it will allow you to choose which Profile to open else it opens on the last Profile used..
    So it shows one Profile at a time in one instance of Thunderbird.
    However, one Profile can have many mail accounts.
    eg: I run 4 mail accounts in one Profile.

  • How invoke methods in order within the class?

    I want to invoke all the methods of a class (except the constructor) in the order in which they appear within the class. I have been able to do this using the following code:
    Method [] methodArray = this.getClass().getDeclaredMethods();
    for (int i = 1; i < methodArray.length; i++)
    methodArray.invoke(this, null);
    However, according to the javadoc for class Class, getDeclaredMethod, the elements of the Method array "are not in any particular order." So although the elements of the array happened to be in the order I wanted them when I ran the code, it seems that I will not be able to consistently RELY on the Method array to be set up in this way.
    My question is, in view of what I see when I execute the code, is it possible that the javadoc is overly-cautious, and that the Method objects in fact WILL ALWAYS be placed in the array in the order in which they appear in the class, in spite of the javadoc disclaimer?
    Maybe there's a better way to do what I'm trying to do. The reason I want the methods to execute in this order is that each method is a test case for a component I am testing, and I want the test cases to run in the order coded, using the Method array, without having to embed a number within each method name so that the array can be sorted into the desired order. In addition, I don't want to have to add a new method call to my class whenever I add a test case to it. Is this asking too much?

    The reason the Javadocs are full of disclaimers like this is to highlight the fact that there is no specific contract for a certain behaviour. Because Java is cross-platform, results must be predictable, at all times. So if the spec doesn't require a certain order to be enforced, the docs highlight this. Maybe no implementation takes advantage of this, maybe some do, the fact is as you rightly pointed out, you can't rely on it. So it looks like you are back to hard-coding some state that will let you sort the method order.
    Of course, if you are just settingup a test rig to automagically test the code you write, you can take a chance and rely on your implementation on your machine. But don't tell anyone I told you this.

  • How to manage multiple operation within the same partner link ?

    Hi,
    I have a partner link with 2 possible operations : "sayYes" and "sayNo".
    I want to do the following : if the operation is "sayYes", I return "YES", if it's "sayNo", I return "NO".
    (not really complex... in theory)
    In my WSDL file, I have the following :
         <message name="TestPickRequestYesMessage">
              <part name="payload" element="client:TestPickProcessYesRequest"/>
         </message>
    <message name="TestPickRequestNoMessage">
              <part name="payload" element="client:TestPickProcessNoRequest"/>
         </message>
         <message name="TestPickResponseMessage">
              <part name="payload" element="client:TestPickProcessResponse"/>
         </message>
         <portType name="TestPick">
              <operation name="sayYes">
                   <input message="client:TestPickRequestYesMessage" />
                   <output message="client:TestPickResponseMessage"/>
              </operation>
    <operation name="sayNo">
                   <input message="client:TestPickRequestNoMessage" />
                   <output message="client:TestPickResponseMessage"/>
              </operation>
         </portType>
    The returned value is in a string variable : "return_value".
    I've created a "pick" activity :
    <pick name="Pick_1" createInstance="yes">
    <onMessage portType="client:TestPick" operation="sayYes"
    variable="inputVariableYes" partnerLink="TestPick">
    <sequence name="Sequence_1">
    <assign name="setReturnYES">
    <copy>
    <from expression='"YES"'/>
    <to variable="return_value"/>
    </copy>
    <copy>
    <from variable="return_value"/>
    <to variable="outputVariable" part="payload"
    query="/client:TestPickProcessResponse/client:result"/>
    </copy>
    </assign>
    <reply name="replyOutputYES" partnerLink="TestPick"
    portType="client:TestPick" operation="sayYes"
    variable="outputVariable"/>
    </sequence>
    </onMessage>
    <onMessage portType="client:TestPick" operation="sayNo"
    variable="inputVariableNo" partnerLink="TestPick">
    <sequence name="Sequence_2">
    <assign name="setReturnNO">
    <copy>
    <from expression='"NO"'/>
    <to variable="return_value"/>
    </copy>
    <copy>
    <from variable="return_value"/>
    <to variable="outputVariable" part="payload"
    query="/client:TestPickProcessResponse/client:result"/>
    </copy>
    </assign>
    <reply name="replyOutputNO" partnerLink="TestPick"
    portType="client:TestPick" operation="sayNo"
    variable="outputVariable"/>
    </sequence>
    </onMessage>
    </pick>
    !http://www.monsterup.com/image.php?url=upload/1237201855.png!
    [http://www.monsterup.com/image.php?url=upload/1237201855.png]
    !http://www.monsterup.com/image.php?url=upload/1237201924.png!
    [http://www.monsterup.com/image.php?url=upload/1237201924.png]
    When I deploy and test this application, I have a huge problem : if a choose a "*sayNo*" message, my application do the following :
    The "pick" activity logs :
    <inputVariableYes>
    - <part name="payload" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <ns1:TestPickProcessNoRequest xmlns:ns1="http://xmlns.oracle.com/TestPick">
    <ns1:input>
    blabla
    </ns1:input>
    </ns1:TestPickProcessNoRequest>
    </part>
    </inputVariableYes>
    I have a right "*TestPickProcessNoRequest *" message type.
    BUT, the next activity is "setReturnYES", instead of "setReturnNO".
    !http://www.monsterup.com/image.php?url=upload/1237201958.png!
    [http://www.monsterup.com/image.php?url=upload/1237201958.png]
    Can anyone tell me where I'm wrong ?
    It looks like the "pick" activity always go with the first sequence...

    Hi PhunkyBob,
    I also had a hard time, finding out that the problem was with the BPEL console and not with my processes -.-
    Perhaps it's the Browser, I too use Firefox. Did not try it in IE yet.
    Here is the solution, try to switch to XML View and then change the Operation! (you will notice that it changes properly) Then you can either send it that way or return to HTML View.
    I have always to it that way,.. gets really annoying when I have to test a process many times :-/ ...change to xml, change operation, back to html, making entries, send...
    If someone has a solution, other than changing the Brwoser, please post :-)
    greetings,
    Michael

Maybe you are looking for