Querying Block Based on Procedure

I built the form based off the following thread:
Form based on stored procedure
However, the block created by the procedure does not appear to be queryable with any given criteria. Query Enter, enter criteria, Query Execute didn't work it still returns the all the data. I also tried putting in a default where clause, but that didn't work. Is there a way to query the result set returned?
Thanks,
Roschera

Okay, now I've tried adding data source arguments to pass in a parameter to the cursor being used to generate the data. I've set the default value to null and double checked to make sure the same data types are being used, however, I'm still receiving an ORA-6502 error. Any help would be appreciated.
Thanks,
Roschera

Similar Messages

  • Need to create a block based on procedure

    We can create a block based on procedure...but whats the need to do so...please can anybody explain.

    There are several recent posts on the topic with a lot of good help & documentation.
    The Metalink note: 66887.1
    Re: Form on a procedure
    If you can't access Metalink, search here on that note. Someone posted the full text a couple days ago.
    This is also very good reference:
    Block based on procedure
    Essentially, you have a procedure, returning a table-of-records type variable, called by the block "Query Data Source..." properties.
    Name = procedure name
    Arguments = procedure parameters (IN parameter(s) Value is :block.item)
    Source Columns = the record type columns for your table-of-records
    Datatypes & sizes must match all around.
    Start very simple & get it to work first, then expand.
    You must follow the documentation very carefully. If it doesn't work at first, go through everything to verify. Also, read the Tip & Issues at the end of the Metalink note.
    Have fun. It works awsome once you get the hang of it.

  • Record Who information for a block based on procedure

    Hi All,
    I have a block whose query data source type property is set to procedure and query data source name is a procedure. When I hit Ctrl F11 on this block it shows me all the records. When I see the record who information , I see all the record who information except the Table Name. I understand that the table name is not coming as the query data source name is a procedure for this block. Is there a way to dynamically set this query data source name to a table or a view while still retaining the procedure based functionality. I tried set_block_property for this property but form won't allow.
    Thanks

    There are several recent posts on the topic with a lot of good help & documentation.
    The Metalink note: 66887.1
    Re: Form on a procedure
    If you can't access Metalink, search here on that note. Someone posted the full text a couple days ago.
    This is also very good reference:
    Block based on procedure
    Essentially, you have a procedure, returning a table-of-records type variable, called by the block "Query Data Source..." properties.
    Name = procedure name
    Arguments = procedure parameters (IN parameter(s) Value is :block.item)
    Source Columns = the record type columns for your table-of-records
    Datatypes & sizes must match all around.
    Start very simple & get it to work first, then expand.
    You must follow the documentation very carefully. If it doesn't work at first, go through everything to verify. Also, read the Tip & Issues at the end of the Metalink note.
    Have fun. It works awsome once you get the hang of it.

  • Data block based on procedure

    While working on a form with a data block based on a procedure, I keep getting error
    FRM-40364 The data type of item '%' does not match the corresponding column in the stored procedure.
    I have compared the items many times and found no mismatch. When the items are resorted (in both the data block and the procedure) and everything is recompiled, the
    "not matching" item referenced sometimes changes, though the types have not been changed. Has anyone solved a similar situation?

    Hi,
    Yes I did use the wizard,
    I agve it the package.proc name for query.
    it pulled up the field delivery ID,
    Hit finish, because I do not need update/delete/inserts.
    the query data source columns and arguments was defaulted correctly.
    THe QUERY-PROCEDURE was built by default.
    It is giving me an error though: wrong number or types of arguments in call to POPULATE_BLOCK..
    DECLARE
    bk_data HSM_WSH_DEL_UTIL.DEL_TBL;
    BEGIN
    hsm_wsh_del_util.do_query(bk_data);
    PLSQL_TABLE.POPULATE_BLOCK(bk_data, 'NEW_DELIVERIES');
    END;

  • Recommended best practice to fetch detail block based on procedure

    HI
    I am creating a detail block (Dept)based on procedure which will be populated from the value from master block 'Emp'.
    For example,
    Detail block 'Dept' will be populated by calling procedure populate_detail(:emp.empno in number,dept.deptno out number) .
    But what are the triggers I need to call to populate detail block and at which level?
    I was thinking to call a WHEN-MOUSE-DOUBLECLICK on master block 'Emp' level to populate the detail block 'Dept' by calling the procedure and passing emp.empno as the parameter whenever the user moves from one master record to another.
    Please advise.
    Thanks in advance.

    Download the forms 6i examples CD from the OTN website

  • Block based on procedure - trapping errors

    Hi,
    I have created a form with a block based on a procedure but when there is an error in the procedure it is not being trapped. I have raise_application_error in the execption but the form does not pick this up
    Can anyone help me on this. I am using Forms 5
    thanks, Monica

    It would be very difficutlt to send all the necessary pieces but there is a very good discussion of it in the "Advanced Forms and Reports" book from Oracle Press(Chapter 4).

  • Help with Data Block Based on Procedure--getting compilation error

    I am trying to create a datablock based on a procedure , but im getting errors in compilation:
    Errors are :
    1) identifier 'HSM_WSH_DEL_UTIL.DEL_TBL' must be declared
    2)PL/SQL ERROR 320 at line 7, column 27
    the declaration of the type of this expression is incomplete or malformed
    ANy Help would be appreciated !
    Heres my pkg spec and body for the data block:
    CREATE OR REPLACE PACKAGE hsm_wsh_del_util IS
    TYPE del_record is record
    (delivery_id number);
    TYPE del_tbl is table of del_record INDEX BY BINARY_INTEGER;
    procedure do_query(p_del IN OUT del_tbl);
    END hsm_wsh_del_util ;
    CREATE OR REPLACE PACKAGE BODY hsm_wsh_del_util IS
    procedure do_query(p_del IN OUT del_tbl)
    IS
    idx number :=1;
    CURSOR DELIVERY IS
    SELECT DELIVERY_ID
    FROM abc_deliveries;
    begin
    FOR CUR IN DELIVERY LOOP
    p_del(idx).delivery_id :=cur.delivery_id;
    idx:= idx+1;
    END LOOP;
    end do_query;
    END hsm_wsh_del_util;
    Edited by: 981170 on Mar 13, 2013 1:08 PM

    Hi,
    Yes I did use the wizard,
    I agve it the package.proc name for query.
    it pulled up the field delivery ID,
    Hit finish, because I do not need update/delete/inserts.
    the query data source columns and arguments was defaulted correctly.
    THe QUERY-PROCEDURE was built by default.
    It is giving me an error though: wrong number or types of arguments in call to POPULATE_BLOCK..
    DECLARE
    bk_data HSM_WSH_DEL_UTIL.DEL_TBL;
    BEGIN
    hsm_wsh_del_util.do_query(bk_data);
    PLSQL_TABLE.POPULATE_BLOCK(bk_data, 'NEW_DELIVERIES');
    END;

  • Block based on procedure

    I have a created a pacakage
    Pacakage specification
    TYPE ERROR_REC IS RECORD
    ( ID tbl.ID%TYPE,
    ORGL_STAMP tbl.ORGL_STAMP%TYPE,
    ORGL_USER tbl.ORGL_USER%TYPE,
    DEL_FLG tbl.DEL_FLG%TYPE,
    START_DT tbl.START_DT%TYPE,
    END_DT tbl.END_DT %TYPE);
    -- cursor variable to be used in do_query_cur procedure
    TYPE ERROR_ref IS REF CURSOR RETURN ERROR_rec;
    BODY
    PROCEDURE do_query_cur(ERROR_set IN OUT ERROR_ref,
    pid IN tbl.id%TYPE) IS
    BEGIN
    OPEN ERROR_set FOR
    SELECT ID,
                        ORGL_STAMP,
                        ORGL_USER,
                        DEL_FLG,                     
                        START_DT,
                        END_DT,
    FROM TBL
    WHERE id = p_id;
    END;
    END Ap_Comm_Error_Pkg1;
    I have based a block on the Ap_Comm_Error_Pkg1.do_query_cur. When I try to execute it from forms it
    returns 'error 40305 query caused no dtat to retrive. What could be the problem please help.
    Thx
    KK

    You pass pid argument, then you use p_id in your query.
    Francois

  • Error: FRM-40657, Block based on Procedure

    Hi,
    I have a detail block, its Qry Data Source is Procedure, and the DML is to a table,
    The data is loading from two table say A and B, but the DML is to table B only.
    The pblm is when editing the data from A(if the data loaded from the Table A satisfy certain condition then I have to store that data into Table B along with other data selected from table B, i am getting the error FRM - 40657.
    Thanks in advance

    Hi,
    You are running into the error because you are trying to change or delete a record when you have already 'locked' it by viewing it in your form.
    If you do need to do it this way, you will have to clear data from table B and then do the updates/inserts and then requery the data.
    Hope I've understood what you mean!
    L :-)

  • Display a message in status bar when error in a block based procedure

    Hi
    I have a block based on procedures.
    If I have an exception when I try to insert a record for example, how can I display a user friendly message in the status bar ?
    here is my insert procedure :
    PROCEDURE emp_insert2(t IN emptab) IS
      BEGIN
        FOR i IN t.first..t.last LOOP
        INSERT INTO emp (empno, ename, job, hiredate, sal)
        VALUES(t(i).empno, t(i).ename, t(i).job, t(i).hiredate, t(i).sal);
        END LOOP ;
      EXCEPTION
        When DUP_VAL_ON_INDEX then
            Raise_Application_Error( -20002, '^This identifier already exists^' ) ;
      END emp_insert2;When I use the ON-FORM trigger and ERROR_CODE and ERROR_TEXT variables, I get an FRM-XXXX message saying :
    40735--INSERT-PROCEDURE trigger raised unhandled exception ORA-00001.
    I want a message like :
    ORA-20002 This identifier already exists

    Hello,
    ORA-20500: ^This identifier already exists^ ORA-06512: à "SCOTT2.EMP_PKG", ligne 48
    I cannot figure out what is the problem described by the second part of the message.
    why numeric or value error in this case ? ( ligne 48 corresponds to the raise_applicaion_error instruction )There is no problem with the second part it is just for showing the line number it not the numeric or value error the code for numeric or value error is ORA-06502. See the below link for more information
    http://www.techonthenet.com/oracle/errors/ora06512.php
    So, now you can display your customized message in status bar using the error code which you defined in RAISE_APPLICATION_ERROR like below...
    DECLARE
         errcode VARCHAR2(50) := DBMS_ERROR_CODE;
         errtxt VARCHAR2(1000) := DBMS_ERROR_TEXT;
    BEGIN
         IF vErrCode='-20500' THEN
            MESSAGE('Here display your customized message.');
         ELSE
            -- Handle the rest errors...
         END IF;
    END; -Ammad

  • HELP!! Forms 5.0: Block based on database procedure

    I like to create block based on db procedure, but I cannot find
    how to do this on ORACLE documentation. Please help.
    null

    It's very interesting to know what is the such procedure ? Or
    may be this is not a procedure but functiion ? So what must this
    function return ?
    I didn't found out any hint about building block based on
    procedure
    Rashmi Rungta (guest) wrote:
    : Alexander Borisov (guest) wrote:
    : : I like to create block based on db procedure, but I cannot
    find
    : : how to do this on ORACLE documentation. Please help.
    : Hi,
    : Using the database wizard , select the second option. Then in
    the
    : next screen you will be prompted for the procedure name. Give
    the
    : respective db procedure name and then 'Refresh'. You will see
    the
    : data coming out of the procedure below. Then just proceed by
    : clicking on 'next' consecutively.
    : Hope this helps.
    : Rashmi
    null

  • Need to create a block based on view

    We can create a block based on procedure...but whats the need to do so...please can anybody explain.

    create the block with the data block wizard. Use your View as Data-Source.
    After that set all items to QUERY-ONLY, when they are not updateable. E.g. if you create a view from EMP to DEPT. Then it is not allowed to update DNAME. DNAME is set to QUERY-ONLY.

  • Query for records on a block with Query Data Source Type : Procedure

    Hi All,
    The veriosn of form I'm using is:
    Forms [32 Bit] Version 6.0.8.23.2
    I have a block based on a procedure.
    But when I enetr-query and search for records specific to ceratin criteria even then the result of the Query is all records.
    Is Query not allowed on a block with Query Data Source Type : Procedure.
    Hope my question is clear.
    Thanks in advance.
    Regards
    Arif

    When you use a table based block, forms can construct any select with any where clause based on the given inputs. Using a procedure based block, forms cannot "know" which in or out parameter of the procedure corresponds to which item. Even if Forms could pass the value of an item to an argument automagically, the procedure would have to "do something" with the argument, and you´d have to code it.
    So, any item that should be used in the where-clause must be mapped to an argument.
    Perhaps it would be easier to use a table based block querying a view? For DDL, you could use an instead-of-trigger on the view.
    Regards,
    Gerd

  • Block based on PL/SQL Procedure

    Hello,
    I have been thinking about building an architecture with
    database views to support block querying and stored procedures
    for DML. By doing this I keep the forms entirely seperated from
    the table model, which is good maintenance. Changes to the data
    model will affect the views and the stored procedures, not so
    much the forms. Another advantage is that block-fields that come
    from lookup-tables will be queryable and updateable without too
    much programming. And of course perfomance is good since all SQL
    is server-processed.
    Does anyone know where to look for documenation on basing a
    block on stored procedures ? The online help does not contain
    too much on this.
    Has anyone used this technique successfully and can tell me
    about a few advantages of it ? Disadvantages ?
    Regards
    /Stefan Nilsson, Sigma
    null

    Yes, I've tried that since Forms 5.0. I remember 3 possible
    sources for the block, FROM CLAUSE SUBQUERY, TRANSACTIONAL
    TRIGGERS , and PROCEDURES.
    Advantages,
    It is now easier to design screen with any functionality, like
    blocks where you are going to manipulate columns from different
    tables. Exactly what you have in mind when you mentioned about
    views.
    It also supports sources other than relational tables .like
    the object tables or even non-Oracle data sources.
    All you have to code are procedures to support the SELECT,
    LOCK, INSERT, DELETE, and UPDATE functions.
    Disadvantages,
    You have to code advanced PL/SQL procedures. Price to pay for
    excellent functionality.
    I can't exactly remember the documentation, but there is a
    book titlted Advanced Developers or domething...
    Stefan Nilsson (guest) wrote:
    : Hello,
    : I have been thinking about building an architecture with
    : database views to support block querying and stored procedures
    : for DML. By doing this I keep the forms entirely seperated from
    : the table model, which is good maintenance. Changes to the data
    : model will affect the views and the stored procedures, not so
    : much the forms. Another advantage is that block-fields that
    come
    : from lookup-tables will be queryable and updateable without too
    : much programming. And of course perfomance is good since all
    SQL
    : is server-processed.
    : Does anyone know where to look for documenation on basing a
    : block on stored procedures ? The online help does not contain
    : too much on this.
    : Has anyone used this technique successfully and can tell me
    : about a few advantages of it ? Disadvantages ?
    : Regards
    : /Stefan Nilsson, Sigma
    null

  • Data Blocks Based on Stored Procedures

    Is it possible to to create a data block based on a stored procedure, and create a dynamic list as a drop down box?
    I have a form that runs successfully that has a data block based on a stored procedure. I add my trigger to create and populate the record group. Then in the Property Palette, when I change ITEM TYPE from TEXT ITEM to LIST ITEM, I receive the following runtime error:
    FRM-40350: Query caused no records to be retrived.
    Note: the tlist/list item runs successfully on a data block based on a table.

    1) go to the block property to remove the same item column, then re-add the item; Since the property may remember the old text type;
    make sure the record value for the list tiem from stored procedure is among the list elements!
    Last sort is to do:
    2) you may re-create your gui based on the table by setting the list type this time, then set the block property to be based on the stored procedure.

Maybe you are looking for