Using a second table in a Database Data Block ??

In a Form, I have a Data Block which is a Database Data Block. The Items are associated with columns in a table.
I want the items in this repeating block to show in a different order. To do this, I need to use a second table and say where table1.key = table2.key ....
I keep getting problems at runtime with
ORA-00918: column ambiguously defined
I tried to qualify everywhere a column name is used. When I do show error it shows
SELECT ROWID, ....
And then the "column ambiguously defined".
I do not have an item in my Form for ROWID. Maybe it is automatic. (This form DOES do update).
Is it possible to use two tables in a Data Block like this?
Thanks

If you only need to order the records in the block, why not defining the "ORDER BY" clause in the block's property??
Set the "ORDER BY" clause at design time from the property palette of the block or runtime with column of your choice.
at runtime your can use:
SET_BLOCK_PROPERTY('your_block', ORDER_BY, 'your_column');If you need to join to tables in one block read the [Block Based on Join|http://www.oracle.com/technology/products/forms/pdf/BlockOnAJoin.pdf] Documentation.
Tony

Similar Messages

  • Unable to Drop table from a corrupted Data Block

    while exporting tables i got message data block corrupted 7481. and while i was trying to drop the table, found SQL Recursive Error.
    Pls Help me. i am on the way to recreate my database..
    Thanks
    Rinson

    Is 7481 the block number?. Block corruption can be diagnosed using the CLI (Command Line Interface) dbv (database verify). You can also diagnose it by looking for the corresponding error message in the alert.log.
    Trying to recover data from a corrupt block is only possible using rman. Otherwise, the only thing you can do is to mark the block as corrupt using DBMS_REPAIR, rebuild the table and try to rescue data by recapturing it.

  • How to insert multiple data to non database data block?

    Hi all,
    I'm new in using form builder. I have a question about insert multiple data to non database data block.
    I want to upload a csv file that content the attendance transaction of all of employees. If the employee in that
    file doesn't exist in that company,so I must record the employee number into non database data block.
    If I just upload one employee data, I can record it to that data block. But, if more than one, it didn't works.
    May you help me?
    Thanks..
    Tika

    you might need a NEXT_RECORD or CREATE_RECORD to go to the next reord in that block. It would be easier to help if we knew your code.

  • Use of second table

    HI I need to get some data from a second table in Oracle 10G test system. What is the best approach?
    This is a clinical table which has to get the Unit Station Description from a second table.
    I am new to Oracle so if someone could describe the steps needed for me that would be great.

    You should join these two tables
    And you should add primary key constraint for the primary table, and foreign key constraint to the second table referencing to first table's primary key column
    Look at this basic example
    SQL> create table tab1 (id number, desc_id number);
    Table created.
    SQL> insert into tab1 values(1,1);
    1 row created.
    SQL> insert into tab1 values(1,2);
    1 row created.
    SQL>  create table tab2_description (desc_id number, description varchar2(10));
    Table created.
    SQL> insert into tab2_description values(1,'one');
    1 row created.
    SQL> insert  into tab2_description values(2,'two');
    1 row created.
    SQL> select tab1.id tab1_id,  tab2_description.description tab2_desc from tab1, tab2_description
      2  where tab1.desc_id=tab2_description.desc_id;
       TAB1_ID TAB2_DESC
             1 one
             1 two
    SQL>- - - - - - - - - - - - - - - - - - - - -
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com

  • Relation between non-database data blocks?

    Hi all,
    I'm using Oracle Forms Builder 10GR2. I have two data blocks and i want to create a relation between them. They aren't database blocks and when i tried to create a relation between them based on a join condition/joining 2 display items/ i received the error :
    FRM-15004: Error while parsing join condition.Any ideas?
    Thanks in advance,
    Bahchevanov.

    Andreas Weiden wrote:
    As far as i know you cannot create relationships between non-db-blocks (or maybe you can create them, but they will not work).Hi
    Oh yes u can for query purposes only e.g. suppose i have dept table and emp table created Master Block as non-db dept_no & Dept_name and a Detail_block with emp tabel and a dept_no as a foreign key ...
    1. we either set up a form relation ship between the two blocks - if we want the user to retrieve data only -
    2. or we use copy value property in the dept_no item in the detail block to get the copied value from the dept_no of the master to the dept_no of the detail
    3.While the user entered or select the dept_no in the Master Block then Press Entered here comes the role of the WHEN-BLOCK-INSTANCE Trigger
    GO_BLOCK('DEATIL_BLOCK_NAME');
    EXECUTE_QUERY;Here the data will be displayed in the detail block accordingly ...
    So the relation here played the role of the Where Statment or the default where to filter the displaing of data in the Detail Block according to the Master Block
    Regards,
    Amatu Allah.

  • Disabling save message when leaving a database data block

    Hi all,
    im using Forms 6i
    I have two data blocks that are database blocks, then the user opens an excel file and a function starts filling the forms with data obtained form the file.
    If i only fill one block there is no problem, but if i start filling the two when i leave one block with go_block it asks me to save the changes.... is it possible to disable that message and then when the procedure finish filling the two blocks the user can commit changues with F10?
    Best Regards,

    try POST before going to next block !

  • Complicated Question (see pdf): Use data from one table to find the same data in a second table and take other data from that table and place it in a third table. :)

    I don't even know if this is posible.
    I'm using iwork '09 
    View PDF

    I hope I can clarify:
    For our purposes here:
    Table 1 = "Step 2 - Product Sizes"
    Table 2 = "Option id Master"
    Table 3 = "Export - Product Info"
    Table 1:
    The user would enter values for "productcode," "Horz," and "Vert"
    "Size" would auto fill based on values in Horiz and Vert (I have this taken care of already).
    Table 2: This is a completely static table that I want to search against. - Data from other tables in the doc does not alter or change the data in this doc.
    We just want to look at table 2. Find the existing value in "table 2 : size" column that matches the "table 1 : size" column  and then pull the "optionids" and "productprice" from that row.
    Can the value from "Table 1 : Size" be used as a search term in "Table 2 : Size?"
    Table 3: The user does not enter any values on this table. 
    "productcode" is pulled from table 1 - "Table 1 :: A5" = "Table 3 :: A5"
    "optionids" and "productprice" are pulled from Table 2 columns "D" and "E" - however we do not know which Table 2 row it is pulling from until we enter data in Table 1.
    As I'm writing this I'm realizing that
    A. this is probably really confusing to you.
    B. this may be impossible inside of numbers.
    If you have some other method that would facilitate the same out come but be structured differently please let me know.
    --- maybe to help you understand further what I am doing here is my current workflow:
    I record the size of a piece of art.
    Then I manually go to my "Option id Master" and find the same size.
    I then copy the corresponding "optionids" and "productprice" cells. (these options control the prices displayed on my website)
    I got to my "Export - Product Info" table and paste the values in the corresponding cells.
    I was hoping to automate this as it takes a long time when you have hundreds of products.
    Thanks for the help!

  • Use of External tables to load XML data.

    Hi,
    I have used external table definitions to load various XML files to the database, usually splitting the XML into seperate records - 1 per major element tag, and using PL/SQL to parse out a primary key to store in a relational table with all of the XML relevant to that primary key value stored as an XMLTYPE coumn in a row of the table. This has worked fine for XML with a single major entity (element tag) .
    However, I now have an XML file that contains two "major" elements (both children of the root) that I would like to split out and store in seperate tables.
    The XML file is of the following basic format:-
    <drugs>
    <drug>drug 1...</drug>
    <drug>drug 2...</drug>
    <partners>
    <partner>partner 1</partner>
    <partner>partner 2</partner>
    </partners>
    </drugs>
    The problem is there are around 18000 elements of the first type, followed by several thousand of the 2nd type. I can create two seperate external tables - one for each element type, but how do I get the external table for the 2nd to ignore all the elements of the first type? My external table definition is :-
    CREATE TABLE DRUGBANK_OWNER.DRUGBANK_PARTNERS_XML_EXTERNAL
    DRUGBANK_XML CLOB
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY DRUGBANK_DIR
    ACCESS PARAMETERS
    ( records delimited by "</partner>" SKIP 100000
    characterset al32utf8
    badfile extlogs:'drugbank_partners_xml.bad'
    logfile extlogs:'drugbank_partners_xml.log'
    discardfile extlogs:'drugbank_partners_xml.dis'
    READSIZE 52428800
    fields
    drugbank_xml CHAR(50000000) terminated by '</partners>'
    LOCATION (DRUGBANK_DIR:'drugbank.xml')
    REJECT LIMIT UNLIMITED
    PARALLEL ( DEGREE 8 INSTANCES 1 )
    NOMONITORING;
    The problem is that before the first <partners> element the 1800 or so <drugs> elements cause a data cartrdige error:-
    ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-29400: data cartridge error
    KUP-04020: found record longer than buffer size supported, 52428800
    This happens regardless of the value of the SKIP or the size of the drugbank_xml field.
    I have tried using an OR on the "records delimited by" access parameter, to 'delimit by "</partner>" OR "</drug>"', with the intention of filtering out the <drug> elements but this leads to a syntax error.
    Anyone ever tried anything similar and got it to work?
    Any other suggestions?
    Thanks,
    Sid.

    No, the content inside quotes is spanned across multiple lines....there are line breaks after every html tag.
    "What's the error message you are getting?"
    Iam not getting any error while selecting from external table , but I am getting tose rows in BAD file and log file has the following entries
    KUP-04021: field formatting error for field TKBS_DSCN
    KUP-04036: second enclosing delimiter not found
    Message was edited by:
    user627610

  • UPDATE using a second table for the Where Clause

    Hi There,
    Hoep someone can help me!
    I am attempting to update a field in Tbl.1 to a known value. However, i want to use another table to specify WHICH records to update.
    in this case i want to use table early_provider to obtain the value 'HCR' then pass that to the UPDATE clause in order to SET early_provisions.type_name = 'HOMC'
    I hope this makes sense.
    UPDATE EARLY_PROVISIONS eps
    SET TYPE_NAME = (SELECT *
    FROM EARLY_PROVIDER ep
    WHERE PROVIDER_TYPE = 'HCR'
    WHERE EP.PROVIDER_ID = EPS.PROVIDER_ID);
    I need to be able to include the field value 'HOMC in this statement but am not sure how, or if i am barking up the wrong tree.
    Much appreciated in advance
    PFG

    PFGMcAvoy wrote:
    Karthick_Arp
    Thanks. this seems to only update 15 rows of which already exist in the table early_provisions and filed type_name!
    I should be selecting about 200 recordsd from early_provider that have the provider_type = 'HCR'
    ??I don't know your data. So i cant answer that. But for what you asked i think thats the correct UPDATE statement. So i think you have to investigate your data to find what is going on.

  • Using functions in Resultset while getting database data.

    Well I'm trying to reset my resultset and it doesn't work.
    Frist I extract data from it. Then I want to start to get other data from hte beginning again. Is this not possible. Can I just get thew data once.
    I'm working with an access database and developping at Oracle 10g
    <select name="kundKontakter" size="1" >          
               <%         
                do{
                 String OID_kont =resultatKontaktNamn.getString("OID_kont");
                 String namnKontakt = resultatKontaktNamn.getString("fKontaktNamn");
                <option value="<%=OID_kont%>" SELECTED><%=namnKontakt%>
                </option>
              <%
                }while(resultatKontaktNamn.next()); %>         
                </select>
                </td>
            </tr>
            <%resultatKontaktNamn.first();%>
            <tr><td>telefon</td>
            <td><input type="text" name="tel" size="40">
             <%=resultatKontaktNamn.getString("tel")%></td></tr>
            </tr>

    No, normally result sets are read-once. If you need to get at data multiple times, you should read it into an an-memory table structure, like a List of Maps (or a List of objects that represent a row on the DB...)
    So, for example, make a class:
    public class Kontakt {
      private String namn, OID, tel;
      public Kontakt(String id, String n, String t) {
        namn = n; OID = id; telefon = t;
      public String getNamn() { return namn; }
      public String getOID() { return OID; }
      public String getTelefon() { return telefon; }
    }Then when you access the database you fill up a java.util.List with a bunch of instances of this class...
      java.util.List kontaktList = new java.util.ArrayList();
      while(resultatKontaktNamn.next()) {
        String OID_kont =resultatKontaktNamn.getString("OID_kont");
        String namnKontakt = resultatKontaktNamn.getString("fKontaktNamn");
        String telefonKontakt = resultatKontaktNamn.getString("tel");
        Kontakt k = new Kontakt(OID_kont, namnKontakt, telKontakt);
        kontaktList.add(k);
      }That all done before you try any display.
    Then, your JSP output will look like this:
        <select name="kundKontakter" size="1">
        <%
          for (java.util.Iterator i = kontaktList.iterator(); i.hasNext(); ) {
            Kontakt kont = (Kontakt)i.next();
        %>
            <option value="<%= kont.getOID()%>" selected="selected"><%= kont.getNamn()%></option>
        <%
        %>
        </select>
      </td>
    </tr>
    <tr>
      <td>telefon</td>
      <td><input type="text" name="tel" size="40">
        <%= ((Kontakt)kontaktList.get(0)).getTelefon() %></input>
      </td>
    </tr>

  • SOA 11g DBAdapter Polling using a Sequencing Table with a DATE Field

    Hi.
    I have implemented a polling solution using a sequencing table that references a DATE column. For the most part the poll works correctly, but on occasion, I am not seeing a BPEL process instantiation for various records that get created in my source table.I have also noticed that in this particular case, the DATE field content on one or more source records is exactly the same --> "YYYYMMDDhhmmss".
    I just want to confirm here, that the polling adapter should be able to pick up multiple records from the source table, even though the date field is exactly the same. As well, how should I go about trying to debug this issue, if point #1 is handled by the system. Is there is a specific log or trace file that I can look at. Also, could I be facing a timing issue ?
    Can someone please comment on this.
    Thanks.

    In my table, I don't see a primary key, but only a unique index. I would assume then, that this would be analogous to the primary key capture; noticed that currently this code was only using one column out of two, from the unique index itself.
    Also, is the date content issue that I mentioned above a moot point then, based upon not having the correct primary key/unique key data pointers established ?
    Thanks.

  • Use of Association Tables in Place of FK's  --  O/R Mapping

    We are currently in the process of redesigning one of our systems following an OO model to be implemented in Java. Our current Oracle database is 8.1.7. We care coding sql in JDBC directly without the use of mapping tools. My role in the project is a jr. schema dba.
    The oo designer on our team objects to holding foreign key attributes in the Java classes when (form the object model's perspective) they aren't need (i.e. using collections will indicate parent-child relationships).
    To get around the "foreign key problem" the oo designer is pushing for the use of "association tables" in the database to replace foreign key relationships. The designer and other members of the team (the sr. schema dba) cite literature on O/R mapping which suggests that this technique is a valid and viable approach.
    So as a simple example...
    DEP EMP
    =======          =======     
    # dep_no     # emp_no
    dep_name     dep_no
              emp_name
    Becomes...
    DEP EMP          A_DEP_EMP
    =======          =======     =========
    # dep_no     # emp_no     # dep_no
    dep_name     emp_name     # emp_no
    Where A_DEP_EMP is the association table showing the relationship between department and employee.
    To me it seems like we are making poor and unnecessary database design decisions to support the object model. My objections to this association table approach is that we are failing to use the inherent strengths of the a relational database:
    1) Both the dep and emp must exist before the association is built (assuming the association has FK's to the DEP and EMP tables) -- and yes I'm aware delaying the enforcement of FKs until commit time is an option
    2) The model does not protect against inserting orphaned emps into the EMP table (assuming we'd want to protect against this)
    3) The association table indicates a N:M cardinality. Assuming the design calls for a 1:M cardinality a UK on the emp_no column in the association table would be required. When I brought this up, the sr. schema dba raised concerns about the overhead of the UK and suggested that the application would be responsible for enforcing the cardinality requirements.
    The alternative that seems more appealing is managing the FK details in a persistence layer of the Java classes (currently the notion of separate view and entity objects is absent in our design -- the database interface is directly in each low-level java class).
    If i am correct in my understanding of Oracle's implementation of BC4J the foreign keys are handled in the persistence layer (view object) with out the need for actively maintaining them in the entity Object. Other O/R mapping models also seem to suggest that this is the way to go (e.g. Martin Fowler's recommendations http://www.martinfowler.com/isa/).
    So my question for the community at large:
    - Which approach would you use?
    - Has anyone been working with association tables in place of foreign keys? If so what are your experiences?
    - am i off-base with my objections?
    any feedback / comments much appreciated

    Martin,
    I have seen these kind of discussions over and over again and now you happen to be right in the middle of one. Without going into technical details some statements that might help:
    1) object model designers and relational model designers will NEVER 'agree' since the techniques used are, by nature, too different (they solve different problems, which is fine, but when you start to talk about them they give problems)
    2) my experience is that they do not have to 'agree', as long as they can 'work alongside eachother'. You are not there to tell the object designers how to do their work the same way they are not there to tell you how to do your job.
    3) as a senior DBA, I regard it my primary task to enforce regulations that will make the data stored as meaningfull and correct as possible. If I'm following relational principles to do so, I will use all of them where I find them applicable regardless how that data is used later on. Any suggestion by any person that undermines this principle will not get implemented. Exceptions (<0.1%) not taken into account. Also, there is a 'political correct' way of telling this and a 'bold' way.
    4) choose the 'political correct' one since it will save you a lot of stress :)
    5) if you violate rule 3, and shit happens, you will be held accountable (and rightfully so).
    6) if you have a more senior person telling you what to do, do it, but state your concerns very clearly in an email and save that mail + reply somewhere safe for future discussions. Refer to this if shit happens and you are, unrightfully so, held accountable.
    7) as a DBA, never trust application logic to enforce data integrity. It is your job, not the application developer's and you have the facilities to do so much easier than the app dev. Application developers don't have a primary task of testing data integrity, if it looks ok on the screen they pass their tests. you on the other hand perform special tests they don't. This is your additional value to the project.
    8) in oracle 8i and above I found the use of views and 'in stead of'-triggers very usefull for mimicing objects. Object designers/developers think they get simple tables they can map objects to and underneatch you yourself check everything is ok. The disadvantage of this is that you need to do some extra work not easily accounted for and might run into some performance issues, but that is your challange as you want to become a senior DBA ;). The advantage is that the discussion is over :) and reporting and other, none object applications can interface more easily (which might be an actual design decisive argument, I've used it successfully multiple times).
    9) try to stay away from discussions of how things are done best between the two methods and why one method 'is better' than the other. Try to find a workable solution that will violate the least of the two designing principles and implement that.
    A lot is dependent on your project and it might be that in your case these senior people are quite right in their suggestions, but I've found that the above 'rules' work most of the time for me. I hope they at least give you something to think about. From what I read from your post, it sounds like you know the technical pros and cons but you have a tough time communicating to your peers. Perhaps these rules help a bit.
    Success,
    Lennert
    We are currently in the process of redesigning one of our systems following an OO model to be implemented in Java. Our current Oracle database is 8.1.7. We care coding sql in JDBC directly without the use of mapping tools. My role in the project is a jr. schema dba.
    The oo designer on our team objects to holding foreign key attributes in the Java classes when (form the object model's perspective) they aren't need (i.e. using collections will indicate parent-child relationships).
    To get around the "foreign key problem" the oo designer is pushing for the use of "association tables" in the database to replace foreign key relationships. The designer and other members of the team (the sr. schema dba) cite literature on O/R mapping which suggests that this technique is a valid and viable approach.
    So as a simple example...
    DEP EMP
    =======          =======     
    # dep_no     # emp_no
    dep_name     dep_no
              emp_name
    Becomes...
    DEP EMP          A_DEP_EMP
    =======          =======     =========
    # dep_no     # emp_no     # dep_no
    dep_name     emp_name     # emp_no
    Where A_DEP_EMP is the association table showing the relationship between department and employee.
    To me it seems like we are making poor and unnecessary database design decisions to support the object model. My objections to this association table approach is that we are failing to use the inherent strengths of the a relational database:
    1) Both the dep and emp must exist before the association is built (assuming the association has FK's to the DEP and EMP tables) -- and yes I'm aware delaying the enforcement of FKs until commit time is an option
    2) The model does not protect against inserting orphaned emps into the EMP table (assuming we'd want to protect against this)
    3) The association table indicates a N:M cardinality. Assuming the design calls for a 1:M cardinality a UK on the emp_no column in the association table would be required. When I brought this up, the sr. schema dba raised concerns about the overhead of the UK and suggested that the application would be responsible for enforcing the cardinality requirements.
    The alternative that seems more appealing is managing the FK details in a persistence layer of the Java classes (currently the notion of separate view and entity objects is absent in our design -- the database interface is directly in each low-level java class).
    If i am correct in my understanding of Oracle's implementation of BC4J the foreign keys are handled in the persistence layer (view object) with out the need for actively maintaining them in the entity Object. Other O/R mapping models also seem to suggest that this is the way to go (e.g. Martin Fowler's recommendations http://www.martinfowler.com/isa/).
    So my question for the community at large:
    - Which approach would you use?
    - Has anyone been working with association tables in place of foreign keys? If so what are your experiences?
    - am i off-base with my objections?
    any feedback / comments much appreciated

  • Form blows up when clicked in data block using a FROM clause query

    Hi,
    I have a form that has two blocks. The detail block is based on a "FROM query clause" in the 'Query Data Source Type' in the block Properties.
    I have a simple select in the 'Query Data Source Name'.
    I made sure the select is enclosed in parenthesis and the alias names in the SELECT are the same as the ITEMS defined in the block
    The data needs to be displayed in a tabular fashion.
    When I run the form, the data is displayed correctly..but when I click the mouse on any item of this block or try to scroll down, everything just blows up and it closes my form.
    I have made sure both blocks have the same properties. But, this seems to happen no matter what.
    Any help in regard is greatly appreciated.
    Thanks much,
    Vijji

    This is how I set the relationship for the detail block say BLOCK2.
    1. I first do this:
    Database Data Block = YES
    Query Allowed = YES
    Query Data Source Type = FROM clause query Query Data Source Name = ( select jio.order_header_id order_header_id, jii.item_code item_code, SUM(jii.item_qty) item_qty from joe_indv_items jii, joe_indv_orders jio where jii.indv_order_id = jio.indv_order_id group by jio.order_header_id, jii.item_code )
    The master and detail need to be tied by the order_header_id which I can get from the header block.
    2. In the WHEN-NEW_BLOCK-INSTANCE trigger for BLOCK2, I wrote the following where I dynamically pass the order_header_id:
    DECLARE
    q varchar2(1000);
    BEGIN
         q := '(SELECT jio.order_header_id order_header_id,
         jii.item_code item_code,
         SUM(jii.item_qty) item_qty
         FROM joe_indv_items jii, joe_indv_orders jio
         WHERE jio.order_header_id = ' || :HEADERS.order_header_id||'
         AND jii.indv_order_id = jio.indv_order_id
         GROUP BY jio.order_header_id, jii.item_code )';
         CLEAR_BLOCK;
    SET_BLOCK_PROPERTY('BLOCK1', QUERY_DATA_SOURCE_NAME, q);
    EXECUTE_QUERY;
    END;
    I am not sure if I should write the exact select statement in the Query Data Source Name or not.
    Please advice.
    Thanks much,
    Vijji

  • How to query two data blocks simultaneously?

    Dear all,
    Need your inputs on the following problem statement...
    Existing Functionality:
    We have two data blocks A (Parent) and B (Child) in a relationship. Both data blocks refer to different tables.
    Data block A is the query data block and for a single record in block A we can have multiple records in block B. Multiple records in block B are shown one at a time after executing a query, this is implemented by using a list item C (belongs to a third block).
    For example
    Let us say block B can have 5 different types of entries for each record in block A. In this case the list item C will have 5 values corresponding to these entries. Once the query is executed, block B will show the default entry for the queried record in block A. To see other entries for the record user can select the required value in list item C and corresponding entry in block B will be fetched.
    Requirement:
    Our requirement now is to enable querying upon both data blocks A and B simultaneously. To implement this I replaced data blocks A and B with a single data block X which is based on the join of the two tables referred by the Data blocks A and B earlier. As the fields should allow insert, update, delete operations we did not use a view here.
    Issue:
    Now the problem is, each record in block A for which block B had multiple entries earlier is now getting listed multiple times because of the join.
    I have tried but could not find any solution for this. I would appreciate if any of you can suggest how we can query both blocks simultaneously without affecting the existing functionality.
    Thanks,
    Amit

    I don't understand your requirement in detail. I try to repeat what i understood so far.
    You have a master-block A based on a table A and a detail-block B based on a table B. So far so good. You can now query based on conditions just the datablock A, because B is a detail and therefore can only be queryied in context of block A.
    Your reuirement is to query on both blocks A and B and find block in B also without giving conditions for the relevant block A.
    Is it that ?
    What i don't understand, what is block C used for?
    An idea for the querying of block B's data: Create Non-database-items items in block A for the search-criteria you need on block B and make them Queryable.
    In the PRE-QUERY-trigger on block A build a WHERE-condition if that search-criteria is entered, something like
    IF :BLOCK_A.SEARCH_CRITERIA_FOR_BLOCK_B IS NOT NULL THEN
      SET_BLOCK_PROPERTY('BLOCK_A', ONETIME_WHERE, 'WHERE PKVALUE IN (SELECT FKVALUE_TO_A FROM TABLE_B WHERE FIELDVALUE=' ||:BLOCK_A.SEARCH_CRITERIA_FOR_BLOCK_B)');
    END IF;This would query also records to A for which you want to have the B-records. So you could keep block-structure up to master-detail.

  • Query from multiple data blocks

    Hello professionals,
    I having difficulty in finding solutions to query data from multiple data blocks. By the way I'm using Oracle Forms 10g
    I have 4 data blocks and all items are database items
    Below are the blocks,
    1. student_main (columns : student_id, student_name, student_state)
    2. subject_main (columns : subject_id, subject_desc, subject_student_id)
    3. invoice_main (columns : invoice_no, invoice_amt, invoice_student_id)
    4. receipt_main (columns : receipt_no, receipt_amt, receipt_invoice_ref)
    The form will need to allow user to be able to query from any of the items/fields from the data blocks as listed above
    For eg,
    : if user query student_id then all related value items from table subject_main, invoice_main, receipt_main need to be displayed
    : if user query invoice_no then all related value items from table student_main, subject_main, receipt_main need to be displayed
    However the tricky part is that some student might have or might not have invoice / receipt data
    I tried using relations but it didn't work both ways
    I even create relations in every table (student_main to subject_main, subject_main to student_main, invoice_main to student_main, student_main to invoice_main and etc.) but it just make my running process hang
    Need help on this matter
    Thank you
    Edited by: 990092 on Feb 25, 2013 12:15 AM

    990092 wrote:
    Hello professionals,
    I having difficulty in finding solutions to query data from multiple data blocks. By the way I'm using Oracle Forms 10g
    I have 4 data blocks and all items are database items
    Below are the blocks,
    1. student_main (columns : student_id, student_name, student_state)
    2. subject_main (columns : subject_id, subject_desc, subject_student_id)
    3. invoice_main (columns : invoice_no, invoice_amt, invoice_student_id)
    4. receipt_main (columns : receipt_no, receipt_amt, receipt_invoice_ref)
    The form will need to allow user to be able to query from any of the items/fields from the data blocks as listed above
    For eg,
    : if user query student_id then all related value items from table subject_main, invoice_main, receipt_main need to be displayed
    : if user query invoice_no then all related value items from table student_main, subject_main, receipt_main need to be displayed
    However the tricky part is that some student might have or might not have invoice / receipt data
    I tried using relations but it didn't work both ways
    I even create relations in every table (student_main to subject_main, subject_main to student_main, invoice_main to student_main, student_main to invoice_main and etc.) but it just make my running process hang
    In general, relation will work. your relation creating was wrong, i think.
    do as
    1. student_main master to subject_main details
    2. student_main master to invoice_main details
    3. invoice_main master to receipt_main details
    Hope this helps
    Hamid

Maybe you are looking for