Does the 'default where clause' query select the ROWID by default ?

Hi ,
The query in default where property of a data block is as follows:
global.prim_lang = :global.user_lang
and upper(group_name) like upper('%' || :B_apply_inclusions.TI_group_desc || '%')
UNION ALL
select g.rowid, g.group_no
from table1 t,
table 2 g
where :global.prim_lang != :global.user_lang
and upper(g.group_name) = t.key(+)
and :global.user_lang = t.lang(+)
and upper(nvl(t.translated_value, g.group_name)) like upper('%' || :B_apply_inclusions.TI_group_desc || '%')
The g.rowid was added in the UNIONALL portion of the query because the first part of the query was bringing rowid as well.
We are in 10.1.2.3.0 forms version.
However for a user in forms verion 10.1.2.0.2, the query is giving an error " Unable to perform query " - due to mismatch in the number of columns selected in the query union.
because for this user, rowid is not selected as part of default where clause query( 1st part of the query before the unionalll).
If g.rowid is removed from the 2nd part of the query , it errors out in 10.1.2.3.0 forms version.
Could you kindly clarify when this rowid will also be selected by the default where clause of a block and why this issue is occuring?Is this issue related to forms version or any other property of the block? Is it is version based, is there a patch available to deal with the same?
Thanks in Advance.

You normally change the default_where block property just when you want to chnage the filter conditions for what is selected from a given block data source.
Querries with union or minus will confuse forms as to the rowid and will no longer be albe to perform the default insert/update/delete, not knowing the rowid and the table to perform the dml on.
A from clause query will be the best way to change dynamically the tables you select from and also the where. But, by using that, if you wish to insert/update/delete, you will have to use on-insert/update/delete triggers where the processing will have to rely on some primary key columns and not on rowid.
Or, instead of a from-clause, you may use a view, but that will definitely be less flexible than a from clause query.

Similar Messages

  • TS3376 How do I find the menue where I can select the list of previous phones I have had and my new one ? at the moment it is still set to an old one so everytime I try to set it up it tells me it it's the wrong one - gggrrrrr help please

    How do I find the menue where I can select the list of previous phones I have had and my new one ? at the moment it is still set to an old one so everytime I try to set it up it tells me it it's the wrong one - gggrrrrr help please

    iPods (except for iPod touch) are not linked to any iTunes "account."  They are associated with your iTunes library. The account in iTunes is your Apple ID, and that is used to buy and download content from the iTunes Store.  It is not required to use an iPod.
    The 1st (and 2nd) gen shuffle can only be used with one iTunes library at a time.  When you connect it, iTunes should prompt you to start using it with your iTunes library, and warn that the shuffle's existing content will be erased.  Have iTunes erase the shuffle, and it will be associated with your iTunes library going forward.  You can then add content to your shuffle.
    The need for the previous owner's Apple ID and password should only come up if you are trying to transfer existing content from the shuffle to your iTunes library, AND the previous owner had content purchased from the iTunes Store.  Just cancel out of that step, if iTunes asks.

  • Firefox fails to import history, cookies, favourites etc. from opera; cookies etc. are not listed in the space where you can select the items you want to import any idea how this comes? thanks!

    In the importing operation Firefox detects Internet Explorer and Opera as installed browsers. When i select Internet Explorer cookies, history, favourites etc. are listed in a box where you can select the items you want to import in Firefox. When i select Opera no items are listed that can be imported. Any idea how this comes?

    Hi,
    I think that what you are searching be in Tools >> Options >> Privacy >> On Firefox will: change to "Use custom settings for history" then Button Show Cookies will be allowed and you will see the cookies in your browser in the next window
    If you uncheck "Accept cookies from sites", probably the sites that need cookies will alert you that you need active the storage cookies

  • Regarding  dynamically assigning the where clause to select query

    hi,
      Please send the code regarding how to dynamically assign the where clause to select query.
    thanks in advance

    SELECT <fileds>
            INTO TABLE itab
            FROM dbase
            WHERE  condition.

  • Can I use SYSDATE in the WHERE clause to limit the date range of a query

    Hi,
    Basicaly the subject title(Can I use SYSDATE in the WHERE clause to limit the date range of a query) is my question.
    Is this possible and if it is how can I use it. Do I need to join the table to DUAL?
    Thanks in advance.
    Stelios

    As previous poster said, no data is null value, no value. If you want something, you have nvl function to replace null value by an other more significative value in your query.<br>
    <br>
    Nicolas.

  • Dynamic where clause in select query

    Hi
    I'm trying for a dynamic query and in the dynamic where clause i'm checking a field for constant.....for instance if i wanna to use WERKS EQ '0478' how to declare it in dync where clause. i tried for the following:
    SELECT  (TAB_FIELD) INTO TABLE DITAB UP TO 10 ROWS FROM (TAB_NAME) WHERE (CONDI).
    heree CONDI = 'werks eq 0287'   . in this case the query fails as the werks shud be equal to '0287' and not just 0287. How to handle this? i tried for the following
    CONDI = 'werks eq " '0287' " ' but no luck as it is not a valid stmt as i knew.

    hi prabhu,
    this is how u select dynamically...
    DATA: COND(72) TYPE C,
    ITAB LIKE TABLE OF COND.
    PARAMETERS: CITY1(10) TYPE C, CITY2(10) TYPE C.
    DATA WA TYPE SPFLI-CITYFROM.
    CONCATENATE 'CITYFROM = ''' CITY1 '''' INTO COND.
    APPEND COND TO ITAB.
    CONCATENATE 'OR CITYFROM = ''' CITY2 '''' INTO COND.
    APPEND COND TO ITAB.
    CONCATENATE 'OR CITYFROM = ''' 'BERLIN' '''' INTO COND.
    APPEND COND TO ITAB.
    LOOP AT ITAB INTO COND.
    WRITE COND.
    ENDLOOP.
    SKIP.
    SELECT CITYFROM
    INTO WA
    FROM SPFLI
    WHERE (ITAB).
    WRITE / WA.
    ENDSELECT.
    regards,
    sohi

  • Using a dummy where-clause to force the use of an index

    I notice that an index only gets used when I use the index key in the where clause. Should I use a dummy where clause to force the index to be used?
    SQL> create table emp (
    2 empno NUMBER(5),
    3 empname VARCHAR2(15) );
    Table created.
    SQL> create index idx_emp_no on emp (empno);
    Index created.
    SQL> insert into emp (empno, empname) values (1, 'Peter');
    1 row created.
    SQL> set autotrace traceonly;
    SQL> select empno from emp;
    Execution Plan
    Plan hash value: 3956160932
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 13 | 3 (0)| 00:00:01 |
    | 1 | TABLE ACCESS FULL| EMP | 1 | 13 | 3 (0)| 00:00:01 |
    SQL> select empno from emp where empno > 0;
    Execution Plan
    Plan hash value: 434430053
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 13 | 1 (0)| 00:00:01 |
    |* 1 | INDEX RANGE SCAN| IDX_EMP_NO | 1 | 13 | 1 (0)| 00:00:01 |
    As you can see, using a dummy where clause (empno > 0), I manage to reduce the cost from 3 to 1.

    Again. Be careful with comparisons. But I like the discussion. It is usefull to carefully look at what happens "behind the scenes" and find a sensible explaination for that.
    Your new scenario now is different. By selecting one specific row instead of selection all you already made an assumption. That only one or few of the rows are returned. Andre's statement still is correct. Now the CBO will prefere the index scan.
    The CBO now has to decide between two options.
    Option a) use the index.
    This means =>
    Step 1: Access the index to find the value
    Step 2: Access the table using the rowid that was found in the index leaf entry.
    Option b) scan the full table
    This means =>
    Step 1: Iterate over all rows of the table
    Step 2: Apply a filter condition (empno = :x)
    We can see this execution plan by adding a hint to the query.
    select /*+ FULL(emp) */ * from emp where empno = 1;This hint will force the CBO to access the table emp using a full table scan.
    The cost in my environment for option B is 3.
    Option A has a cost with 2. Therefore the CBO prefers Option A.
    However this can easily change.
    Consider the following
    begin
      for i in 1..1000 loop
        insert into emp (empno, empname) values (1, 'Employee');
      end loop;
    end;
    commit;
    execute dbms_stats.gather_table_stats(user,'EMP');The run the select again.
    SQL> set autotrace traceonly
    SQL> select * from emp where empno = 1;
    1001 Zeilen ausgewõhlt.
    Ausf³hrungsplan
    Plan hash value: 3956160932
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |  1001 | 12012 |     3   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| EMP  |  1001 | 12012 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("EMPNO"=1)
    Statistiken
              1  recursive calls
              0  db block gets
             74  consistent gets
              0  physical reads
              0  redo size
          18356  bytes sent via SQL*Net to client
           1250  bytes received via SQL*Net from client
             68  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
           1001  rows processedThe CBO now prefers the full table scan and not the index access.
    If we force it to use an index then the cost increases.
    SQL> set linesize 100
    SQL> select /*+INDEX(emp) */ * from emp where empno = 1
    1001 Zeilen ausgewõhlt.
    Ausf³hrungsplan
    Plan hash value: 2426388914
    | Id  | Operation                   | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |           |  1001 | 12012 |     5   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP       |  1001 | 12012 |     5   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | IDX_EMPNO |  1001 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("EMPNO"=1)
    Statistiken
              0  recursive calls
              0  db block gets
            139  consistent gets
              0  physical reads
              0  redo size
          30550  bytes sent via SQL*Net to client
           1250  bytes received via SQL*Net from client
             67  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
           1001  rows processed
    SQL>The cost using the index range scan is now 5. WHile the FTS is still 3. Therefore the CBO prefers to use the FTS.

  • I am doing a book.  Can I select the option of 13 photos on a page, put only one photo on the page in the middle box and expect the page to be printed with only that picture surrounded by white?

    I am doing a book.  Can I select the option of 13 photos on a page, put only one photo in the middle box and expect the rest of the page to be printed with only white aroind that photo in the middle?

    No
    All photos frames must contain photos or you can not order the book
    LN

  • Does anyoneone know where I can get the dmg 10.4.3 combo

    Does anyoneone know where I can get the dmg 10.4.3 combo I tried downloading it from Apple site but the link brought me to latest updates instead Thanks

    Posted to the wrong person...
    What version of 10.4 are you on now?
    At first I was thinking the Deltas... 10.4.1, 10.4.2, 10.4.3, but it looks like Apple pulled them all!
    Maybe if you expose/show your email in your profile, somebody could give you a clue.
    Will 10.4.2 Combo work?
    EDIT: Just saw this...
    https://discussions.apple.com/message/15544770#15544770

  • Does anyone know where I can get the newsletter templates?

    Does anyone know where I can get the newsletter templates?

    Aside from the ones provided in email marketing setup process, a simple search search online should give you many more- including responsive ones.
    Here's one of my favorite sources: https://github.com/mailchimp/Email-Blueprints

  • Where should i select the single catridge mode

    where should i select the single catridge mode

    Hi bharathipl, welcome to the HP Forums. What is the model or product number? What version of Windows is installed?
    Guide to finding your product number
    Which Windows operating system am I running?
    TwoPointOh
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom to say “Thanks” for helping!

  • Does anyone know where I can download the IPlanet App Server 6.0 SP3 to get rid of this f... SP2 installation night mare on win  NT

    Does anyone know where I can download the IPlanet Application Server 6.0 SP3 to get rid of this f... SP2 installation night mare on win NT

    Hi,
    You an download the iAS6.5 from http://wwws.sun.com/software/download/download/
    There is no place where you can download the SP3. Anyway 6.5 has more advance features. Anyway SP2 works fine with win NT. If you have any specific problem with installation, you can point them out. I would suggest you to use 6.5 instead.
    Thanks
    parsu

  • I have a Windows Server 2008 R2 system. I am using Adobe Acrobat XI Pro. I am looking for the place where I can change the default font from Minion Pro to Calibri? Tools, Content Editing, Formatting

    I have a Windows Server 2008 R2 system. I am using Adobe Acrobat XI Pro. I am looking for the place where I can Change the Default font from Miinion Pro to Calibri?
    Tools, Content Editing, Formatting

    You can't change it.
    On Tue, Jan 13, 2015 at 11:22 AM, tonywaidmann <[email protected]>

  • Dynamic WHERE clause in SELECT statement

    Hi,
    I need to extract (SELECT) all the products in different salesorganizations. Since a product can be available in more than 1 salesorg I have created several properties in the PRODUCT dimension - 1 for each salesorganization (naming: Sxxxx where xxxx is the salesorganization number).
    Since I need to prefix the salesorganization property with an "S" I have created a property on the SALESORG dimension called SALESORG.
    Therefore I need to create a dynamic WHERE clause in the SELECT statement. Currently my script is:
    *SELECT(%SORG%, "[SALESORG]",SALESORG, [ID]=%SALESORG_SET%)
    *SELECT(%PROD%, "[ID]",PRODUCT, [%SORG%]="X")
    My first SELECT find the Sxxx (equal to the property I need in the PRODUCT dimension). My second SELECT uses the variable in the first SELCT statement to use the correct property for the WHERE clause.
    Unfortunately the code is not validated - any suggestions?
    /Lars

    Hi Lars,
    If you run it from a DM package without validating it, does it still work? I would bet it does.
    If this is the case I would open a message with SAP (it would be an enhancement request). Until they fix the validation code, you would just have to live with the script not validating.
    Cheers,
    Ethan

  • Trying to use :system.last_query in conjuction with a Default Where Clause

    Hi guys,
    Greetings from Toronto. Been trying all possible ways to solve this situation but I might have hit a brick wall. Any help would be appreciated.
    Here is the situation in hand. I can after an Execute_Query find out what the SQL statement was by doing this :
    declare
    t_temp_last_query varchar2(10000);
    t_temp_index number;
    t_temp_where varchar2(2000) := null;
    begin
    t_temp_last_query := name_in('system.last_query');
    t_temp_index := INSTR(t_temp_last_query,'WHERE');
    if t_temp_index > 0 then
    t_temp_where := substr(t_temp_last_query, t_temp_index + 6);
    end if;
    set_block_property(t_block_name, DEFAULT_WHERE, t_temp_where );
    end;
    Now, this is working well, when I do a search based on a Number field ( eg : Membership Number ). However, when I print the :system.last_query for a search based on a Partial Name like 'Smith%', I get something completely different and my query is bombing.
    Any thoughts ?
    Thanks a bunch !

    I'm not exactly sure what you are trying to do because the last query should stay there unless you set it to something else implicitly. It looks to me like you are executing a query, then trying to reset it to the same where clause. Maybe I'm missing it. Maybe you are trying to update a different block with that same query?
    I don't know why it would be working with number, but not with varchar because it looks to me like it shouldn't be working for either.
    In the t_temp_index := INSTR(t_temp_last_query,'WHERE'); it looks like t_temp_index should be 1 because that would be where the WHERE is positioned. It would pass the if logic and the t_temp_where variable would be set to the substr of the first 7 characters (1 + 6), which means the t_temp_where would equal 'WHERE n';
    For example, lets say the actual where clause was "WHERE last_name like 'Smith%'" and apply it to the SQL:
    declare
    t_temp_last_query varchar2(10000);
    t_temp_index number;
    t_temp_where varchar2(2000) := null;
    begin
    t_temp_last_query := name_in('system.last_query'); // t_temp_last_query := WHERE last_name like 'Smith%'
    t_temp_index := INSTR(t_temp_last_query,'WHERE'); // t_temp_index := 1
    if t_temp_index > 0 then // passes
    t_temp_where := substr(t_temp_last_query, t_temp_index + 6); // t_temp_where := WHERE l
    end if;
    set_block_property(t_block_name, DEFAULT_WHERE, t_temp_where ); // should let you set if, but execute_query should fail
    end;
    I hope this helps. If I am misunderstanding something please let me know.

Maybe you are looking for