Data to be queried in oracle forms

select a.dept_id,a.drive_id,a.qc_type_id,a.qc_subtype_id,
a.equip_code,a.staff_id,a.out_of_service,a.comments
from qc_equipment_used a,qc_equipment b
where a.equip_code = b.equip_code
and a.dept_id = 5
and a.drive_id = 'DRV2007930'
and qc_type_id = 1008
and qc_subtype_id = 1000
and equip_type_id =1000
But when I am trying to query in the form I get only one line.
Header is database
in the detail ids are database but a.equip_code,a.staff_id,a.out_of_service,a.comments are non database columns. The data gets saved properly but when I query I get only one line.
Cursor C1 is select a.equip_type_id
from qc_dept_equipment a,qc_equipment_type b
where a.equip_type_id = b.equip_type_id
and a.qc_type_id = :qc_daily.qc_type_id
and a.qc_subtype_id = :qc_daily.qc_subtype_id
and alias_desc = v_description;
Cursor C6 is select a.equip_code,a.staff_id,a.out_of_service,a.comments
from qc_equipment_used a,qc_equipment b
where a.equip_code = b.equip_code
and a.dept_id = :qc_daily.dept_id
and a.drive_id = :qc_daily.drive_id
and qc_type_id = :qc_daily.qc_type_id
and qc_subtype_id = :qc_daily.qc_subtype_id
and equip_type_id = v_equip_type_id;
Begin
select count(*) into v_count from qc_daily a
where a.dept_id = :qc_daily.dept_id
and a.drive_id = :qc_daily.drive_id
and qc_type_id = :qc_daily.qc_type_id
and qc_subtype_id = :qc_daily.qc_subtype_id;
v_description := 'Genesis Sealer';
:parameter.equip_code := 'one';
Open c1;
Fetch c1 into v_equip_type_id;--:qc_dept_equipment.equip_type_id;
Close C1;
If v_count > 0 then
Open C6;
loop
Fetch C6 into :qc_equipment_used1.equip_code,:qc_equipment_used1.staff_id,
:qc_equipment_used1.out_of_service,:qc_equipment_used1.comments;
:parameter.P_EQUIP_CODE := v_equip_code;
:parameter.equip_type_id := v_equip_type_id;--:qc_dept_equipment.equip_type_id;
:parameter.EQUIP_TYPE_ID1 := :parameter.equip_type_id;
Exit when :system.last_record = 'TRUE';
next_record;
End loop;
Close C6;
End if;
End;
DEPT_ID     DRIVE_ID     QC_TYPE_ID     QC_SUBTYPE_ID     EQUIP_CODE     STAFF_ID     
5     DRV2007930     1008     1000     SEALCEN001     0143          
5     DRV2007930     1008     1000     SEALCEN038     0143

Sorry, but i don't understand your problem. What is that code you provided? In what trigger do you place it? What is it supposed to do?

Similar Messages

  • Frm-40505:ORACLE error: unable to perform query in oracle forms 10g

    Hi,
    I get error frm-40505:ORACLE error: unable to perform query on oracle form in 10g environment, but the same form works properly in 6i.
    Please let me know what do i need to do to correct this problem.
    Regards,
    Priya

    Hi everyone,
    I have block created on view V_LE_USID_1L (which gives the error frm-40505) . We don't need any updation on this block, so the property 'updateallowed' is set to 'NO'.
    To fix this error I modified 'Keymode' property, set it to 'updatable' from 'automatic'. This change solved the problem with frm-40505 but it leads one more problem.
    The datablock v_le_usid_1l allows user to enter the text (i.e. updated the field), when the data is saved, no message is shown. When the data is refreshed on the screen, the change done previously on the block will not be seen (this is because the block updateallowed is set to NO), how do we stop the fields of the block being editable?
    We don't want to go ahead with this solution as, we might find several similar screens nad its diff to modify each one of them individually. When they work properly in 6i, what it doesn't in 10g? does it require any registry setting?
    Regards,
    Priya

  • For Update Query from ORACLE Forms

    Hi
    We are using Oracle Forms 10g running with 10g database 10.2.0.1.0. We happend to see a query which is getting generated in AWR report like Select rowid, all_columns from TableName for Update of C1 Nowait. But no such query is really written in forms and we are aware that, Any query prefixed with rowid is definitely executing from Forms. But how the ForUpdate and Nowait clause is appended to the query.
    We have checked the following properties in the database Block
    *1) Locking Mode is set to Automatic*
    *2) Update Changed Columns only is set to YES*
    *3) Query all records is set to No (Though this particular property may not be relevant to the issue)*
    What is the property or setting which might trigger such a query from ORACLE Forms with ForUpdate and Nowait clause.
    Any ideas/suggestions on why such behaviour. Please have a healthy discussion on this. Thanks in advance.

    you can't dynamically add a query to the data model in reports.
    You should look into the XML based customization of Oracle Reports. This will enable you to define a report dynamically by creating a definition in XML.
    Also another option is to have the report with a query in it and use lexical parameters in reports to pass the query definition or just the where part of it.
    Look at the reports online help for both of these solutions.

  • Displaying Records data as text grid in oracle forms

    Hi
    I am new to oracle forms. I want to display data from different tables as a text.
    And I need to give hyper link for that data.
    I am using oracle forms 10g., forms builder.
    can anyone tell me the process.. I need it very very soon..
    Thnx in advance
    ~noc

    Ok, you can populate records in 2 ways
    1. Using cursor (if your block is a non-database block)
    2. Using EXECUTE-QUERY (If your block is a database block)
    If you have created a database view as suggested above, then you can simply add a WHERE clause in the property palette of the block,
    then in the button's when-button-trigger write EXECUTE_QUERY.
    But if you have created a non-database block, (didnt create database view)
    in that case you can simply write a cursor in the when-button-pressed trigger as:-
    Declare
    cursor my_cur is
    select col_list....
    from table_list....
    where......;
    Begin
    GO_BLOCK('Name of block');
    CLEAR_BLOCK(NO_VALIDATE);
    First_Record;
    For cur in my_cur Loop
    :BLOCK_NAME.ITEM_NAME := cur.col1;
    Next_Record;
    End Loop;
    First_Record;
    End;
    One more point, as suggested above, you can create the button in a non-database control block,
    or,
    in the same block with the button's Number of Records Displayed set to 1
    in either case, I usually keep the button's Mouse Navigable & Keyboard navigable properties to No,

  • Can i use case in query in oracle form 6i

    sir can i use case in query in oracle form 6i
    such as
    select empno, case when deptno=10 then dptno end from emp;
    please gice me

    Hello,
    Does this code compile ?
    If not, I'm afraid that the PL/SQL engine of Forms6i does not recognize this syntax.
    Francois

  • Developering ADF form in query mode (Oracle forms simulation)

    Hi,
    we have a requirement for developing the existing Oracle form using Oracle ADF. The existing Oracle form displays the form in query mode by default. We can enter the search criteria in any of the text fields and then execute query to get the results. If the user does not enter any search criteria, then the form loads specific record based on default criteria into the form. Could you please help developing similar form using ADF.
    At present I created the view object with one bind variable and dragged the view as ADF form to the jspx page. Then I am launching the form in query mode (executing the find method on the view object using operation binding at the time of loading the page). After entering the query criteria in the form, If I click on a button I am executing a method in the managed bean. In the managed bean I am executing the "Execute" operation on the view and it is working fine.
    But my problem is if the user does not enter the search criteria I have to pass default parameters to the view object and return the default record in the form.
    Can you please help in resolving the issue.
    Thanks and Regards,
    S R Prasad

    Hi Frank,
    Thank you for providing information. I created the query panel with the table by dragging all the named criteria. But this is not the look we are expecting for this form. As we have to deveop ADF form with the same behavior as oracle forms, the user must be in a position to edit the data in the same field as that of query field.
    As an example, we have to design a form for Dept table. We have to display all the columns of the dept view in the form at the time of launching the form in query mode. Once the user enters any search criteria in the form, we have to perform search and display the record(s) matching the query criteria in the same columns displayed in the form. User should not see any changes in the form layout.
    If the user does not enter any data in the form, then we have to display the record(s) in the form with the specific department id(This department id can be calculated based on the data in another table).
    Can you please help us in resolving the issue.
    Thanks and Regards,
    S R Prasad

  • Upload data from microsoft access to oracle form(in data block)

    Hi all,
    Any one can help me, how we can upload data from access file to developer form(in data block).
    as
    we upload data from text file to developer form(in data block) using some packages.
    Thank's in advance

    Hi Zuhair,
    If you give details of the problems you are still having then we should be able to get SQL*Developer to work.
    However, if you don't want to use SQL*Developer then the following options are taken from note 393760.1 available in Metalink if you have access to that -
    1. Use a gateway that supports the non-Oracle database or generic connectivity if a third party ODBC driver is available to do a -
    'create Oracle_table as select from non_oracle_table@database_link'
    for each table. You would then have to manually create all the other objects (views, indexes, stored procedurs etc) and permissions etc that existed in the non-Oracle database.
    2. Use the SQL*Plus COPY command to copy data from the non-Oracle database to the
    Oracle database using a gateway or generic connectivity. The syntax is as follows:
    COPY FROM username/password@oracle_sid -
    INSERT destination_oracle_table -
    USING query;
    The following example selects all rows from the EMP table in the non-Oracle database and
    inserts them into the local Oracle EMP table:
    COPY FROM SCOTT/TIGER@ora10 -
    INSERT EMP -
    USING SELECT * FROM SCOTT.EMP@gateway;
    where "gateway" is the database link created for the gateway.
    3. Load the non-Oracle data into flat files and use SQL*Loader to put the data into Oracle tables. Again manual
    work is required for the other objects.
    4. Contact the Oracle Product Technology Services (PTS) group for assistance. See the webpage -
    http://www.oracle.com/technology/tech/migration//workbench/index_sqldev_omwb.html
    5. Use a third party migration tool. See -
    http://www.oracle.com/technology/tech/migration/isv/third_party.html
    6. Use JDBC to connect to the non-Oracle database and Java in the Oracle database. This method will work but it is not suppported by the JDBC team.
    =========
    The amount of work involved will depend on the number and size of Access tables that you want to migrate.
    Regards,
    Mike

  • Index Usage from SQL query in Oracle Forms

    Would using LIKE/OR in where clause (of an indexed column) will force the the query to NOT use INDEX. We have these where clause in Oracle Forms Records Group.
    Below are two examples...
    1. If we have a where clause with LIKE would that NOT use the index?
    Example: ColumnName like :block.Column||%
    2. How about having an OR clause?
    Example: and (ColumnName = :block.column or :block.column is null)
    Thanks

    Hi
    Answer 1: Where with like clause WOULD use the index.
    In this example index on ColumnName
    Answer 2: Write better where:
    Example: and (:block.column is null or ColumnName = :block.column)
    When :block column is null then statement after 'or' is not used. Index will not be used with RBO, i think.
    The best way to be sure is to look at explain plan on the original query.
    Regards
    Kuba

  • Using a Sum query in Oracle Forms

    Greedings,
    I have the following query which works fine in PL/SQL but i cant get it working in Oracle forms as i get an error in SUM(SELECT...) . Any quidance on how i should fix my query to work in Forms?
    select
       Sum((SELECT kl.amount
                FROM S03_a_salfldg@oracle_to_sun kl
                WHERE Trim(kl.accnt_code)=Trim(a.acnt_code)
                AND kl.period between 2008001 AND 2008012 AND ROWNUM=1)) AS actual
       from so_budgets_cat a,a01_acnt@oracle_to_sun b,so_budgets_com c,so_budgets d
       where trim(a.acnt_code)=trim(b.acnt_code)
       AND a.cat=c.cat
       AND TRIM(d.acnt_code)=trim(a.acnt_code)
       AND d.business_object=10000103883
       AND d.business_object=c.bus_object
       AND d.business_object=a.business_object
       AND SubStr(d.period,1,4)=Trim(c.PERIOD_Y)
       AND C.period_Y BETWEEN substr(2008001,1,4) AND substr(2008001,1,4)
       GROUP BY a.cat,a.acnt_code,c.com,a.cat_desc,b.descr,d.acnt_code
       order by a.cat,a.acnt_code,c.com,a.cat_desc,b.descrThanks in advance

    And what error would that be? Also where are you using this query? In a from clause query? Also you didn't specify any version infos; as forms has it's own PL/SQL engine there is a possibility that you run in a version problem if the code runs fine in SQL*Plus but fails to compile in forms (e.g. when running Forms 6i against a 10g database). Without those informations answers to your question are based on guessings, and most likely will result in a question-answer ping-pong.
    cheers

  • Problem with different resultset with same data and same query in Oracle 8.1.7 and 9i

    Hello,
    I have been using this query in oracle 8.1.7
    SELECT
    ID,
    AREA_NO
    FROM MANAGER_AREA MGR
    WHERE COMPANY_ID = :id AND
    (:value < (SELECT COUNT(ROWID)
    FROM MANAGER_WORK MW
    WHERE MW.AREA_ID = MGR.ID AND
    (MW.END_WORK IS NULL OR MW.END_WORK >= SYSDATE)))
    order by AREA_NO;
    In the above query I want to see rows from MANAGER_AREA table depending upon date criteria in the table MANAGER_WORK and also upon the parameter :value i.e if I pass a value as 0 I get to see records for which their is atleast 1 record in MANAGER_WORK with the date criteria and if I pass -1 then I get all the records because minimum value that count(*) would give is 0. The resultset was as expected in 8.1.7.
    A couple of days back I installed PERSONAL 9i to test for testing the basic functionality of our program with the same data. This query fails and irrespective whether I pass -1 or 0 it returns me same dataset which I would have got in case if I pass 0.
    I do not know whether this is a bug that has got introduced in 9i. Can anybody help me with this problem. It would be difficult for me to change the parameter send to this query as the Query is called from many different places.
    Thanks in advance
    Amol.

    I cannot use a Group by and a having statement over here. The problem with 'Group by' and 'having' clause is If I have to make a join between the two tables. When I use join then I get only rows that are linked to each other in the table.
    If I use outer join to solve that problem then I have to take in consideration the other date condition. My previous query use to virtually discard the corelated query result by using -1 as the value. This will not happen in the join query.
    Amol.

  • How to show the result of query in oracle forms 10g to Excel Sheet File

    Dear All,
    I have query and i want the result to be show in excel sheet file in oracle forms
    for example if i have a form with search criteria and when pressed the button of ( export to excel ) the result is
    excel file contains the result of the query .

    The only method to achieve this is with the help of Webutil. Please go through documentation for more help.
    Regards,
    Manoj Chakravarthy

  • Query on oracle forms

    when i am trying to run my oracle form on google chrome i am getting a error message that oracle jinitiator version is very low
    kindly give the answer

    Google Chrome is not compatible with the Oracle Jinitiator.  Actually, very few - if any - current browsers are compatible because the Oracle Jinitiator is based on Java 1.3.
    As others have asked, we need to know your Forms, Windows, Java and browser versions in order to offer you some help.
    Craig...

  • Restoring data after Query in Oracle form

    Hello All,
    My requirement is to check some check boxes --> SAVE --> F11 --> Control F11. User want to see the checked box again. Means thec check box should be checked until the form is open.
    Please reply thanks.
    Thanks.
    Edited by: Amit1cs on Apr 15, 2013 1:11 PM

    Hello Indira,
    I have done this so far ...
    I have created a PL/SQL table type and I am storing the checked box row number in that table type on trigger KEY_COMMIT trigger. but now I want to call this Pl>SQL table which have data in trigger KEY-EXEQRY (to recheck the check box again)which I can not... please suggest how this can be achieved.
    Please suggest.

  • Execute query for oracle forms tab pages

    Hi Guru's,
    Please help me how to work on execute query with forms tab pages. I have created three tabs like A, B & C in one canvas.
    I have three tables and I have created three tabs in one canvas. And there is no master detail relationship with these three tables.
    I have written the code in form level - when-new-form-instance like do_key('execute_query') but when i see at run time its executing for first tab A not for tab B or tab c.
    How to get the data or execute the data in tab B and tab C.
    Thanks
    RS

    1- create a block blk_1 add items item_1,Item_2 and Item_3.
    2- create main canvas main_canvas. type Content.
    3- create tabcanvas TABCANVAS . Type Tab
    4- Create tabpages tb_1,tb_2 and tb_3.under tabcanvas
    5- create stack1,stack2 and stack3.type stack.
    6- put Item_1,Item_2 and Item_3 under stack1,stack2 and stack3.
    add when tabpage change trigger.
    Declare
    V_TapPage_Name VarChar2(100);
    Begin
    Show_View('TABCANVAS');
    V_TapPage_Name := Get_Canvas_Property('TABCANVAS',TOPMOST_TAB_PAGE);
    If V_TapPage_Name = 'TP_1' Then
    Go_Item('Blk_1.ITEM_1');
    Show_View('STACK1');
    Hide_View('STACK2');
    Hide_View('STACK3');
    ElsIf V_TapPage_Name = 'TP_2' Then
         Go_Item('Blk_1.ITEM_2');
         Show_View('STACK2');
    Hide_View('STACK1');
    Hide_View('STACK3');
    ElsIf V_TapPage_Name = 'TP_3' Then          
         Go_Item('Blk_1.ITEM_3');
         Show_View('STACK3');
    Hide_View('STACK1');
    Hide_View('STACK2');
    End If;
    End;
    Edited by: kingadmin on 20/04/2011 02:15 ص
    Edited by: kingadmin on 20/04/2011 02:16 ص

  • Sorting the data of control block in oracle form 10g

    I have two block....both are the control block..
    in first block i select the date and in second block the data of that date is populated.but the data is populated
    using cursor in when-button-pressed trigger of that first block button...
    in cursor the data is selected and placed in field of detail block using into clause.... each field..
    .and one item of detail block is srno which is create in post-query of detail block using
    :sysyem.trigger_record.
    Now i want after populated the detail block the data is sorted desc one of the field of the detail block...
    Can this possible using set_block_property() of block although the block is control block if yes where i should do
    this??????
    Please explian...????

    but with the cursor of repopulate ...how the block is in desc by one field..because if i use again the same cursor to poulate than whats this benefits???
    if i write a cursor in button when-button-trigger in first block like this code....
    go_block('');
    cursor emp_cur is
    select empno,date,sal
    from emp;
    begin
    for i in cur loop
    select i.empno,i.date,i.sal
    into :empno,:date,:sal
    from emp
    end loop
    end;
    this loop populate the block which is controll block..
    syntax error should be ignored ...i wana to explain what i want to do...
    this is not the actual query i have another query but the concept is that...
    how i can do this...

Maybe you are looking for