Data block field

Hello,
i've created a data block on a table, using the wizard. that table contains some foreign keys, let's say (class_id). i wanna, on the form, not to show the id, i wanna show the name of the id corresponding to that id
so i have the tables:
A
name
surname
class_id references B(id)
B
id
denumire varchar2(30)
so when i create the data block on the table A, on class_id it's showing the id. i wanna show the "denumire" field, but i don't know hot
Regards,

Two possibilities:
1.
Create an additional textitem in your datablock, name it, lets say DSP_DENUMIRE set length and datatype according to the column in your table b, and (most important) set "database Item" to "No"
Now, create a POST-QUERY-trigger on your block to fill that field:
DECLARE
  CURSOR crLookup IS
    SELECT DENUMIRE
      FROM B
     WHERE ID=:BLOCK.CLASS_ID;
BEGIN
  OPEN crLookup;
  FETCh crLookup INTO :BLOCK.DSP_DENUMIRE;
  CLOSE crLookup;
END;2. Create a view in the database which does the join and then base your block on the view.
Edited by: Andreas Weiden on 16.03.2009 19:14

Similar Messages

  • I can not put the data of a field(LONG RAW) consulted into a item of a data block

    I want to query a field that is LONG RAW(it's a image) and put the data into a item of a data block (in Forms Builder), when i write ":BLOCK.FOTO:=vfoto" i recieve this errors: "bad bind variable ....". How can i put the data of field of my DB and put the data in a item of a data block(in Forms Builder)?.
    I can store a image in a table of my DB, but i want to query a image stored in my DB and put it into anothers table, all this on FORMS BUILDER.

    You have to base the image item on a base table and use EXECUTE_QUERY on that block. You can't do a direct select in PL/SQL into the item

  • Does adding a field to a table affect a data block based on the table?

    If I make a change to a table like adding a field does it affect data data blocks based on the table?

    The other place I have seen where adding a new column to a table causes problems is when a programmer codes: Select * from table.
    If that is coded in a form, the form will need to be recompiled before it will work properly.

  • Insert and update a data block which is based on view--urgent help required

    Hi experts,
    I created a view(A_VIEW) which is based on a union select. I have created a data block A_VIW_BLOCK which is based on this view. I need to insert/update one of the base tablesfor A_VIEW through this data block. I also need to be able to make a query through all the fields in the view.
    The questions are:
    1.Can it be done at all?
    2. What properties need to be set?
    3. If can't be done, what the best approach to achieve this?
    Thanks in advance!!
    Michael

    hi
    try something like this.
    CREATE TABLE demo_tab (
    person_id NUMBER(3),
    first_name VARCHAR2(20),
    last_name VARCHAR2(20));
    CREATE OR REPLACE VIEW upd_view AS
    SELECT * FROM demo_tab;
    INSERT INTO demo_tab
    (person_id, first_name, last_name)
    VALUES
    (1, 'Daniel', 'Morgan');
    INSERT INTO demo_tab
    (person_id, first_name, last_name)
    VALUES
    (2, 'Helen', 'Lofstrom');
    COMMIT;
    SELECT * FROM upd_view;
    UPDATE upd_view
    SET person_id = person_id * 10;
    SELECT * FROM upd_view;
    desc user_updatable_columns
    SELECT table_name, column_name, updatable, insertable, deletable
    FROM user_updatable_columns
    WHERE table_name IN (
       SELECT view_name
       FROM user_views);
    SQL> create table dummy (f1 number);
    Table created.
    SQL> create view dummy_v 
    2  as 
    3  select f1 from dummy 
    4  union all  
    5  select f1 from dummy;
    View created.
    SQL> create trigger dummy_v_it 
    2  instead of insert 
    3  on dummy_v 
    4  for each row 
    5  begin 
    6    insert into dummy values (:NEW.f1); 
    7  end; 
    8  /
    Trigger created.
    SQL> insert into dummy_v values (1);
    1 row created.
    SQL> select * from dummy_v;       
    F1
    1        
    1
    SQL> select *
      2  from user_updatable_columns
      3  where table_name = 'DUMMY_V';
    OWNER    TABLE_NAME   COLUMN_NAME  UPD INS DEL
    FORBESC  DUMMY_V      F1            NO  NO  NOforms settings.
    Enforce Primary Key - No
    Query Allowed - Yes
    Query datasource Name - V_TSFDETAIL
    Insert Allowed - Yes
    Update Allowed - Yes
    Delete Allowed - Yes
    Locking Mode - Automatic
    Key Mode - Automatic
    do not forget to create synonyms.
    hope this helps.
    sarah

  • AP invoice interface - payment block field question

    Hi,
    Peoplesoft is our main system for finance. We are using SAP for logistics applications. I am building a interface to send AP invoice details from SAP to peoplesoft on a daily basis. This interface needs to pick up only those invoice that are free for payment i.e. bseg-zlspr (payment block) field is blank. For example, if an invoice is in invoice verification process, it should not be sent. Till this point, it is easy to get the details of these invoices.
    Once the invoice verification is done, bseg-zlspr field will become blank and needs to be picked up by interface. But the issue is how to select these invoices. Since the interface will run daily, I can select for invoices that are created on that day or changed on that day. But the issue, when the value of bseg-zlspr field is changed from blocked to free for payment, none of the date field value changes on either bkpf or bseg tables.
    Any ideas how to handle this???

    hi,
    use change document analysis like tcode FB04
    -> try fm CHANGEDOCUMENT_READ_HEADERS
    A.
    Message was edited by:
            Andreas Mann

  • Dunning Block field in Invoice Header

    Hello,
    There is this Dunning Block field in the invoice header tab > Accounting Data sub tab.
    Please let me know how this field value is controlled.  i.e. it gets determined or it flows from some master data?
    Any info on this dunning block field is welcome.
    Thanks,
    Shankar

    Dear Shankar
    If you implement Dunning procedure, this field will be controlled based on the value you maintain in Payer customer master Company Code Data - under Correspondence tab
    thanks
    G. Lakshmipathi

  • Multiple data blocks on the same canvas

    Forms newbie question:
    Is it possible to have 2 data blocks with two different sets of transactional triggers (ON-UPDATE, ON-LOCK, etc.) on the same canvas?
    I've got an example where i've got two data blocks (one sourced from a view, and one that is a CTL block) on the same canvas. The block sourced from the view is working fine. When I make updates, they are reflected, etc. But, i've got one field in the control block that I need to update from as well, and I can't seem to get it (or any of the CTL block items) to show up as "updateable", regardless of the set_item_property....theyre always grayed out.
    Do i need to take the user to a new canvas to be able to utilize the update of the ctl field?

    A second canvas is not needed. Normally, control-block items are always updateable, so there is something going on in your form to prevent it.
    > I can't seem to get it (or any of the CTL block items) to show up as "updateable",
    regardless of the set_item_property....theyre always grayed out.
    What... Is there code someplace in the form that sets them to Enabled, false? If that is the case, then to get them working again, besides setting Enabled to true, you also must set Updateable and Navigable to Property_True. (This is documented at the end of the on-line help on Set_Item_Property.)

  • Updating record in a data block based on view in oracle forms

    hi all ,
    We have two data blocks in our custom oracle form.The first data block is for search criteria provided with buttons 'GO' and 'ADD ROW' and the second data block is based on a view that fetches record when user clicks on GO based on the the criteria specified in the above block. The Below block contains one SAVE button too.
    We have a requirement when GO button is pressed and corresponding records are shown in the below block, user should be able to edit the record. Want to know how to make it editable?
    Help appreciated....!!!

    Your view is based on how many tables and does it include all NOT NULL fields from all tables?

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

  • What is the meaning of data blocks ?

    hi,
    What is the exact meaning of "data blocks" in the following paragraph ?
    Index records and table records are organized in data blocks.
    If you dispatch an SQL statement from an ABAP program to the database, the program searches for the data records requested either in the database table itself (full table scan) or by using an index (index unique scan or index range scan). If all fields requested are found in the index using an index scan, the table records do not need to be accessed.
    A data block shows the level of detail in which data is written to the hard disk or read from the hard disk. Data blocks may contain multiple data records, but a single data record may be spread across several data blocks.
    thanks
    bhakti

    Hi  ,
    As Per oracle , data  is stored in database  in form of Data blocks , extent and Segments .
    Physical space of memory is allocated to store data  .
    first level is called  BLOCKS  ,nexxt is extent   and last  is SEGMENT  .
    each block can store multiple data records  and   Conversly large no of  data records can be stored  in data Blocks  .
    data is stored in DATA BLOCKS which is smallest unit in oracle where data is stored in bytes  .
    regards
    Deepak.

  • Problem In Update Statement In Multiple Record Data Block

    Hi Friends,
    I have problem in update Statement for updating the record in multiple record data Block.
    I have two data Block the master block is single Record block and the 2nd data block is Multiple Record data Block.
    I am inserting the fields like category,and post_no for partiular job in single data block
    Now in second Multiple Record Data Block,i am inserting the multiple record for above fileds like no. of employees work in the position
    There is no problem in INSERT Statement as it is inerting all record But whenever i want to update particular Record (in Multiple Block) of employee for that category and Post_no
    then its updating all the record.
    my code is Bellow,
    IF v_count <> 0 THEN
    LOOP
    IF :SYSTEM.last_record <> 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
    VALUES(g_post_no, g_roster_no, g_category, :POST_HISTORY_MULTIPLE.idcode, :POST_HISTORY_MULTIPLE.joining_post_dt,
    :POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    next_record;
    ELSIF :SYSTEM.last_record = 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
         VALUES (g_post_no,g_roster_no,g_category,:POST_HISTORY_MULTIPLE.idcode,
              :POST_HISTORY_MULTIPLE.joining_post_dt,:POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    EXIT;
    END IF;
    END LOOP;
    SET_ALERT_PROPERTY('user_alert',ALERT_MESSAGE_TEXT, 'Record Updated successfuly' );
    v_button_no := SHOW_ALERT('user_alert');
    FORMS_DDL('COMMIT');
    CLEAR_FORM(no_validate);
    Please Guide me
    Thanks in advence

    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;These update statements are without where clause, so it will update all records.
    If it is specific to oracle forms then u may get better help at Forms section.

  • Hi!!!Can anyone suggest how to change data block dynamically using input

    Hi all,
    Here is my requirement...I have a datablock which has 7 columns, these coloumn represent dates. I have a header in which I will input the date[b] from and to ( this is restricted to not more than one month). Now when I enter these 2 date fields in header, My 7 coloumn data block need to be changed to 'n' number of coloumn( which is less than 1 month) as per input fields. Can I do this, if we can then please give me the guide lines.
    Thank you

    it is a good solution Jeneesh, because it is the only one.
    You cannot create items dynamically at runtime, so you have to create them in your form at designtime and show and hide them.

  • Placing Summary column in master data block

    I have a master/detail datablock form. i want to show the sum of "amount" field that is present in detail datablock and this summar field must be placed in master data block but it does not compile the form and shows following error.
    FRM-30377: Summary item must reside in single-record block or in same block as summarized item.
    Item: S
    Block: PBL_PAYMENT_MASTER
    FRM-30085: Unable to adjust form for output.
    it works only by putting it in the same detail block with "Query All Records" to YES.
    But I want to place this summary column in master data block but then it is not working.
    How we can solve this problem.

    Hi,
    In this case:
    -- i put my summary column in the master data block with :Query_All_RECORDS set to yes
    --but Physically it is placed on detailed block on the canvas
    and it Works with this trick.
    Regards,
    Abdetu.

  • Data block wizard breaks master-detail

    I've encountered the following situation, and I'm wondering if it's a known bug or if I'm doing something wrong:
    1. Open the data block wizard on an existing block that is the "detail" block of a master-detail relationship.
    2. Add one new field to the block. No other changes are made.
    3. When the form is recompiled and run, the master-detail relationship is broken. The detail block contains all the rows in the detail table. Clicking on the rows of the master block does not change the detail.
    Adding a field to the block manually does not cause a problem. The relation is not impacted, and we see no property settings that are wrong. We tried downloading and installing all of the latest patches for forms 6i, and the problem occurs with that release as well. Any ideas?

    I think you do something wrong because I add many fields many times and it works fine.
    Thanks
    Abubakr
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Swartzlander:
    I've encountered the following situation, and I'm wondering if it's a known bug or if I'm doing something wrong:
    1. Open the data block wizard on an existing block that is the "detail" block of a master-detail relationship.
    2. Add one new field to the block. No other changes are made.
    3. When the form is recompiled and run, the master-detail relationship is broken. The detail block contains all the rows in the detail table. Clicking on the rows of the master block does not change the detail.
    Adding a field to the block manually does not cause a problem. The relation is not impacted, and we see no property settings that are wrong. We tried downloading and installing all of the latest patches for forms 6i, and the problem occurs with that release as well. Any ideas?<HR></BLOCKQUOTE>
    null

  • 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

  • Can not open database after restore...

    Hi, I am doing a system copy from a online backup of our production system to our qas system. It is AIX and Oracle 10.2.0.2.0 on both systems. I have done the restore using the backup log file from the production system. I have run the control.sql sc

  • Digitizer?

    I have a powerbook and I wish to connect it with my video camera that is a super8 camera. It does not have the luxury of firewire so I heard I need something like a Digitizer that will take composite or S-video outputs from the camera and output to t

  • BAPI's for VL01NO, VL02NO, VL03NO

    Hi all, Can any one tell me the bapi's used for transaction VL01NO except BAPI_OUTB_DELIVERY_CREATENOREF , we are using lower version the above bapi is not there in my system . can any one please tell me some bapi's VL02NO, VL03NO also ? Regards, Pra

  • How to test if particular character is empty in a row

    Hi All , Requirement : To split the input file into two files . If the length of the row is 93 characters and the condition is If characters from 28 to 32 are empty then create a file with the name PCO1 .txt else create a file with the name PCO2 .txt

  • Zen Stone Plus S... SLOW-FF speeds...ANYO

    I owned a Creative Labs Zen Nano Plus, before my dog used it as a chew toy. I then purchased a Creative Labs Zen Stone Plus S (2GB with speaker), which I love. I clip it in my hardhat at work and listen with the speaker. My old Nano would FF through