Query Data Block issues

We have a legacy Forms and Reports application(~750 items combined). I suspect the applications were developed initially under 6i, but they work quite well under 10GR2, and is testing well under 11GR2 (which we plan on migrating to soon). We ran into an issue the other day for Data Query Blocks, and wanted your expert opinion on it.
Due to a change in business requirements, we recently had to increase the length of a database field (from 20 to 30). We went into Forms Developer, made the appropriate changes, and recompiled them all successfully. Everything *seems* to work fine, but we noticed we get failures on any item that tries to utilize that extra 10 characters. Apparently this is because the Query Data Block seems to use a cached/stale copy of the database field sizes, and still expects a size of 20! What we realized now is that we have to go into each of those forms, and REFRESH the Data Block (through the Data Block Wizard) for every one of them.
My question is this: is there anyway to force the Form to refresh those Query Data Blocks absent going into each one and REFRESHING it? We've tried compiling through Forms Developer, and through Batch Compiles, and nothing seems to get those cached copies to update. I'd really prefer to tackle this issue once and for all since we are prepping for migration testing.  Frankly I suspect the table space was tweaked a good bit over the years since development (before I ever got here), and if they didn't REFRESH those Data Blocks properly, a great many of the Forms will be suffering this same cached/stale view problem.
Appreciate your thoughts,
Dave

Q_Stephenson,
That's an excellent suggestion.  I have seen vague hints and allegations of Forms manipulation using that method, but never felt comfortable with my overall knowledge(*) of Forms to look at it that deep.  I think it's time to clear some space and dig into the topic for a better look.
Thank you,
Dave
(*) The majority of my programming background is in Java; it's only been recently that I've had to really dig deep into Forms.

Similar Messages

  • SET_BLOCK_PROPERTY('QUERY_DATA_SOURCE_NAME') with FROM clause query data block

    Two block :
    - Block A based on table
    - Block B based on FROM clause query
    In WHEN-NEW-RECORD-INSTANCE of block A, I perform a SET_BLOCK_PROPERTY('BLOCK_B','QUERY_DATA_SOURCE_NAME','(...)'); and then query block B (... depends on value taken by 'code' column in block A).
    At runtime it works till 'code' does not change (query_data_source_name does not change) but when I navigate to a record having a different 'code', it got the folowing message :
    41380 - Cannot set the blocks query data source.
    Any idea or suggestion ?

    Hello all i m trying dynamically change query_data_source_name but its not working.
    i did the followings
    Forms(10g2) block level:Query_data_source_type
    Query_data_source_name:SELECT 1,2,3,4,5 FROM dual;
    in control Block:
    when_button_press my code is
    GO_BLOCK('blk_query');
    Clear_Block(No_Validate);
    set_block_property('blk_query',query_data_source_name,
    'SELECT col1,col2,col3,col4,col5 FROM mytable');
    execute_query;
    same result:unable to query error.
    any one can help me regarding this issue.

  • Query data block

    I am trying to execute a query based on a data block.
    The data block name is B_STR and it has a item (checkbox) named CB_SELECT
    When I run this code, it returns an exception saying that it is an invalid table name.
    Is it possible to execute a query based on a data block? Any sugestions? ;)
    Thanks in advance!
    connection_id := exec_sql.default_connection;
    bisconnected := exec_sql.is_connected;
    IF bisconnected = FALSE THEN
    emessage('No primary connection. Please connect before retrying.');
    RAISE no_connection;
    END IF;
    cursorid := exec_sql.open_cursor(connection_id);
    sqlstr := '';
    sqlstr := select * from xpto where store in (select store from :B_STR where :B_STR.CB_SELECT = 1 )';
    exec_sql.parse(connection_id, cursorid, sqlstr);
    exec_sql.define_column(connection_id, cursorid, 1, myvarchar, 1000);
    nign := exec_sql.EXECUTE(connection_id, cursorid);
    LOOP
    IF (exec_sql.fetch_rows(cursorid) > 0) THEN
    exec_sql.column_value(connection_id, cursorid, 1, myvarchar);
    emessage(myvarchar);
    ELSE
    emessage('no more results');
    EXIT;
    END IF;
    END LOOP;
    exec_sql.close_cursor(connection_id, cursorid);
    exec_sql.close_connection(connection_id);

    What is the requirement?
    If your datablco is a multirecord and you need to evaluate record by record to do something depends on, it is better if you go to that block, use the first_record; to put the current record in the first one and evaluate all of them.
    Abdel Miranda
    Panama

  • How to query two data blocks simultaneously?

    Dear all,
    Need your inputs on the following problem statement...
    Existing Functionality:
    We have two data blocks A (Parent) and B (Child) in a relationship. Both data blocks refer to different tables.
    Data block A is the query data block and for a single record in block A we can have multiple records in block B. Multiple records in block B are shown one at a time after executing a query, this is implemented by using a list item C (belongs to a third block).
    For example
    Let us say block B can have 5 different types of entries for each record in block A. In this case the list item C will have 5 values corresponding to these entries. Once the query is executed, block B will show the default entry for the queried record in block A. To see other entries for the record user can select the required value in list item C and corresponding entry in block B will be fetched.
    Requirement:
    Our requirement now is to enable querying upon both data blocks A and B simultaneously. To implement this I replaced data blocks A and B with a single data block X which is based on the join of the two tables referred by the Data blocks A and B earlier. As the fields should allow insert, update, delete operations we did not use a view here.
    Issue:
    Now the problem is, each record in block A for which block B had multiple entries earlier is now getting listed multiple times because of the join.
    I have tried but could not find any solution for this. I would appreciate if any of you can suggest how we can query both blocks simultaneously without affecting the existing functionality.
    Thanks,
    Amit

    I don't understand your requirement in detail. I try to repeat what i understood so far.
    You have a master-block A based on a table A and a detail-block B based on a table B. So far so good. You can now query based on conditions just the datablock A, because B is a detail and therefore can only be queryied in context of block A.
    Your reuirement is to query on both blocks A and B and find block in B also without giving conditions for the relevant block A.
    Is it that ?
    What i don't understand, what is block C used for?
    An idea for the querying of block B's data: Create Non-database-items items in block A for the search-criteria you need on block B and make them Queryable.
    In the PRE-QUERY-trigger on block A build a WHERE-condition if that search-criteria is entered, something like
    IF :BLOCK_A.SEARCH_CRITERIA_FOR_BLOCK_B IS NOT NULL THEN
      SET_BLOCK_PROPERTY('BLOCK_A', ONETIME_WHERE, 'WHERE PKVALUE IN (SELECT FKVALUE_TO_A FROM TABLE_B WHERE FIELDVALUE=' ||:BLOCK_A.SEARCH_CRITERIA_FOR_BLOCK_B)');
    END IF;This would query also records to A for which you want to have the B-records. So you could keep block-structure up to master-detail.

  • 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

  • Oracle Forms - How can I create a Data Block with query

    Dear friends I have a question, I couldn't do this..
    I have a sql query, I want to show the datas of the query.. How can I do this. ?
    Data Block Wizard wants a table, view or stored procedure, but I have a query, how can I create a data block with my query.. I m waiting your helps..? Please...
    Semih

    Hi,
    You have two options
    1. create a view and base the block on the view
    2. create a block with a query Data Source Type of 'FROM clause query'
    Hope this helps
    Neil

  • Forms clause query data source data block in oracle forms

    Hello experts,
                  I am new in oracle forms.I am using oracle forms 11g with weblogic 10.3.5 at windows 7.Through googaling I know how to create a database block,forms clause data block and stored procedure based datablock in oracle forms.I want to know that as in case of  Database based datablock, could we commit form either on editing records or on insertion or deletion in data block.
    I tried this but got error frm 40501.If we can perform editing and creation in such type of datablock then please tell me how.
    Thank You,
    regards
    aaditya

    When I base my datablock on a query using the "From Clause" property of the block query data source in the oracle Forms 6i,
    I get the strange error
    "ORA-00928: missing SELECT keyword"
    The query I see in the Display Error in Help Menu is
    SELECT DAY_NUMBER,CONSULTANT_ID,EVENT_ID,EVENT_NUMBER,SESSION_NUMBER,HOURS_UNPAID,HOURS_PAID,PAPERWORK FROM (EVENT_ASSIGNED_CONSULTANT) WHERE (CONSULTANT_ID=:1)
    What should I do now?????? Please remove the brackets () from the table name.
    Instead of (EVENT_ASSIGNED_CONSULTANT) use
    EVENT_ASSIGNED_CONSULTANT

  • Query Execution/Elapsed Time and Oracle Data Blocks

    Hi,
    I have created 3 tables with one column only. As an example Table 1 below:
    SQL> create table T1 ( x char(2000));
    So 3 tables are created in this way i.e. T1,T2 and T3.
    T1 = in the default database tablespace of 8k (11g v11.1.0.6.0 - Production) (O.S=Windows).
    T2 = I created in a Tablespace with Blocksize 16k.
    T3 = I created in a Tablespace with Blocksize 4k. In the same Instance.
    Each table has approx. 500 rows (So, table sizes are same in all the cases to test Query execution time ). As these 3 tables are created under different data block sizes so the ALLOCATED no. of data blocks are different in all cases.
    T1  =   8k  = 256 Blocks =  00:00:04.76 (query execution time/elapsed time)
    T2  = 16k=121 Blocks =  00:00:04.64
    T3 =   4k =  490 Blocks =  00:00:04.91
    Table Access is FULL i.e. I have used select * from table_name; in all 3 cases. No Index nothing.
    My Question is why query execution time is nearly the same in all 3 cases because Oracle has to read all the data blocks in each case to fetch the records and there is a much difference in the allocated no. of blocks ???
    In 4k block size example, Oracle has to read just 121 blocks and it's taking nearly the same time as it's taking to read 490 blocks???
    This is just 1 example of different data blocks. I have around 40 tables in each block size tablespace and the result are nearly the same. It's very strange for me because there is a much difference in the no. of allocated blocks but execution time is almost the same, only difference in milliseconds.
    I'll highly appreciate the expert opinions.
    Bundle of thanks in advance.
    Best Regards,

    Hi Chris,
    No I'm not using separate databases, it's 8k database with non-standard blocksizes of 16k and 4k.
    Actually I wanted to test the Elapsed time of these 3 tables, so for that I tried to create the same size
    tables.
    And how I equalize these is like I have created one column table with char(2000).
    555 MB is the figure I wanted to use for these 3 tables ( no special figure, just to make it bigger than the
    RAM used for my db at the db startup to be sure of not retrieving the records from cache).
    so row size with overhead is 2006 * 290,000 rows = 581740000(bytes) / 1024 = 568105KB / 1024 = 555MB.
    Through this math calculation I thought It will be the total table size. So I Created the same no. of rows in 3 blocksizes.
    If it's wrong then what a mes because I was calculating tables sizes in the same way from the last few months.
    Can you please explain a little how you found out the tables sizes in different block sizes.Though I understood how you
    calculated size in MB from these 3 block sizes
    T8K =97177 BLOCKS=759MB *( 97177*8 = 777416KB / 1024 = 759MB )*
    T16K=41639 BLOCKS=650MB
    BT4K=293656 BLOCKS=1147MB
    For me it's new to calculate the size of a table. Can you please tell me then how many rows I can create in each of
    these 3 tables to make them equal in MB to test for elapsed time.
    Then I'll again run my test and put the results here. Because If I've wrongly calculated table sizes then there is no need to talk about elapsed time. First I must equalize the table sizes properly.
    SQL> select sum(bytes)/1024/1024 "Size in MB" from dba_segments> 2 where segment_name = 'T16K';
    Size in MB
    655
    Is above SQL is correct to calculate the size or is it the correct alternative way to your method of calculating the size??
    I created the same table again with everything same and the result is :
    SQL> select num_rows,blocks from user_tables where table_name = 'T16K';NUM_ROWS BLOCKS
    290000 41703
    64 more blocks are allocated this time so may be that's y it's showing total size of 655 instead of 650.
    Thanks alot for your help.
    Best Regards,
    KAm
    Edited by: kam555 on Nov 20, 2009 5:57 PM

  • Query from multiple data blocks

    Hello professionals,
    I having difficulty in finding solutions to query data from multiple data blocks. By the way I'm using Oracle Forms 10g
    I have 4 data blocks and all items are database items
    Below are the blocks,
    1. student_main (columns : student_id, student_name, student_state)
    2. subject_main (columns : subject_id, subject_desc, subject_student_id)
    3. invoice_main (columns : invoice_no, invoice_amt, invoice_student_id)
    4. receipt_main (columns : receipt_no, receipt_amt, receipt_invoice_ref)
    The form will need to allow user to be able to query from any of the items/fields from the data blocks as listed above
    For eg,
    : if user query student_id then all related value items from table subject_main, invoice_main, receipt_main need to be displayed
    : if user query invoice_no then all related value items from table student_main, subject_main, receipt_main need to be displayed
    However the tricky part is that some student might have or might not have invoice / receipt data
    I tried using relations but it didn't work both ways
    I even create relations in every table (student_main to subject_main, subject_main to student_main, invoice_main to student_main, student_main to invoice_main and etc.) but it just make my running process hang
    Need help on this matter
    Thank you
    Edited by: 990092 on Feb 25, 2013 12:15 AM

    990092 wrote:
    Hello professionals,
    I having difficulty in finding solutions to query data from multiple data blocks. By the way I'm using Oracle Forms 10g
    I have 4 data blocks and all items are database items
    Below are the blocks,
    1. student_main (columns : student_id, student_name, student_state)
    2. subject_main (columns : subject_id, subject_desc, subject_student_id)
    3. invoice_main (columns : invoice_no, invoice_amt, invoice_student_id)
    4. receipt_main (columns : receipt_no, receipt_amt, receipt_invoice_ref)
    The form will need to allow user to be able to query from any of the items/fields from the data blocks as listed above
    For eg,
    : if user query student_id then all related value items from table subject_main, invoice_main, receipt_main need to be displayed
    : if user query invoice_no then all related value items from table student_main, subject_main, receipt_main need to be displayed
    However the tricky part is that some student might have or might not have invoice / receipt data
    I tried using relations but it didn't work both ways
    I even create relations in every table (student_main to subject_main, subject_main to student_main, invoice_main to student_main, student_main to invoice_main and etc.) but it just make my running process hang
    In general, relation will work. your relation creating was wrong, i think.
    do as
    1. student_main master to subject_main details
    2. student_main master to invoice_main details
    3. invoice_main master to receipt_main details
    Hope this helps
    Hamid

  • Frm-41380 error - cannot set the blocks query data source

    Fairly new forms so bare with me. I am creating a form based on one table. This table has one column that is a nested table.
    table name: szrtime
    table columns: szrtime_code, szrtime_styp_list
    szrtime_styp_list is a table of varchar2(1).
    main block is szvtime_block
    the block that contains the nested table is szvtime_styp_block
    I read that I could use a WHEN_NEW_RECORD_INSTANCE trigger on the main block to display the related nested table. I have tried the folllowing:
    Declare
    select_stmt Varchar2(512) ;
    Begin
    If :szvtime_block.szvtime_code Is not null Then
         select_stmt := '(SELECT column_value FROM TABLE ( SELECT szrtime_styp_list FROM szrtime WHERE szrtime_code = ''' || :SZVTIME_BLOCK.SZVTIME_CODE || '''))';
         Go_Block('SZVTIME_STYP_BLOCK' );
         Clear_Block ;
         message('select_stmt = '||select_stmt);
    Set_Block_Property( 'SZVTIME_STYP_BLOCK', QUERY_DATA_SOURCE_NAME, select_stmt ) ;
    Execute_Query ;
    Go_Block('SZVTIME_BLOCK') ;
    Else
    Go_Block('SZVTIME_STYP_BLOCK' );
    Clear_Block ;
    Go_Block('SZVTIME_BLOCK') ;
    End if ;
    End ;
    The result is the frm-41380 error.
    I have tried change the query data source type on the nested table block to Table or From-clause but did not help. The select statement that is valid and returns the correct result in Toad.
    Any suggestions on what to look for? Thank you.
    Todd

    > But what is giving me pause is that the user will be updating, deleting, and inserting
    into this table and, of course, the nested table column.
    It would give me pause, too. I've never used nested tables, so I poked around in Forms on-line help. In Forms 6i, it specifically states that Forms does not support the Nested Table structure.
    In Forms 10g help, it describes Nested Table structures, but says NOTHING about how a form would handle it. And that implies to me that it is still not supported. So good luck.
    In addition to creating the view, you may need to provide your own nested table updating procedures via a package on the server which your form can call. I know Forms supports passing pl/sql tables ("indexed by binary_integer"), so you could pass your nested table back and forth between the package and the form in that format.

  • Block Property (Query Data Source Type)

    Hello Friends
    I am using Forms 6i.oracle 9i.
    in the Block Property Pallete under Query Data Source Type there
    are 4 Type is mentioned.i have used Table,From Clause Query but yet to use Transactional Trigger and Procedure.How to use this two and it will be very kind enough if u give any example about these twos.
    Regards

    There's a whole bunch of explanation about this subject in the online help of Forms. Just select the Query Data Source Type property and press F1. The initial explanation is very limited but there are a number of useful links under "Related topics"

  • 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

  • Help: How to call a user defined function in a data block query?

    I created a string aggregation function in the program unit, see reference:
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
    I now like to call the function in my data block query. I got the error: ORA-00904: 'concatenate_list' invalid identifier.
    Please help.
    Thank you in advance.
    Jimmy

    Hi,
    You can write UDFs in java in Graphical mapping to enhance your XI Graphical mapping functionality
    The steps for doing it would be:
    1. Click on Create New function Button found on Bottom left corner on your XI Mapping window.
    2. Write your java code.
    3. Run the Mapping Test as usual.
    >>The module that is given here ...where and how it is used.
    The adapters in the Adapter Framework convert XI messages to the protocols of connected external systems and the other way around. When doing so, some
    functionality might need to be added specific to a situation which is possible with the use of custom modules.
    Typical example would be validation of file content when using a File Adapter or modification of the message payload to a common content structure which is not supported by any of the standard SAP modules.
    An Adapter module is developed as an Enterprise Java Bean and is called locally by the Adapter.
    An example on modules :
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/da5675d1-0301-0010-9584-f6cb18c04805">How to develop a module for reading file name in a sender file adapter XI 3.0</a>
    Cheers,
    Chandra

  • Query in data block

    hi,
    whether it's possible to write query in data block other than trigger.(i.e,.. data block created by the Wizard and executing a simple query over the data block based on a table)
    regards
    Yesukannan

    if i am right about u question , you can change your datablock sorce prooperty to QUERY and in soruce wirte ur query
    Block Property
    Database source- Query
    source table name:- write u query

  • Data Blocks - Different data source for Query  and DML

    Would anyone please tell me if it is possible in a BLOCK to define a stored procedure for queriying and a table for DML operations or vice-versa at the SAME time.
    If possible how do you do it using DATA BLOCK WIZARD? If you select your block to be based on stored procedure then it gives only stored procedure options for Querying and DML operations in next few screens.
    Also, suppose I used a stored procedure defined in a block for insert operations, is it implicitly called by INSERT RECORD function key in default menu? How does it take values from different fields on its own?

    Hi Deepon,
    We get data from both BSIK(open items)and BSAK (cleared items). Obviously if a accounting doc is not cleared it would be in open items and vice versa..
    Go through the help link for more information..
    http://help.sap.com/saphelp_bw33/helpdata/en/90/10e73a86e99c77e10000000a114084/frameset.htm
    Regards
    Manga(Assign points if it helps)
    Message was edited by: Manga

Maybe you are looking for

  • One OCS for multiple Company´s ???

    Hello, It´s possible to install multiple "areas" on one OCS? We want to provide a OCS for our customers. They shouldn´t see other caledars or adress-book. Only ther own "area". KR Mathias

  • Adobe Acrobat no longer works on my Apple 10.5.8 after upgrading latest patch?

    After my Apple 10.5.8 OS automatically downloaded the latest Adobe Acrobat the other day, (after I ok'd it), it no longer works at all, can't open any pdf's at all. It says the following: The currently selected language resources are not supported by

  • Best praxis for determining a  cost center for an HR org unit in PPM ?

    Hello all. We have defined the HR Org structure directly in PPM backend. Later the intention is that an interface should transfer this data from HR. The HR orgstructure defined works fine for the staffing process (with "resource manager via responsib

  • Portal time out with large jdbc query in JSP bean

    Hi, My JSP portlet always times out while waiting to complete two large JDBC queries. The error shown in my jserv.log file is: [28/03/2002 12:41:51:221 GMT+08:00] page/Fetching timed out for an Unknown Reason. Killing fetcher name=content-fetcher2 la

  • Interactive document exported as swf navigation problems

    I created an interactive document, exported as a swf file. Each page has an animation build, text fade in, images slide in etc. When I navigate to the next page, it displays the completed build, reloads and plays the animated build. When I navigate t