Help on execute_query

Hi to all,
In a Form I have placed a button. in the trigger WHEN_BUTTON_PRESSED I have a code that:
1) create a WHERE string (LC$Whr) with some filter Items, initialized in the Header block;
2) after use this statement:
Set_Block_Property( 'MYBLOCK', DEFAULT_WHERE, LC$Whr ) ;
Go_Block('MYBLOCK');
Execute_Query ;
It is possible to control if the query return a valid search ?
In other words I need this:
If the Select in the Execute_query has found record(s) then display the Canvas with the Data Block found, else display an Alert message.
I hope yes, but I don't know as.
Thank You and Best Regards.
Gaetano

Or
Query Count Without EXECUTE-ing a Query
FUNCTION query_count (p_block_name VARCHAR2) RETURN NUMBER
IS
  cnt NUMBER;
BEGIN
  GO_BLOCK(p_block_name);
  COUNT_QUERY;
  cnt := GET_BLOCK_PROPERTY(p_block_name, QUERY_HITS);
  IF FORM_SUCCESS THEN
    RETURN (cnt);
  ELSE
    MESSAGE('Error in getting Query Hits for block '||:SYSTEM.CURRENT_BLOCK);
    RAISE FORM_TRIGGER_FAILURE;
  END IF;
END;
WHEN-BUTTON-PRESSED trigger of 'Details' button
DECLARE
   v_cnt NUMBER;
BEGIN
   v_cnt := query_count(<detail block name>);
   IF (v_cnt = 0) THEN
     p_show_alert('No Details exist.');
   ELSE
     GO_BLOCK(<detail block name>);
     EXECUTE_QUERY;
   END IF;
END;Reagrds

Similar Messages

  • HELP - Execute_Query Bug?

    Are there any bugs in D2K which would suddenly cause an
    execute_query command to stop functioning? If so, is there a way
    around the problems?
    null

    daniel jensen (guest) wrote:
    : Are there any bugs in D2K which would suddenly cause an
    : execute_query command to stop functioning? If so, is there a
    way
    : around the problems?
    I've receiver an error
    ORA 01023 - Cursor context not found (Invalid Cursor #). Does
    anyone recognize this? What could be some possible symptoms? Any
    help would be greatly appreciated.
    null

  • Push button query!!!!!!! help needed

    hello all,
    I HAVE USED THIS LOGIC FOR MAKING THE DATA ASCENDING AND
    DESECENDING,AND TRIED ALL THE
    SOLUTIONS THAT WERE SUPPLIED BY MY FRIENDS IN THIS GROUP,BUT COULD NOT
    CHANGE THE
    VISUAL ATTRIBUTE OF THE BUTTON.I AM REPEATING MY QUERY.I WANT TO HAVE
    THE
    PUSH BUTTON TO SIGNIFY VISUALLY THE ASCENDING AND DESCENDING DATA I.E
    WHEN THE
    DATA COMES IN THE ASCENDING WAY,THE PUSH BUTTON
    SHOULD HAVE A "inverted v"ACC CODE"" ALONG WITH NAME "ACC CODE" I.E IT SHOULD
    LOOK LIKE "ACC CODE "ACC CODE inverted v "
    AND WHEN THE DATA COMES IN THE DESCENDING WAY,THE PUSH BUTTON
    SHOULD HAVE A " v".I.E IT SHOULD
    LOOK LIKE "ACC CODE "ACC CODE' v' ".SO PLZ HELP me TO GET THIS .
    Any changes should be made to nls_lang parameter in registry???????????
    PLZ LET ME KNOW WHAT IS FONT THAT I SHOULD USE.U CAN CHANGE THE CODING
    THAT I HAVE WRITTEN
    IN THE "WHEN BUTTON PRESSED" TRIGGER OF ACC_CODE.
    BEGIN
    go_block('age_tran');
    BEGIN
    IF
    get_item_property('PB_ACC_ORDER',LABEL)='&Acc Code' THEN
    set_block_property('age_tran',order_by,'acc_code ASC');
    execute_query(no_validate);
    SET_ITEM_PROPERTY('PB_ACC_ORDER',LABEL,'&Acc Code'||'
    '||upper(chr(94)));
    ElSIF
    get_item_property('pb_acc_order',LABEL)='&Acc Code'||'
    '||upper(chr(94)) THEN
    Set_block_property('age_tran',order_by,' acc_code DESC');
    execute_query(no_validate);
    SET_ITEM_PROPERTY('pb_acc_order',LABEL,'&Acc Code'||' '||'v');
    ELSE
    Set_block_property('age_tran',order_by,'BALANCE DESC');
    execute_query(no_validate);
    SET_ITEM_PROPERTY('pb_acc_order',LABEL,'&Acc Code');
    END IF;
    END;
    END;
    THANKING U

    Hi Shiju,
    U can use the combination of fornt slash(/) and back slash(\) to fulfil ur requirement.
    For ascending u can use /\ and for descending u can use \/. Does this solve the purpose?
    I think it will.
    Suprabhat.

  • Help needed with refreshing data

    hello OTN!!
    i am having a problem in refreshing the data each time i update it.
    the problem is that i have a tabular layout of my forms . i have made them all display items and whenever a user wants to update the data and he can click on a link on any row and a small pop up window comes up displaying the data in text boxes user can update an individual row of data but after updating the data when user come back on the tabulary laypout form the data does not refreshes it self and same old(not updated) row of data is displayed.
    i have passed parameters between the popup and tabular forms.plz help me urgently and tell me what should i do to refresh my data or behind what trigger i should write the code for refreshing the data. plus so far i have managed to make a button refresh which refreshes the things gaian by execute_query.but i wana do it automatically without pressing button and such .

    Well - you could reformat your drive to FAT32 using Disk Utility. Probably not the ideal solution, but it could work if you save the data first. I'd recommend using a different external drive formatted in FAT32, or maybe a large USB flash drive (or memory cards) if you've got one.
    I have several external drives and a drive enclosure. One (from SimpleTech) was automatically formatted as an NTFS drive (didn't see that notice before I plugged it into my PC at work). It wouldn't read on my iBook G4 but is OK on my MacBook. I think now that it mounts, I could probably reformat it if necessary. Another Western Digital drive came FAT32 formatted.

  • Looping through a table Help needed ....Forms 10g..... When Button Pressed

    Hye craig, hamid, christian and all ...........
    i have a user access interface which i create where there are two fields username and password and a button,
    i have also created a table USERS for users which have username and password fields ..... On useraccess interface i coded on WHEN BUTTON PRESSED like this
    declare
    go_block('users');
    execute_query;
    declare
    begin
         if :useraccess.username=:users.username and
              :useraccess.password=:users.password then
              go_block('MAINPAGE');
              else
              go_block('USERACCESS');
              MESSAGE('SORRY WRONG PASSWORD OR NOT A REGISTERED USER');
              MESSAGE('SORRY WRONG PASSWORD OR NOT A REGISTERED USER');
              end if;
    end;
    This code works for a single user in USERS table but for multiple users there has to be some looping system
    which matches the USERACCESS and USERS tables fields thoroughly ....

    Hi Majid,
    I can suggest you a workaround for this. raise a ON-LOGON trigger and you can use the LOGON_SCREEN builtin to flash the logon screen at runtime. And then try capturing the username and password.
    DECLARE
      connected BOOLEAN := FALSE;
      tries     NUMBER  := 3;
      un        VARCHAR2(30);
      pw        VARCHAR2(30);
      cs        VARCHAR2(30);
    BEGIN
      SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
      WHILE connected = FALSE and tries > 0
      LOOP
        LOGON_SCREEN;
        un := GET_APPLICATION_PROPERTY( USERNAME );
        pw := GET_APPLICATION_PROPERTY( PASSWORD );
        cs := GET_APPLICATION_PROPERTY( CONNECT_STRING );
        LOGON( un, pw || '@' || cs, FALSE );
        IF FORM_SUCCESS
        THEN
          connected := TRUE ;
        END IF;
        tries := tries - 1;
      END LOOP;
      IF NOT CONNECTED THEN
        MESSAGE('Too many tries!');
        RAISE FORM_TRIGGER_FAILURE ;
      END IF;
    END ;   a sample piece of coding to help you out.
    Regards,
    Manoj Chakravarthy

  • Nested Tables and Advanced Queues- Please Help.

    How do i work with NestedTable type and Advanced Queue.
    I have done the following
    I have Oracle 8.1.7 enterprise edition.
    create type myType as TABLE OF varchar(32);
    create type myObject as OBJECT (
    id int,
    myt myType);
    DECLARE
    BEGIN
    dbms_aqadm.create_queue_table(
    queue_table => 'my_queue_table',
    multiple_consumers => TRUE,
    queue_payload_type => 'myObject',
    compatible => '8.1.3'
    END;
    The Nested Table and Object are created successfully.
    but the queue is not created.
    I get the following message.
    DECLARE
    ERROR at line 1:
    ORA-22913: must specify table name for nested table column or
    attribute
    ORA-06512: at "SYS.DBMS_AQADM_SYS", line 2012
    ORA-06512: at "SYS.DBMS_AQADM", line 55
    ORA-06512: at line 3
    I know how to specify the nested table storage clause for
    create table statement, but there is no provision for
    it in the create_queue_table procedure.
    Any help will be greately appriciated.
    i have already created and tested aqs with simple data types,
    also i have created simple tables with nested table type
    elements.
    but the combo of Nested tables and AQ is not working.
    thanks in advance.

    Hi Francois. Thank you very much for your reply, but it seems that i still get errors. So let me tell what i have done.
    As you suggested me: i have done a block based on a sub-query for the nested-table:
    'select courses from department where name= :department.name'.
    In the master block(department) i have the when-new-record-instance trigger:
    Declare
    LC$Req varchar2(256);
    Begin
    LC$Req := '(select ns.courses from table
    ( select courses from department where name = ''' || :DEPARTMENT.name || ''' ) ns )';
    Go_block('block11');
    Clear_Block ;
    Set_Block_Property( 'block11', QUERY_DATA_SOURCE_NAME, LC$Req ) ;
    Execute_query ;
    End ;
    Now the errors i receive, this time in the runtime mode are:
    - FRM-41380: Cannot set the blocks query data source
    -FRM-41003: This function cannot be performed here.
    Since it seems that you know how to work with the nested table i would really appreaciate your help. I am new in the nested table and if you could give an ex with my tables it would be great.
    Thank you in advance.

  • Execute_Query in MASTER-DETAIL form queries the DETAIL block...?

    I'm using Oracle Form Builder with a Master-Detail relationship, I have a WHEN-NEW-FORM-INSTANCE trigger which runs 'EXECUTE_QUERY;' but it is returning records from the Detail block rather than the master block. Can anyone tell me how to return records from the master block?
    I have no idea what the block name is. I've tried the data block name and the title above the block and both say they are undefined.
    Thanks.

    Welcome at OTN
    Please Before posting on this forum please read
    I have no idea what the block name is. I've tried the data block name and the title above the block and both say they are undefined.At Layout Editor expand the Data Block nodes. Here you will get the block name.
    Check in When-New-Form instance trigger, is there any code like
    Go_Block('details_block');IF yes , delete this line...
    Hope it helps...
    Hamid
    If someone's response is helpful or correct, please mark it accordingly.

  • Please help... about multiple form..

    hello guys,
    when I try to pass parameter to another form, I get following error
    FRM-47023:No such parameter...
    I double check that no error with parameter name...
    well, I get information that we should set FORMS_60 path or
    For R12 set FORMS_PATH and for 11i set FORMS60_PATH to refer $AU_TOP/forms/US
    For eg:
    FORMS_PATH=$FORMS_PATH:$AU_TOP/forms/US
    I don't know well how to that...
    is there another thing I miss??
    please help
    Regard.

    well guys,
    thank you very much for all your help.
    I have double checked again n again.. now it work.
    But it stranges, there are two blocks. STUDENT (in the caller form) AND STUDENTENROLLMENT(STUDENT as Master, Enrollment as detail) in the calling form.
    But when the STudent calls STUDENTENROLLMENT, it's true the value is passed to The Master block, but nothing changed on The
    there is only one parameter names P_1
    I make program unit on STUDENT. ADD_ENROLLMENT
    >
    PROCEDURE ADD_ENROLLMENTS IS
         v_plist_id     PARAMLIST;
         v_where               VARCHAR2(50);
    BEGIN
    v_plist_id := GET_PARAMETER_LIST('forms_params');
    IF NOT ID_NULL(v_plist_id) THEN
              DESTROY_PARAMETER_LIST(v_plist_id);
    END IF;
    v_where := 'STUDENT_ID = '||:STUDENT.STUDENT_ID;
    v_plist_id :=CREATE_PARAMETER_LIST('forms_params');
    ADD_PARAMETER(v_plist_id, 'P_1', TEXT_PARAMETER, v_where);
    COMMIT_FORM;
    CALL_FORM('STUDENTENROLLMENT', NO_HIDE, NO_REPLACE, NO_QUERY_ONLY, v_plist_id);
    END;>
    this is the trigger WHEN NEW FORM INSTANCE at the calling form.
    >
    DECLARE
         v_where varchar2(50);
    BEGIN
         IF :PARAMETER.P_1 IS NOT NULL THEN
              v_where := :PARAMETER.P_1;
              SET_BLOCK_PROPERTY('STUDENT',DEFAULT_WHERE,v_where);
              EXECUTE_QUERY;
    SET_BLOCK_PROPERTY('STUDENT',DEFAULT_WHERE, '');
              GO_BLOCK('ENROLLMENT');
         END IF;
    END;
    >
    Regard.

  • Need help(I am a begner in Oracle)

    I am looking for a technical help that, suppose i have an data entry form for Items entry.when users entring(new items) the item_code i want to check it is already there in the table, if it is there i want to display all the fields in the same block.
    how it is possible? i am looking for logic, as well as codes and triggers.
    Thanks alot

    I am looking for a technical help that, suppose i have an data entry form for Items entry.when users entring(new items) the item_code i want to check it is already there in the table, if it is there i want to display all the fields in the same block.
    how it is possible? i am looking for logic, as well as codes and triggers.
    Thanks alot One way to do this is to use a timer. Check to see if the item entered is already in the database in the when-validate-item trigger:
    DECLARE
    emp_exists NUMBER := 0;
    timer_id     Timer := Find_Timer('Cust_Code_Exists');
    one_millisec NUMBER(1) := 1;
    BEGIN
    SELECT COUNT(*)
    INTO emp_exists
    FROM CUSTOMER
    WHERE CUSTOMER_CODE = :CUSTOMER.CUSTOMER_CODE;
    IF (emp_exists > 0) THEN
    message ('Customer code already exists!');
    IF ID_NULL(timer_id) then
    timer_id := CREATE_TIMER('Cust_Code_Exists',one_millisec,NO_REPEAT);
    ELSE
    SET_TIMER('Cust_Code_Exists',1,NO_REPEAT);
    END IF;
    RAISE Form_Trigger_Failure;
    END IF;
    END;
    Then in your form level when-timer-expired trigger:
    DECLARE
         old_where               VARCHAR2(100);
         new_where               VARCHAR2(100);
         tm_name VARCHAR2(40);
    BEGIN
    tm_name := Get_Application_Property(TIMER_NAME);
    IF tm_name = 'CUST_CODE_EXISTS' THEN     
         old_where := GET_BLOCK_PROPERTY(:SYSTEM.CURSOR_BLOCK, DEFAULT_WHERE);
         new_where := 'customer_code = '''||:CUSTOMER.CUSTOMER_CODE||'''';
    SET_BLOCK_PROPERTY(:SYSTEM.CURSOR_BLOCK, DEFAULT_WHERE, new_where);
    CLEAR_BLOCK(NO_VALIDATE);
    EXECUTE_QUERY;
    SET_BLOCK_PROPERTY(:SYSTEM.CURSOR_BLOCK, DEFAULT_WHERE, old_where);
    END IF;
    END;
    Hope this helps

  • A somewhat more complex use of EXECUTE_QUERY with a Where clause...

    Basically, what I need to be able to do is when the form receives a certain parameter upon opening; it must immediately run a certain query and populate the data blocks.
    I do understand the concept of setting the DEFAULT_WHERE in the PRE_QUERY trigger for the block; but I don't think this will work in my situation.
    The reason being is that each data block must run 2 separate queries; and BOTH resulting queries must be populated to each data block, and not overwrite eachother...
    Not only that, but the query being executed requires me to reference 2 separate tables (the data coming from one, however its comparing results from 2 separate tables, so I don't think simply modifying the where clause for the data block will even be possible to achieve the results I am looking for.
    Maybe further explanation of my queries may help the situation. Basically, each data block is linked to a table for the current logged in user, and then there is a production table as well. When ANYTHING is modified, added, or deleted on the current user's table, they are suppose to "publish" the record to the production table. The EXECUTE_QUERY statement will be responsible for running the query that will populate ALL the records that have yet to be published to the production table. So basically, its running a query that will use an ID and compare each individual field by that ID for any changes from the production table. Then, it runs another query to find records that are in either the production table or user table, and not the other; to flag a new record or deleted record.
    I've been thinking about possible ways to do this, but have had no luck unfortunately;
    ANY guidance will be greatly appreciated it. I do understand that my description of the problem may be hard to comprehend, so if you need further clarification please ask.
    Jason
    Message was edited by:
    user558647

    It would be helpful to give an example of the sort of data in each table and what you want to show in each block. I probably didn't understand most of what you wrote but I think the following may be analogous to your situation and requirements (but you'll have more columns of course):
    SQL> CREATE TABLE t_user AS
      2    SELECT
      3      ROWNUM id,
      4      object_name col1,
      5      object_type col2
      6    FROM all_objects
      7    WHERE ROWNUM < 10;
    Table created.
    SQL>
    SQL> DELETE FROM t_user WHERE id = 1;
    1 row deleted.
    SQL>
    SQL> CREATE TABLE t_published AS
      2    SELECT
      3      ROWNUM id,
      4      CASE Mod(ROWNUM,2)
      5        WHEN 0 THEN SubStr(object_name,1,2)
      6        ELSE object_name
      7        END AS col1,
      8      object_type col2
      9    FROM all_objects
    10    WHERE ROWNUM < 9;
    Table created.
    SQL>
    SQL>
    SQL> SELECT * FROM t_user;
            ID COL1                           COL2
             2 I_USER1                        INDEX
             3 CON$                           TABLE
             4 UNDO$                          TABLE
             5 C_COBJ#                        CLUSTER
             6 I_OBJ#                         INDEX
             7 PROXY_ROLE_DATA$               TABLE
             8 I_IND1                         INDEX
             9 I_CDEF2                        INDEX
    8 rows selected.
    SQL> SELECT * FROM t_published;
            ID COL1                           COL2
             1 ICOL$                          TABLE
             2 I_                             INDEX
             3 CON$                           TABLE
             4 UN                             TABLE
             5 C_COBJ#                        CLUSTER
             6 I_                             INDEX
             7 PROXY_ROLE_DATA$               TABLE
             8 I_                             INDEX
    8 rows selected.
    SQL>
    SQL> -- yet to be published to the production table
    SQL> -- includes records previously published and then updated, but not new
    SQL> -- records which have never been published (these are in the other query)
    SQL> SELECT u.id, u.col1, u.col2
      2  FROM t_user u, t_published p
      3  WHERE u.id = p.id
      4  AND (
      5    u.col1 != p.col1
      6    OR u.col2 != p.col2
      7    )
      8  ;
            ID COL1                           COL2
             2 I_USER1                        INDEX
             4 UNDO$                          TABLE
             6 I_OBJ#                         INDEX
             8 I_IND1                         INDEX
    SQL>
    SQL> -- new and deleted records
    SQL> SELECT * FROM(
      2    SELECT id, col1, col2, 'NEW' status FROM t_user
      3    UNION ALL
      4    SELECT id, col1, col2, 'DELETED' status FROM t_published
      5  )
      6  WHERE id NOT IN(
      7    SELECT id FROM t_user
      8    INTERSECT
      9    SELECT id FROM t_published
    10  )
    11  ;
            ID COL1                           COL2                STATUS
             9 I_CDEF2                        INDEX               NEW
             1 ICOL$                          TABLE               DELETED
    SQL> Basically, I think the answer is in the query and not the Where Clause.
    I think you want one of these queries in each block, so set the blocks' queries (are you changing that query based on the parameter passed in, or just executing the query, you're not clear on that) and then do
    go_block('B2');
    execute_query;
    go_block('B1');
    execute_query;

  • Nested Tables and Forms 9i-please help

    Hi
    i have the folowing example of a nested table:
    CREATE TYPE CourseList AS TABLE OF VARCHAR2(10) -- define TABLE type
    CREATE TYPE Student AS OBJECT ( -- create object
    id_num INTEGER(4),
    name VARCHAR2(25),
    address VARCHAR2(35),
    status CHAR(2),
    courses CourseList) -- declare nested table as attribute
    CREATE TYPE Course AS OBJECT (
    course_no NUMBER(4),
    title VARCHAR2(35),
    credits NUMBER(1));
    CREATE TYPE CourseList AS TABLE OF Course;
    CREATE TABLE department (name VARCHAR2(20),
    director VARCHAR2(20),
    office VARCHAR2(20),
    courses CourseList)
    NESTED TABLE courses STORE AS courses_tab;
    In Forms i have created a data block based on table department and for managing the nested table courses_tab i found out that i should use a stored procedure:
    PROCEDURE procedure_nest (c_c out courses_tab%rowtype) IS
    c_c courselist;
    BEGIN
    select c.name, c.director,office into :department.name, :department.director,
    :department.office from department c , table
    (select n.courses from department n where c.name =n.name and rownum<=1);
    END;
    compil error:
    error 999 at line 1, column 35
    implemntation restriction (may be temporary) ADT or schema level
    collection not supported at client side with non-OCI mode.
    i really would like to know what shall i do to use and manage the nested table in forms.
    Thank you very much

    Hi Francois. Thank you very much for your reply, but it seems that i still get errors. So let me tell what i have done.
    As you suggested me: i have done a block based on a sub-query for the nested-table:
    'select courses from department where name= :department.name'.
    In the master block(department) i have the when-new-record-instance trigger:
    Declare
    LC$Req varchar2(256);
    Begin
    LC$Req := '(select ns.courses from table
    ( select courses from department where name = ''' || :DEPARTMENT.name || ''' ) ns )';
    Go_block('block11');
    Clear_Block ;
    Set_Block_Property( 'block11', QUERY_DATA_SOURCE_NAME, LC$Req ) ;
    Execute_query ;
    End ;
    Now the errors i receive, this time in the runtime mode are:
    - FRM-41380: Cannot set the blocks query data source
    -FRM-41003: This function cannot be performed here.
    Since it seems that you know how to work with the nested table i would really appreaciate your help. I am new in the nested table and if you could give an ex with my tables it would be great.
    Thank you in advance.

  • Nested tables.... Please help

    Hi Friends,
    I have some strange issues when I am trying to create a nested dynamic table with SAP DATA in Adobe Designer.
    In the context, under the MAIN node
    I had dragged the header table. Under the header table I had dragged the item table and had created a WHERE condition to link the HEADER and ITEM table.
    Now my layout is pretty complicated..
    I want to result to be as below:
    header row.... with 0001 Customer name
    item row with 0001 0010 price qty
    0001 0020 price qty
    0001 0030 price qty
    header row... field4
    (field4 from the header table has to be displayed after the item table has generated all the items and this process should repeat for all header data)
    My design in layout is as below
    subform1 for headerdata
    ( set as positioned and has set to 'Repeat form for each data item')
    headerdata fields for subform1 (field1, field2, field3)
    subform2 for itemdata
    (set as folowed)
    subform3 for itemdata
    (set as positioned, 'Allow page breaks within content' and had set 'Repeat form for each data item')
    itemdata fields in subform3
    subform4 for headerrow field4
    but when I activated and execute the form, the result was wrong.
    The result should be like below...
    |->field1, field2, field3
    |--->field1 charge111
    |--->field1 charge211
    |-> field4
    |->field2
    |--->field2 charge122
    |--->field2 charge222
    |-> field4
    but it is printed like below and field4 is overlapped with the item rows if the item rows are more...
    DATA
    |->field1 field2 field3
    |--->field1 charge111 This inner table is overlapping the subform4 for each item
    |--->field1 charge211
    |
    |->field1 field2 field3
    |--->field1 charge121 This inner table is overlapping the subform4 for each item
    |--->field1 charge221
    2) If I have more item data, all the item rows are overlapped with the field4 (which I had explained in my layout) and the item rows are not moved to the next page, but still it is continued in the same page, meaning that if the page can fill 20 lines and my item row are more than 20 lines, 20 lines are printed and the remaining items are not moved to the next page... it is invisible...
    How can I solve this issue?
    Please help me
    Thanks in advance.
    Jaffer Ali.S

    Hi Francois. Thank you very much for your reply, but it seems that i still get errors. So let me tell what i have done.
    As you suggested me: i have done a block based on a sub-query for the nested-table:
    'select courses from department where name= :department.name'.
    In the master block(department) i have the when-new-record-instance trigger:
    Declare
    LC$Req varchar2(256);
    Begin
    LC$Req := '(select ns.courses from table
    ( select courses from department where name = ''' || :DEPARTMENT.name || ''' ) ns )';
    Go_block('block11');
    Clear_Block ;
    Set_Block_Property( 'block11', QUERY_DATA_SOURCE_NAME, LC$Req ) ;
    Execute_query ;
    End ;
    Now the errors i receive, this time in the runtime mode are:
    - FRM-41380: Cannot set the blocks query data source
    -FRM-41003: This function cannot be performed here.
    Since it seems that you know how to work with the nested table i would really appreaciate your help. I am new in the nested table and if you could give an ex with my tables it would be great.
    Thank you in advance.

  • Help: using a stored procedure to insert a record in DB

    A stored procedure:
    PROCEDURE db_insert
    db_block IN OUT plsql_table)
    is created in DB.
    db_select and db_update are created too. They both work fine as
    db_select is called by go_block execute_query (block populated) and
    db_update is called by commit (DB updated);
    I am trying to have db_insert called as:
    1. DO_KEY('Create_Record');
    2. fill in fields and then
    3. commit.
    These 3 steps do not cause the call of the auto generated block trigger insert_procedure. I think that after filling in the fields and there should be a way to call this insert_procedure trigger. I am not sure how this will work.
    Any suggestions are greatly appreciated.

    I went through quite a deep search and yet not found any good answers. Knowing that select and update all done well with execute_query(stored procedure is called) and commit(stored procedure is called), but not insert.
    Logically there must be some FORM build in that will trigger the call of stored procedure insert.
    I am still looking for answers and just to remind that there are quite number of similar posts and I do not think that any clear answers were delivered.
    Please help.

  • Execute_query and go_item

    Hello.
    I have a master-detail form.
    And i have key-exeqry trigger. Here i have execute_query built-in and then go_item.
    But when i execute_query, cursor doesn't jump to item i specified in go_item.
    For testing i created timer which waits for 1 second after execute_query. In when-timer-expired trigger i use the same go_item. After timer expires then go_item works.
    Can anyone help me with that? I don't want to use timer.
    Any idea?
    Thanks.

    Are you sure?
    I have seen the online help and there is nothing about it..
    Here is the online help.
    Post-Query Trigger Description
    When a query is open in the block, the Post-Query trigger fires each time Oracle Forms fetches a record into a block. The trigger fires once for each record placed on the block's list of records.
    Definition Level form or block Legal Commands SELECT statements, unrestricted built-ins Enter Query Mode no
    Usage Notes Use a Post-Query trigger to perform the following tasks: populate control items or items in other blocks calculate statistics about the records retrieved by a query calculate a running total When you use a Post-Query trigger to SELECT non-base table values into control items, Oracle Forms marks each record as CHANGED, and so fires the When-Validate-Item trigger by default. You can avoid the execution of the When-Validate-Item trigger by explicitly setting the Status property of each record to QUERY in the Post-Query trigger. To set record status programmatically, use SET_RECORD_PROPERTY . On Failure Oracle Forms flushes the record from the block and attempts to fetch the next record from the database. If there are no other records in the database, Oracle Forms closes the query and waits for the next operator action. Fires In Fetch Records Post-Query Trigger Examples Example This example retrieves descriptions for code fields, for display in non-database items in the current block. DECLARE CURSOR lookup_payplan IS SELECT Payplan_Desc FROM Payplan WHERE Payplan_Id = :Employee.Payplan_Id; CURSOR lookup_area IS SELECT Area_Name FROM Zip_Code WHERE Zip = :Employee.Zip; BEGIN /* ** Lookup the Payment Plan Description given the ** Payplan_Id in the Employee Record just fetched. ** Use Explicit Cursor for highest efficiency. */ OPEN lookup_payplan; FETCH lookup_payplan INTO :Employee.Payplan_Desc_Nondb; CLOSE lookup_payplan; /* ** Lookup Area Descript given the Zipcode in ** the Employee Record just fetched. Use Explicit ** Cursor for highest efficiency. */ OPEN lookup_area; FETCH lookup_area INTO :Employee.Area_Desc_Nondb; CLOSE lookup_area; END

  • Cannot have execute_query in post-change but can have it when-radio-changed

    why is it possible to put execute_query in a when-radio-changed trigger but one cannot put it in
    a post-change or post-text-item trigger? (11.1.1.4)
    For example I want to ask for a year, and a month. I don't much feel like creating radio items for all those years. Whenever a year
    or a month is changed I want it to reconstruct the where clause and execute the query. But the year not being a radio group
    is more problematic about how to get execute_query to run. What is thinking here? I think that a text item post-change deserves as much power as a radio_group change! It's unfair.

    Over the years, I have found that the people that complain about Oracle Forms the most are the people that refuse to learn how Oracle Forms works. You can't expect to develop in a any framework unless you learn the rules of the framework. I've seen numerous complaints about the lack of documentation on Forms and yet the single most important form of documentation is the Oracle Forms Help system. The answer to virtually every question you might have can be found in the Forms help system, but it helps to understand a little about how Forms functions so you can ask the right questions in the help system.
    I also find it hard to understand how an employer will throw someone, with little or no exposure to Oracle Forms, into a Forms project and expect them to "Pick it up" along the way rather than take the time and expense to send them to an Oracle Forms class. How can the employer expect the employee to be successful if they are unwilling to give them the resources they need to be successful. If you are one of the unfortunates that are in this situation, then you could at least perform a simple Google search on "Forms Tutorials" and you will find numerous on-line "Free" tutorials. Don't worry about the Forms version used by these tutorials as you are only going through the tutorial to learn how to create a Form and how the Forms tool interacts with the database; which is doesn't matter which Forms version you are using because this part hasn't changed all that much between the Forms versions.
    There are even some really good books (however, quite old) that you can purchase that teach you all the basics of Oracle Forms. Here are just a few:
    Developing Oracle Forms Applications by Albert Lulushi
    Oracle Forms Developer's Handbook by Albert Lulushi
    Oracle Developer: Advanced Forms and Reports by Peter Koletske
    Programming with Oracle Developer by Matthew BennettThese are just a few books and yes they are all for older versions of Oracle Forms. But the concepts you will learn apply to any Forms version.
    While I admit that it is inconvenient that I can't call a Restricted built-in from certain triggers once you understand the reasons why you can't call Restricted built-ins it make sense why Oracle built their event model the way they did. By calling certain restricted built-ins in a trigger, such as the When-Validate-Item trigger, you could very easily cause an an endless loop to occur in your application. For example, if you were allowed to call the GO_BLOCK or GO_ITEM built-ins from a When-Validate-Item trigger you could cause cascading validation events to occur. While this is not a bad thing in and of itself, but what would happen if I sent the Forms Navigation cursor to go to an item before I had completed my validation logic. The item I sent the cursor too also happens to have validation logic assigned to it that just so happens to send the navigation cursor to the item I just left. Understand, the first item has not yet completed it's validation process and the second item sends the cursor right back the first item - which triggers a new validation event on the first item. Now I've got compounding events in the execution stack and I've put my application into a loop that I will never get out of because I've got validation logic that never completes successfully so the validation event never exits - it just keeps running and running.
    At first, you might say that it is the developers responsibility to ensure this does not happen and the developer should be more careful with their code to prevent this from happening and you would be right. We (developers) are responsible for writing safe code. However, after a while, software manufacturers eventually put restrictions in place because there are enough irresponsible developers out there causing problems and the only way to fix the issue is through the use of framework restrictions.
    Having said that, Oracle Forms has certain restrictions for good reasons. Because you don't understand what those reasons are is not a good reason to complain about the restrictions. Rather, I would hope, that your lack of understanding of a particular framework/methodology would encourage you discover the "Why's" and "How come's" of the framework.
    The simple fact of the matter is you cannot be successful with Oracle Forms unless you learn how to program within the Forms Framework. You can't take C++, Java or any other programming language and apply the rules of programming these languages to Forms. You absolutely must learn how Oracle Forms operates and what the rules are for developing successful Forms applications.
    That's my two cents on the topic. I'm trying to start a flame war; I'm just tired of hearing people complain about Forms just because they don't understand or haven't taken the time to understand how Forms operations and what the rules are for developing within Oracle Forms.
    Sincerely,
    Craig...
    Edited by: CraigB on Aug 2, 2011 12:38 PM

Maybe you are looking for

  • Invalid Format after updating iOS

    I just updated my ATV 2 to the latest version of iOS an now my Plasma says "invalid format" whenever i start the ATV 2. No video, no audio. Unplugging didn't work exactly. I can see the apple symbol at start-up but then the "invalid format" sign from

  • Generic icons for Office on desktop

    I copied the files on the desktop of my Air running 10.6.8 to a drive, and then copied those files to the desktop on my new Air running 10.10.2. The icons of all (and only) the Office files have gone generic. When I drag a Word file with the correct

  • Pulldown arrow on address bar window

    I wanted to know if there is a way to have the pulldown arrow in the address bar window just like on Firefox. Thanks!

  • Airport Express 802.11n problem

    I have an Airport Express 802.11n. I use it to send iTunes from my mac on my stereo system in the adjacent room, via my wireless network. I don't use it all that often. It has worked fine over the two or so years I've had it A couple of weeks ago I h

  • No credit cards

    hi is theri any way we can download free apps with out using a credit card