POST-QUERY trigger cannot retrieve the database field in TEMPLATE.fmb

I have tried to create a form using TEMPLATE.fmb in Oracle Apps R11i. I found that the POST-QUERY trigger cannot retrieve the database field (which is display item property) properly. Can anyone tell me how to retrieve the displayed database fields? Thanks for any helps.

POST-QUERY would fire after the query has been executed, it does not do the actual data retrieve.
See if the items you have put have the data source properties set and are not control items.
btw, this forum is for OA users, you would get better response to your query if you post it in forms forum
Thanks,
Tapash

Similar Messages

  • Populate Form Field from Post-Query Trigger

    I have a form with some fields like "start_date", "company_id", "previous_start_date", "previous_company_id". Out of these, the "previous" fields are unbound and the others are bound to "my_companies" table. All are in the same block on the form. I have a post-query trigger which runs a cursor to select "previous" values based on the "start_date" and "company_id". More than one "previous" values is retrieved each time. My problem is that my cursor writes back only one value into my form field. I ran the cursor as a pl/sql block in TOAD to test and it fetches all the records that I need. I'm not sure what I'm doing wrong in writing the values into form items. The form items are of type "custom" and display type is "text" (I'm creating the form in Oracle Designer). My cursor code is something like this:
    declare
    cursor previous_data_cur is 
            select company_id,start_date
               from my_companies
               where company_id = :myblock.company_id
               and start_date < :myblock.start_date;       
    BEGIN 
        open previous_data_cur;
        LOOP
        fetch previous_data_cur into :myblock.prev_company_id, :myblock.prev_start_date;
        EXIT WHEN previous_data_cur%NOTFOUND;
        END LOOP;
        close previous_data_cur; 
    END; Can anyone provide any pointers on what I could be doing wrong or what I should do to make this work?
    Any help is greatly appreciated.

    Do you have several previous date fields per record?
    How are they named? Previous_date_1, previous_date_2,...?
    Try this:
    declare
    cursor previous_data_cur is 
            select start_date
               from my_companies
               where company_id = :myblock.company_id
               and start_date < :myblock.start_date;
       l_previous_data previous_data_cur%ROWTYPE;       
       l_count NUMBER;
    BEGIN 
       l_count := 1
       FOR l_previous_data IN previous_data_cur
       LOOP
           copy(l_previous_data.start_date, 'my_block.previous_start_date_'|| l_count);
        END LOOP;
    END; Caution:
    - number of retrieved records may not exceed number of previous_date fields.
    - not tested

  • Query - Cannot Retrieve the Data / Result Set

    Hello,
    I'm trying to query a cube through the OLAP connection using Java and every time I try to execute a query an exception is thrown stating "Cannot retrieve the data set" or "Cannot retrieve the result set" depending on how I'm doing the query.  I've tried to execute the query both through the use of an IBIQuery and IBICommandProcessor object as well as directly through the IBIOlap connection via an MDX statement and both methods produce the same exception.  If anyone can shed some light on why exception is being thrown it would be greatly appreciated.

    please help me ... The question has nothing to do with 'getting' data from excel and certainly not with putting it into MySQL.
    The stack trace specifically tells you that your connection string is wrong.
    It also tells you which connection string is wrong.
    Which you can use to determine specifically which one is wrong. And which you did not provide that info to us.

  • CRS Editor - Retrieving Timestamp database field from SQL 2005

    Hello -
    For the life of me, I cannot retrieve a database timestamp field from SQL 2005.
    I have successfully used 'cast(Date as char(30)) as DateStr' to convert to string but the DBRead statement displays the original object only as java.lang.Timestamp.  Any posts regarding this topic usually require Java skill sets above my level (creating new java class for import,...).
    There has to be an easy way to do this without being a Java programmer, yes?
    Any help here would greatly be appreciated!
    Thanks
    Andy Backus
    941.587.7199

    Andy,
    I'm guessing you know that this isn't really a date/time value in MS SQL.  According to Microsoft: 
    The Transact-SQL timestamp data type is not the same as the timestamp data type defined in the SQL-92 standard. The SQL-92 timestamp data type is equivalent to the Transact-SQL datetime data type.
    But to your question how to get the timestamp value out in a string...You'll want to use the convert function:
    select convert(varchar(10),myTimestampField) from myTable
    That will return the hex value in the column in a string format.  Also, when you retrieve the data, are you looking at the original table (which specifies the column is a timestamp), or did you create a dummy table with the columns named and formatted the way the data will be returned that UCCX can look at for the schema?  If it doesn't have the correct schema to look at, you'll have problems.
    Cliff
    please rate helpful posts

  • Post-query trigger order for data blocks in master detail relationship

    Using Forms [32 Bit] Version 10.1.2.2.0 (Production) Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production.
    I have the following problem with a form I am working on. It has a master data block with multiple detail data blocks. I am trying to create a post-query trigger on one of these detail blocks that will do a select using the value of a field from another of the detail blocks.
    The problem is that the post-query trigger of the data block I am trying to do the select with is firing before the post-query trigger of the block I need the value from is firing. I tested by just putting in a display message and having it return the value of the id I am tryign to use. Right after I do a query on the form, I get the messages saying:
    "Error: cannot find price for id:" and there is no id, and then the message from the other datablocks post-query saying, "id is: 123"
    Is there a way to change the order that the datablocks are queried? Or should I be using a different trigger to do this?

    Do you mean as it is displayed in the object navigator? It's not the first block under the data block section, but it is above the other block that is exceuting before it, so I assumed the order in that did not matter.
    EDIT: Thanks Magoo! That solved the issue.
    Edited by: a small rabbit on Sep 4, 2009 11:28 AM

  • Post-Query Trigger Implementation in ADF

    Hi,
    I am working on a migration project.I need the equivalent functionality of POST-QUERY trigger of Oracle Forms,so i overrided the createInstanceFromResultSet(QueryCollection qc,ResultSet rs).can anybody suggest after getting some data from this method how to populate it in the client side field.?
    Thanks In advance

    All you've done is tell us how you implemented a particular use case in Forms - you haven't told us what is the use case... Describe to us what you are trying to accomplish, not how you did it in forms or how you've tried to do it in JDev.
    For example, "when the user retrieves the sales order, the shipping address should be retrieved and displayed on the screen" - something like that.
    John

  • Master-Detail Form - implementing some thing like Post-Query trigger

    Hi all,
    I am struggling to implement an eqivalent of a post-query trigger in Oracle Forms. Please bear with me as I am trying to explain in detail what the problem is.
    Here is my situation.
    I have three tables EMP, DEPT and LOCATION. I created a Master/Table pages on EMP and DEPT.
    Basic relationships.
    Each LOCATION has one or more DEPTs; Each DEPT is at one and only one LOCATION.
    Each DEPT has one ore more EMPs; Each EMP is assigned to only and only DEPT.
    Not getting too complicated, here are the table layouts:
    LOCATION:
    ID number(10,0) not null,
    NAME varchar2(20) not null
    DEPT
    ID number(10,0) not null,
    NAME varchar2(20) not null,
    LOC_ID number (10,0) not null foreign key from LOCATION
    EMP
    ID number(10,0) not null,
    NAME varchar2(20) not null,
    DEPT_ID number (10,0) not null foreign key from DEPT
    Assume I have all the constraints, BIU triggers, sequences defined properly.
    I am using the APEX page wizard to create a Master/Detail Form on DEPT and EMP. The first page is the Master Report on DEPT. I want to display the Location Name on this page also. Because the Master Report allows
    you to change the query, I was able to add the Location Name as part of the
    query. This was very simple.
    Select a.name "Department_Name",
    b.name "Location"
    from dept a, location b
    where a.loc_id = b.id
    Moving on, In the Master Detail Form, I would like to get the Location Name as part of the first Region (Dept Region).
    In this region, I would like to include the Location Name also. So my first region on the Master Detail form includes:
    Dept Id: ________
    Dept Name: _______
    Location Name: __________
    As Region are automatically populated using using a Fetch Row from EMP table (Automated Row Fetch) on an After Header process point, I don't have a way of including the Location as part of query. So I created a Region level Item called Location Name, made it Display only.
    In the old SQL*Forms, or Oracle Forms days, I used to use a Post-Query trigger, or Post-Change trigger to fire on the Loc_Id column to populate the Location Name. Simple fetch like:
    Select name
    into :P80_location_name
    from location
    where loc_id = :P80_loc_id
    However, I am struggling to implement some thing simple like this in APEX. Tried creating a processes, computatations etc, but nothing is working.
    I have seen some previous responses to fetching values from a foreign table
    using a button or AJAX script, but this should be very basic. What am I
    missing here?
    Appreciate any insights.
    Thanks.
    John

    Hi John,
    I'm not too familiar with the post-query triggers in Oracle Forms, but the use of a List of Values (LOV) on your LOCATION table might do the trick for you. If you create a dynamic LOV based on your LOCATIONS table, it can then be referenced by the LOC_ID item on the Master-Detail page, to display the Location Name. You could try doing the following:
    1. Create a new dynamic LOV, LOCATIONS, using a query similar to the following:
    select Name d, ID r
    from LOCATION
    order by 1
    2. Edit the "Create" button on the Master report page, and in the "Optional URL Redirect" section set "Request" to CREATE. Click Apply Changes, to save the setting.
    3. Edit the LOC_ID item on your Master-Detail page, and set the following:
    * in the "Name" region change the "Display As" setting to Select List
    * in the "Label" region change the Label to Location Name.
    * in the "List of Values" region set the "Named LOV" to LOCATIONS
    * in the "Read Only" section, set the condition to Request != Expression 1, and set Expression 1 to CREATE.
    Click Apply Changes to save the settings.
    When you run the pages now, the Location Name field will appear as Read-Only when editing a selected Master row. The item will appear as a Select List when the user clicks "Create" on the Master page, to create a new Master row.
    I hope this helps.
    Regards,
    Hilary

  • Problem with post query trigger

    Hi,
    I have a multi record block and there is a post-query trigger on it. Based on values of this block I populate other values over the other control block.
    I wrote code in post-query trigger and when I execute the query and go to last but one record. The values in the control block are from last record instead of last but one record. Pls help me to fix
    Thanks,

    if you want to see the data in the control block synchronized with the database block then use the WHEN-NEW-RECORD-INSTANCE and not the POST-QUERY.
    with the POQ you add additional data (in non-basetable-items) to the records in the database block

  • FRM 40735 Post Query trigger raised unhandled exception TOO_MANY_ROWS

    I'm using Developer 2000 Forms 4.5 and after a query on the form; an error message is on the screen "FRM 40735 Post Query trigger raised unhandled exception TOO_MANY_ROWS". And form can't be closed.
    How can I solve this problem?

    You must have a POST-QUERY trigger defined somewhere in your form.
    In this trigger you probably do a "select into" that retrieves more than one row.
    That explains the "too many rows" error.
    When you do a query in the form, the POST-QUERY trigger fires for each row retrieved.
    So if you do a query on a underlying table that has 100 rows, the POST-QUERY trigger fires 100 times. After 100 alerts, so to speak, you'll be able to close your form.
    Solution off course is to correct the POST-QUERY trigger by making sure you only retrieve one row with the select into, or define a too_many_rows exception in that trigger.
    Good luck.

  • To read all the database fields used in a Crystal report 10 file using Vb 6 Code

    Hi
    Iam in development of an Application in Visual basic which lists all the
    database fields used in a particular report (crystal 10)
    In simple i need to show all the checked fields in the database fields section in field explorer section of the crystal report file.
    regards
    venkateshG

    Please re-post if this is still an issue to the Legacy Application Development SDKs Forum or purchase a case and have a dedicated support engineer work with you directly

  • LEFT OUTER JOIN, Problem in POST-QUERY TRIGGER

    Hi,
    Please guide for the following
    I wrote below query in POST-QUERY Trigger of a TABULAR DATA BLOCK, having only one text item, called INVENTORY_ITEM
    select c.cat||' '||s.subcat||' '||l1.lvl1 ITEM INTO :DATABLOCK.INVENTORY_ITEM
    from itemcat c
    LEFT OUTER JOIN itemsubcat s on (c.catid = s.catid)
    LEFT OUTER JOIN lvl1 l1 on (s.subcatid = l1.subcatid)
    When I compile the module an error is generated
    *" Encountered the symbol 'LEFT' when expecting one of the following ,; for group having intersect minus order start union where connect ".*
    Above query is working fine in ORACLE SQL DEVELOPER .
    Any solution please.
    Regards,

    Difference

  • POST-QUERY TRIGGER

    Hello.
    I'm a newbie here.
    I'm currently studying Oracle Form Builder and I'm a student.
    I've encountered this problem where I need to create a post-query trigger in a data block that counts a total number of rows in a particular item using a display item.
    I'm know I need to use the INTO clause to populate the display item but I got stuck.
    Please help.
    Thank you very much..

    First of all your code to calculate the total rows returned from a query is wrong.
    Try this one in a Post-Query Trigger
    DECLARE
    total_rows_returned NUMBER;
    BEGIN
    SELECT COUNT(*)
    INTO total_rows_returned
    FROM table_name;
    :block_name.display_item := total_rows_returned;
    END;
    Good Luck
    Saadat Ahmad
    Oracle Developer

  • Is there an Oracle Forms Post-Query trigger equivalent

    Hi.
    Jdeveloper 11.1.1.2
    Is there a way in ADF to populate extra read-only text-columns in an af:table (based on a ViewObject) as was possible in Oracle Forms with a Post-Query-Trigger:
    Post-Query
    Perform an action after fetching a record, such as looking up values in other tables based on a value in the current record.
    Fires once for each record fetched into the block.
    Best regards
    Erik

    Erik wrote:
    Hi.
    Jdeveloper 11.1.1.2
    Is there a way in ADF to populate extra read-only text-columns in an af:table (based on a ViewObject) as was possible in Oracle Forms with a Post-Query-Trigger:
    Post-Query
    Perform an action after fetching a record, such as looking up values in other tables based on a value in the current record.
    Fires once for each record fetched into the block.
    Best regards
    ErikHi,
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/appendix_formstriggers.htm#sm0350

  • Post-query trigger ? save changes?

    I have a similar problem to that posted by 'nova' on Dec. 27, 2000. I have a form generated by Designer. The problem is that upon subsequent querying (F8 pressed twice), it asks me if I want to save my changes, when I have not made any changes.
    I looked in the generated code for the post-query trigger and found SET_RECORD_PROPERTY(:SYSTEM.TRIGGER_RECORD, 'NEW_CUST', STATUS, QUERY_STATUS) which is apparently not the problem, according to this prior post. I am at a loss and have tried everything I could think of.
    What else could be causing this? I checked to see if there were any items being set in the property sheet to default values, and removed the defaults - that did not work.
    ??? I would greatly appreciate any assistance. Thanks.

    Hi Pina,
    my similar problem I have solved like this:
    Post-Record trigger:
    BEGIN
    *** this is important to test the record status - without this I had the same problem
    IF :SYSTEM.Record_Status='INSERT' THEN
    IF :TRANZIT_ZADAJ.ID_SADZBY_TV_PRENOSOV IS NULL THEN
    :TRANZIT_ZADAJ.ID_SADZBY_TV_PRENOSOV:=:SADZBY_ZADAJ.ID;
    END IF;
    END IF;
    END;
    You can check Pre-... and Post-... triggers
    if there are any items being set to any values.
    I hope this will help you.
    Helena

  • Post Query Trigger with cursor

    Good afternoon to all of you!
    I need your help. I create a master detail form. I created also a post quey trigger, inside I wrote the code below.
    A cursor looks to another table and returns to the form some values i need!
    declare cursor C1 is select apofaa,startdate,enddate,transport
    from trapofdet
    where trapofdet.apofcode = :trapof.apofcode;
    begin
    open C1;
    loop
    fetch C1 into :TRAPODOSI_NEW_NEW.APOFAA, :TRAPODOSI_NEW_NEW.STARTDATE, :TRAPODOSI_NEW_NEW.ENDDATE, :TRAPODOSI_NEW_NEW.TRANSPORT;
    exit when C1%notfound;
    next_record;
    end loop;
    close C1;
    first_record;
    null;
    end;
    How to solve the a. frm-40737, illegal restricted procedure go block in post-query trigger
    b. It seems tha returns all the records but it appears only the last one.
    Please can anybody help with these?
    Thanks in advance!
    Christos

    Christos,
    The Post-Query trigger will fire once for each record returned to your form therefore you need to write your query to return a single row rather than a multiple rows. Using the Post-Query trigger to fetch additional data into your form can cause your form to be very slow - depending on the number of records returned and how many columns are fetched by your Post-Query cursor as well as how quickly the query executes.
    Is your Post-Query trigger on your Master or Detail block. Are you using the Post-Query trigger to populate your Detail block? Are you using a Block Relationship to coordinate your Master and Detail blocks?
    Also, it is helpful to know which version of Oracle Forms you're using.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

Maybe you are looking for

  • Address book multiple sources

    Address book i have set up address book to work with dropbox so all the macs in our office can share the same database this removes the need for all those all those syncing applications and for one person to be in charge of the database. Problem is y

  • After upgrading to Snow Leopard - multimedia keys not controling itunes

    After I upgraded to SL all the special keys( Brightness control, Volume control etc.) are working perfectly, excpet for the media controls (rewind, play\pause, forward). They used to control itunes in Leopard, but now I'm lost without them. I tried:

  • Ibm x60s and Win 7 - third mouse button plus nipple will not scroll in FF4

    I have an IBM x60s notebook with Win 7. On previous versions of Firefox I believe I could scroll down a web page successfully using the laptop's centre mouse button and the red nipple mouse. This seemed to have stopped working in Firefox 4 (main rele

  • How can I retrieve deleted Mail inbox mail messages and sent messages?

    I moved location and found (once again) that I could not send messages. In the past I have moved between Apple support and BT support to fix the problem. This time the BT IT technical support guy took over the screen, created a new account, made sure

  • Deleted/Missing Photos?

    I intended to Copy all my 2012 photos from a hard drive to a Passport drive throught Lightroom 4. As the process began I realized they wrere being Moved by mistake so i Canceled the operation by clicking the "X". Now all the 2012 photos are missing f