Relation between data blocks

i want to join two tables with one to one relation between them using oracle form developer 10g but the problem is that using the oracle developer you can only display only one record from the second table at the same time related with current record from the first table,but what i need is to display all the records from the first table with their related records from the second table.( i can make a view joining the two tables, but i want to know if there is a way to do it using the form developer).

Hi!
I don't think it's possible to implement using Forms relations. What you can try to do is to create KEY-EXEQRY trigger on your 'master' block with the following content:
EXECUTE_QUERY;
GO_BLOCK( 'detail' );
EXECUTE_QUERY;
GO_BLOCK( 'master' );
On block 'detail' create PRE-QUERY trigger. Use :SYSTEM.LAST_QUERY to get WHERE clause from 'master' block to get set of PK or whatever which can be used in 'detail' block to query correspondent set of records, and modify 'detail' block 'WHERE clause' property.
Another approach whould be to have your 'detail' block PK as a VARCHAR2 field and do something like this:
:detail.PK := '# IN (' || your_where_clause || ')';
It's just a rough idea without too much implementation details.
Regards,
Andrew Velitchko
BrainBench MVP for Developer/2000
http://www.brainbench.com

Similar Messages

  • Create relation between two blocks which are based on different procedure

    Hiii
    How to create relation between two blocks which are based on different stored procedures in Oracle form??
    Pradhyumn Sharma

    hiii,
    I selected the common key deptno in both procedure.
    I created a relation between both procedure. but when i compile the form it give an error in ON-CHECK-DELETE-MASTER. My procedure are
    ==================================
    PACKAGE emp_pkg AS
    TYPE emprec IS RECORD(
    empno asg_emp.empno%type,
    ename asg_emp.ename%type,
    job asg_emp.job%type,
    sal asg_emp.sal%type,
    deptno asg_emp.deptno%type);
    TYPE emptab IS TABLE OF emprec INDEX BY BINARY_INTEGER;
    PROCEDURE empquery(block_data IN OUT emptab, p_deptno IN NUMBER);
    end;
    ====================================
    PACKAGE dept_rec IS
    type rec is record(dname asg_dept.dname%type,
         loc     asg_dept.loc%type,
         deptno asg_dept.deptno%type);
    type deptrec is table of rec index by binary_integer;
    PROCEDURE dept_rec1(block1 in out deptrec);
    END;
    ===================================
    In ON-CHECK-DELETE-MASTER
    CURSOR BLOCK9_cur IS
    SELECT 1 FROM dept_rec.dept_rec1 d
    WHERE d.DEPTNO = :BLOCK6.DEPTNO;
    identifier dept_rec.dept_rec1 must be declared.
    Regards
    Pradhyumn

  • Using built-in function in the definition of relation between two blocks...

    Hi ,
    Is it possible to define a relation between two form blocks(db based) ....
    I have a master table such as:
    table : strdet (cols: ms varchar2(10) , det varchar2(10))
    materialized view : mv (cols : det varchar2(10) , sum_a number(5), sum_b number(5))
    and data:
    strdet
    ms                   det
    1                     1.1
    1                     1.2
    1.1                  1.1.1
    1.1                  1.1.2
    1.1.1               1.1.1.1
    e.t.c.
    and for the mv
    det               sum_a     sum_b
    1                   500        300
    1.1                100        200
    1.2                540        150
    e.t.c.
    I have tried some versions of relations so as to create a master-detail relation(in reality , the two blocks are connected via ms.det
    ->mv.det...  but the relation is one-to-one....) . I want a result such as:
    Master block
    1.1
    Detail Block
    1.1.1
    1.1.2
    e.t.c.Is it possible somehow...????
    Note: I use Dev6i and Dev10g ...
    Thanks ,,,
    Sim

    I think you'll have to use a from-clause-query for the detail block. If you join the master table and the mv on the DET column then you can give each row in the detail block a MS column (from the master table) which you can use in the relation.

  • Co-relation between oracle blocks and OS blocks ??

    how is the database data-block co-related withe the OS data-block ??

    Akshay,<br>
    <br>
    Ca va, merci. ;-)<br>
    In the doc above, we can read "Each operating system has a block size. Oracle requests data in multiples of Oracle data blocks, not operating system blocks.".<br>
    <br>
    Anyway, you can search into Oracle doc, and find DB_BLOCK_SIZE Initialization Parameter : If a database's block size is different from the operating system block size, make the database block size a multiple of the operating system's block size.<br>
    <br>
    Nicolas.

  • Relation between Date Profile and Action Profile

    Hi Folks,
    I don't want any date profile assigned to my transaction type SLFN. When I took out date profile and saved system gave me error "Action profile is only allowed with date profile SLNF_HEADER". I have assigned Z action profile to SLFN.
    Is there any relation between both them? Where do we maintain it?
    Points would be rewarded.
    Regards,
    Nikhil

    Hi Nikhil,
    Its mandatory to have date profile for actions.Because once you execute the actions it picks up the date based of the profile and system date, and maintain that information in the system.
    I think we can only have print actions without date profile.
    Regards
    Arun Kumar

  • How to create an relation between two block

    Oracle forms 6i
    Hai All
    I have created a form in that i have four button ADD, QUERY, SAVE ,EXIT.
    I have two block named Leader and members.
    Four fields in leader block namely name , codeno, deptcode, unitid.
    When i pressed query button and the cursor goes to name field in leader when i enter the name of leader and click
    enter i gives the codeno, deptcode and unitid of the leader_name.
    so now i have created another block in tabular structure to bring the members in the same deptcode that belongs to Leader_name.
    So pls tell me the steps how to create the relation between these two blocks.
    when i enter the leader_name and gives enter it needs to bring the codeno, deptcode, unitid and
    I also need to gives the members in that deptcode..
    Thanks In Advance
    Srikkanth.M

    If it is possible to create relationship with one table No.
    Or
    I have created a pre-Query in the detali block and my code is
    set_block_property ('block_name', default_where, 'deptcode = (select deptcode from emplmaster where name like :block_in_which_leader_name.leader_name_field');BTW no need of joining here it can be solve by set the block's where clause as u said in ur earlier post above. Just changing the little bit this statement and then try.
    If numeric
    set_block_property ('block_name', default_where, 'deptcode = '||:block_in_which_leader_name.leader_name_field);
    Otherwire
    set_block_property ('block_name', default_where, 'deptcode = '''||:block_in_which_leader_name.leader_name_field||'''');-Ammad

  • Creating "Control Combo Box " Relation with data block

    Hi all dears
    i am switching from C# to oracle developer for joining gulf net software house, i have a problem regarding master detail data
    the senerio is
    "List items" control Filled programatically as under shortly:-
    rg_id := create_group_from_query('myrg', 'select dname a, dname b from dept');
    populate_group(rg_id);
    populate_list('mylist', rg_id);
    using this i fill my combo box during new form instance trigger
    i have created a datablock emp through wizard which can show 10 record.
    now
    Problem 1
    i want to show records on form when user select any dept from combo box.
    Problem 2
    if i create group from query and in select statement is like this "select dname, dpetno from dept" the record group is created successfully but i am unable to populate_list due to different data type colums in record group how i will populate list so that List items Labels are department name and value is department no
    Thanks in advance for persual

    Hi dears all
    I have solved this problem my self
    1. select dept name form combo box and the data block shows the emp's of concern depat
    solution
    create a data block of emp table through wizard
    create its table view and show 10 records
    go to datablock i consider its name "emp" datablock properties
    in Where clause condition specify deptno = : my_combo_box;
    now go to combo box when item changed event
    go_bolck("emp);
    execute_query;

  • Creating a Relation between two Blocks - the Join Condition [SOLVED]

    Hi. I'm trying to create a Relation between my TTMS_Audit table and my Bundle_Exceptions table. This is the join condition:
    ttms_audit.primary_key_values = bundle_exceptions.project_cd||','||bundle_exceptions.bundle||','||bundle_exceptions.exception_cd
    And I get the following error:
    FRM-15004: Error while parsing join condition
    Does anyone know if my concatenated values in the Join Condition are allowed? Can I even do this? Is there a logical work around?

    Got it.
    I first created the concatenated values as a non-base table item on my form:
    :NBT_PRIMARY_KEY_VALUES := :bundle_exceptions.project_cd||','||:bundle_exceptions.bundle||','||:bundle_exceptions.exception_cd;
    Then my join condition simply became:
    ttms_audit.primary_key_values = bundle_exceptions.nbt_primary_key_values

  • Relations between data size and bandwidth

    Hi all,
    We have a engagement with our application in MI25 SP18, (like all app´s, I suppose). About the best relation of amount data transmited and the bandwidth to use.
    Every body knows that the most faster bandwith is the better, but is interesting know this relations.
    I would like to thank for this exceptional forum.
    Thanx to all.
    SCZ
    Message was edited by: Satur Checa

    If you are saying your records fetched by cursor fetch are then to be processed such that there are multiple records to go to BW for each fetched ones, that is doable.
    Fetch your records into a local internal table instead, do the processing and pass the resultant records to the tab that goes back to BW. You only need to make an adjustment to package_size that you specify to the cursor fetch statement. Instead of i_maxsize, pass a value which is divided by the multiplication factor (eg if you create 5 records out of 1 fetched rec, pass the size as a value = i_maxsize/5). If this is not fixed, give an approx so your final no of records are roughly close to the i_maxsize.

  • Relation between two View

    Hello,
    I have many blocks that based on some views. first every thing is ok when i insert record on them, but when i do an execute query i'm able to navigate between blocks in on way like (next, next) but when do previous i missed the sync between the blocks. So i decided to make some relations between these blocks. i have a main block that i take for my master and i constructed the relations master-details between my main block and others.
    now when i run form i received that error ''FRM-30415 the details block of the relation is a control block'', and it give me the relation's name. I have to mention that the QUERY_DATA_SOURCE_NAME is from clause for every blocks.
    as i said the blocks are based on views.
    could someone help me?

    Is the "Database Data Block" property of the detail block "Yes"?

  • 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.

  • How to pass set 'Relation' between blocks dynamically..Pls help

    Dear all,
    Best wishes,
    Please help me to find solution for this..
    I have two forms A and B. Form A will pass 4 parameter to form B so that B will fetch the details. till this everry thing is fine..
    Form A -- > Uses Table A --> col1,col2,col3,col4
    Form b ----> Uses Table B ---> col1,col2,col3
    table a col1 = table b col1
    a col2 = b col2
    a col3 = b col3
    a col4(already exist) = b.col4(newly added) (no data exist for col4 table B for current records but will have future records)
    Form A passes all these 4 col as parameter to form B.
    But actual problem is for all new records (will have all the relation records i.e. Table A col1,col2,col3,col4= Table B col1,col2,col3,col4) so existing relation works fine Form B while fetching the data ( I manully edited relation between these two tables by adding Table A.col4=TableB.col4)
    How ever this relation is giving problems for EXISTING RECORDS in Table B which does not which is not having corresponding equal value to Col4 in Table A.
    so now scenario is if i remove that addition I made , THEN IT ONLY WORKS FOR EXISTING RECORDS
    and
    if i keep update relation between block (updated one including col4) then IT ONLY WORKS FOR NEW RECORDS since col4 parameter passes as null to form B then since no records in Form B.
    what my idea is to pass 'relation' dynamically creating relation for old and new records.
    like "telling form B to check -- if Table B.col4 is null where TableA.col1 = TableB.col then -- opt for relation which DOES NOT INCLUDE a.col4=b.col4 in relation statement
    or
    if Table B.col4 is notnull (Table having correspoiding records) where TableA.col1 = TableB.col then -- opt for relation which INCLUDE a.col4=b.col4 in relation statement
    Sorry for long post..hope i am clear on my requirements..
    Any suggestions are welcome...
    thanks in advance
    Prasanth

    Prasanth,
    Were I in your situation, I would push back on the author of the requirement and inform them that the data in Table 1 must be updated to conform with new requirement. This eliminates any DDL change to the tables and it is not unreasable to require a DML change to the data to support a "New" requirement. If the author of the requirement still will not see reason and wants you to make it work as is, then it could be made to work as is, but it will require a complete redesign of the Form and a complete regression test of the form to ensure the new Form process doesn't break functionality or have unexpected side-affects. Provide development time and cost estimates so the "author" can determine the cost effectiveness of the options.
    As to the options, you could make this work using a From Clause Query based block or a Procedure based block. Both options will allow you to use NVL or DECODE, but will require you to handle any Forms DML manually using the On-Ins, On-Upd and On-Del triggers. Both options will also allow you to use the Relationship feature of data blocks.
    If you have access to My Oracle Support, take a look at the following documents:
    <ul>
    <li>How to use Fro m Clause Query in Forms [ID: 69884.1]
    <li>Basing a Block on a Stored Procedure - Sample Code [ID: 66887.1]
    <li>Master/Detail Relationship Based on Stored Procedures [ID: 124650.1]
    </ul>
    If you don't have My Oracle Support access, take a look at this URL for some examples:
    Oracle Forms 10g release 2 : Demos, Tips and Techniques and scroll to 2.3.2 Block based on stored procedures.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Aligning data blocks relative to disk sectors

    Hi
    I Have a huge 20GB file that stores a lot of small data structures typically between 200 bytes and 20 kb. There are many millions of these small data blocks that are all stored together in a single file. I can read each data structure from a file channel by specifying the offset of the data structure in the file.
    I need to read thousands of these small data structures every second. To help with this I'm using a solid state disk as the reads will be mostly random. However I can improve performance by aligning my data structures with respect to the disk sectors. The disk sector size is 4096 bytes. If I don't align them then I end up with the smaller data structures straddling two sectors in most cases. This means that performing a read on a 3KB data structure that straddles two sectors will incur a read of 8KB instead of 4KB which will hurt read performance.
    What I cant figure out is how to tell where the sectors begin and end. The file channel API only gives offsets relative to the file not relative to the disk. My intuition tells me that if I knew exactly what the offset of the start of the file was relative to the disk I could work out where each sector is relative to my file and write the data structures to the disk taking this information into account, but I don't know how to do this.
    I know many databases do this with their internal pages but I haven't seen anyone do it in Java so far.
    Anybody else tried to do this I Java?
    Edited by: fireandspike on May 22, 2010 3:53 PM

    Colby_ wrote:
    dannyyates wrote:
    Fragmentation has very little performance impact on SSDsAbout as much as worrying about reading from just one sector ;pOn the contrary. If I want to read (or write) one sector's worth of data and I don't do it at the sector boundary, the disk is going to have to perform two I/O ops, potentially with a seek in between. The seek is (almost) meaningless in the SSD example - and hence fragmentation in general is meaningless - but it certainly isn't meaningless on an HDD. However, having to read two sectors is NOT meaningless in either case. You have just immediately halved your potential throughput.
    We do a very similar thing on a project I'm working on at the moment. We need maximum write performance to disk to journal changes to the system and we get much, much better performance by making sure that we write in a way which is sympathetic to the underlying hardware - specifically, buffering 4k of data and then writing exactly 4k (including trailing zeros if the last thing won't fit in the 4k buffer) to the disk in a single hit. In this way, we minimise JNI transitions (which are horribly slow and introduce huge latency spikes) and we give the disk the maximum chance of keeping up with us because it never has to re-read and update a sector to add data to it and can practically stream the data straight to the platter.

  • Relation between employee data and SAP user ID

    Hi experts,
    I am searching a relation between a SAP User Id and the personal data of an employee like Infotype 2.
    Is there any relation like this?
    Thanks!

    Hi,
    The SAP User ID is attached to employee number using communications infotype IT 0105 subtype 0001.
    Also e-mail, fax, telephone number are stored in this infotype under different subtypes.
    hope this helps
    Ajay

  • How to get data from three tables (A,B,C) having one to many relation between A and B .and having one to many reation between b and c

    i have  three tables A,B,C.  there is one to many relation between A and B. and one to many relation existed between table b and c . how will get data from these three tables

    check if this helps:
    select * --you can always frame your column set
    from tableA a
    left join tableB b on a.aid=b.aid
    left join tableC c on c.bid=b.bid
    This is just a general query. However, we can help you a lot more, if you can post the DDL + sample data and required output.
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

Maybe you are looking for

  • Stock Posting Error

    Hi! Gurus, I am facing problem while Posting the Stock in Stock (T.Code-MB1C), "Maintain conversion factors for EUR/INR (currency type M). Plz help me. Thanks in Advance, Raju.

  • PSE 8 dialogue/value windows appear BLACK by default.

    Hi, I'm a forum newbie, runningPSE 8 on an iMac.  Is there a way to change the default dialogue / value windows to white or transparent, please?   I'm also seeking a plug in to enable Channel manipulation in PSE.  Many degraded graphics arise from pr

  • Can I set up an original ATV without an Apple remote?

    My son got a 2nd gen Apple TV and gave me his old one - it is possible for me to set it up without the Apple remote - I have a wired and wireless network - iMac - iPhone & iPad with the Remore application - is there any way to set it up? Or do have t

  • Rectangle box in designer lovs and in deski report where there is apostroph

    HI , I have came across two issues with same scenario. Customer is using Sybase Adaptive server 12.5 when he is seeing rectangle box in designer lovs and in deski report where there is apostrophie. The apostrophie is of different kind, the normal one

  • Overloading with Generics

    If this is ok (compiles fine): void f(A a) {} void f(B b) {} shouldn't this also be ok? (compilation error) void f(Collection<A> ca) {} void f(Collection<B> cb) {} Is there some fundemental reason why this is disallowed or is this a missing feature?