Issue with dynamically setting where clause in OAF

Hi All,
I have a View object having the query below:
SELECT  rownum LINENUM,
        B.line_id LINE_ID,
        B.INVENTORY_ITEM_ID INVITMID ,
        B.QUANTITY_DELIVERED PICKQTY         
from   MTL_TXN_REQUEST_HEADERS A,
        MTL_TXN_REQUEST_LINES  B
  WHERE A.HEADER_ID=B.HEADER_ID
   AND A.MOVE_ORDER_TYPE=2 
   AND 'on'=:1
   AND B.TO_SUBINVENTORY_CODE=NVL(:4,B.TO_SUBINVENTORY_CODE)
   AND A.request_number=NVL(:5,A.REQUEST_NUMBER) 
UNION ALL
SELECT  rownum LINENUM,
        a.wip_entity_id LINE_ID,
        a.INVENTORY_ITEM_ID INVITMID,
        a.QUANTITY_ISSUED PICKQTY      
  FROM  WIP_REQUIREMENT_OPERATIONS a,
        eam_work_orders_v b
  WHERE a.wip_entity_id=b.wip_entity_id
     AND 'on'=:2
    AND a.ATTRIBUTE2=NVL(:4,a.ATTRIBUTE2)
  and b.wip_entity_name=NVL(:6,b.wip_entity_name)
I need to pass dynamically a condition to my where clause that i can handle it by defining two bind parameters in the vo query and can pass it but the problem is the bind variable contains a string like 1311,13112,14445 that i need to pass for a field such as B.line_id in the first query and b.wip_entity_id in the second query so when i am trying by passing the string as one value it is working fine but for value separetd by comma it is giving prob.
so i tried by passing dynamic where clause but it is everytime executing for first clause only how i can pass dynamically both the queries.
vo.setWhereClause("LINE_ID in "+wherclause);
please help me out
Thnaks
Deb

Hi Gaurav,
Thnaks for the reply i tried belwo way u suggested but the query is executing multiple times and i am not getting the correct data as expected.
public void processPOData (String wherclause)
             OAViewObject vo = this.getXXDPECONTAINLINESVO1();
                String query =vo.getQuery();
                String newwhereclause ="LINE_ID = "+wherclause;
                StringBuffer stringbuffer = new StringBuffer();  
            stringbuffer.append("SELECT * FROM (");
            stringbuffer.append(query);
            stringbuffer.append(") where ");
            stringbuffer.append(newwhereclause);          
    ViewDefImpl viewdefimpl = getXXDPECONTAINLINESVO1().getViewDefinition();
            viewdefimpl.setQuery(stringbuffer.toString());
             vo.reset();
             vo.clearCache();
            vo.executeQuery();
                System.out.println("where clause:"+wherclause);
in my log file the query is forming like below:
SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM ( SELECT * FROM ( SELECT  rownum LINENUM,
        B.line_id LINE_ID,
        B.INVENTORY_ITEM_ID INVITMID ,
        B.QUANTITY_DELIVERED PICKQTY ,
        B.TO_SUBINVENTORY_CODE UNLOADINGPNT,
        A.REQUEST_NUMBER RRNUM,
        NULL WORKORDNUM,
        NULL DTRNUM,
        A.description,
        A.FROM_SUBINVENTORY_CODE FROM_SUB,
        A.TO_SUBINVENTORY_CODE  TO_SUB,
        NULL SOURCE       
from   MTL_TXN_REQUEST_HEADERS A,
        MTL_TXN_REQUEST_LINES  B
  WHERE A.HEADER_ID=B.HEADER_ID
   AND A.MOVE_ORDER_TYPE=2  
UNION ALL
SELECT  rownum LINENUM,
        a.wip_entity_id LINE_ID,
        a.INVENTORY_ITEM_ID INVITMID,
        a.QUANTITY_ISSUED PICKQTY,
        a.ATTRIBUTE2 UNLOADINGPNT,
        NULL RRNUM,
        b.WIP_ENTITY_NAME WORKORDNUM,
        NULL DTRNUM,
        b.description,
        NULL FROM_SUB,
        NULL TO_SUB,      
        b.source SOURCE
  FROM  WIP_REQUIREMENT_OPERATIONS a,
        eam_work_orders_v b
  WHERE a.wip_entity_id=b.wip_entity_id ) )) where LINE_ID = 30026) where LINE_ID = 30026) where LINE_ID = 30026
But in my page i am getting all the data instead of only for line 30026, please help me out

Similar Messages

  • Need help in clearing string buffer during dynamic VO where clause in oaf

    Hi All,
    I am dynamically setting where clause in OAF using string buffer, but the issue is when i am executing the vo multiple times so the old data in the string buffer it is not clearing .so every time my where clause adding to the query and it is erroring out, please help me how to clear string buffer class in oaf.
    Thnaks

    Hi,
    Could you please share the code segment for reference. Then we can tell the solution.
    Regards,
    Tarun

  • Dynamically setting where clause parameter before the page load

    Hi Experts,
    I do have the following requirement.
    I am working on jsf page in ADF10.1.3.3. I have a View Object which displays the results on the screen. Can someone provide me some example where I can dynamically set the where clause parameter to my Query in VO before the Page Load happens(By Overriding the Prepare Model) and display results on screen.
    Thanks

    Hi,
    Thanks for yor advice.
    I need to write the method in Prepare Model method when the page loads and not in AM.
    Here in the page there is no action as such.
    On the Page load we need to directly set the Where Clause on the VO.
    Provide me some examples if any.
    Thanks

  • Bc4j: set where clause at runtime for view objcet ?

    how to set where clause for a view object that is not put in a subselect at runtime ?
    select a.para_id, b.para_para_id
    from table1 a, table2 b
    need to set at runtime either:
    where a.para_id = b.para_para_id
    or:
    where a.para_id = b.para_para_id(+)
    problem is that bc4j is useing it as followed:
    select * from (
    select a.para_id, b.para_para_id
    from table1 a, table2 b
    ) where (a.para_id = b.para_para_id(+))
    cant use outer join like this
    any suggestions

    If you do not want to issue the framework built query, you may want to set the query for a VO yourself instead of setting just the where clause by using setQuery() api. TO revert back to framework built query, call setQuery(null).
    This way, when you need the xtra where-clause and not the "innerSQL stuff", you can build a custom sql with whereclause etc, and call setQuery(), execute that SQL, perform your tricks with the VO and then when the VO is usage is done, reset the VO query to original by calling setQuery(null).

  • How to set Where clause in the View Object of the MessageChoice ?

    Hi,
    How to set Where clause in the View Object of the
    MessageChoice ?
    Example:
    <bc4j:rootAppModuleDef name="EdEscolaCampusView1AppModule"
    definition="ed00050.Ed00050Module"
    releaseMode="stateful" >
    <bc4j:viewObjectDef name="EdEscolaCampusView1" >
    <bc4j:rowDef name="CreateEdEscolaCampusView1" autoCreate="true" >
    <bc4j:propertyKey name="key" />
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
    <bc4j:viewObjectDef name="ListaTipLocalView1"
    rangeSize="9999">
    </bc4j:viewObjectDef>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    messageChoice declaration:
    <bc4j:messageChoice name="SeqTipoLocalCampus"
    attrName="SeqTipoLocalCampus"
    prompt="Local do Campus">
    <contents>
    <bc4j:optionList attrName="SeqTipoBasico"
    textAttrName="NomTipoBasico"
    voName="ListaTipLocalView1"/>
    </contents>
    </bc4j:messageChoice>
    I would like set where clause of ViewObject, with dinamic parameters (using attribute1 = :1), before populate messageChoice.
    thanks...
    Danilo

    Hi Andy,
    I try set a where clause using the message:
    Set where Clause parameter using UIX , but my UIX Page have 2 messageChoice's of different ViewObject's, then I need implement this Java Class:
    //Nome da Package da Tela Detail
    package br.com.siadem.siaed.ed00050;
    // Importa as Bibliotecas necessárias
    import oracle.jbo.ViewObject;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.client.Configuration;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.data.jbo.servlet.bind.*;
    import oracle.cabo.ui.data.BoundValue;
    import oracle.cabo.ui.data.DataBoundValue;
    import javax.servlet.http.HttpServletRequest;
    import br.com.siadem.siaed.util.*;
    import javax.servlet.http.Cookie;
    import oracle.cabo.data.jbo.def.NestedAppModuleDef;
    import oracle.cabo.data.jbo.def.ViewObjectDef;
    import oracle.cabo.data.jbo.def.AppModuleDef;
    // Classe que configura os parametros para a execução da Query,
    // utilizando variáveis de Sessao
    public class FunPreQueryLista
    public static EventResult FunConfiguraQuery(BajaContext context, Page page, PageEvent event) throws Throwable
    // TrataDadosSessao - Classe utilizada para retornar os valores das variáveis de sessão genéricas
    // Ex: CodCliente, CodMunicipio etc...
    TrataDadosSessao varDadosSessao = new TrataDadosSessao();
    // 1o. Parametro Configurado - Através da classe TrataDadosSessao, utilizando um método Get
    // <alterar>
    String valor1 = varDadosSessao.getCodCliente();
    String valor2 = varDadosSessao.getCodMunicipio();
    //Cria o objeto que retorna o ApplicationModule
    ApplicationModule am = ServletBindingUtils.getApplicationModule(context);
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoLocal = am.findViewObject("ListaTipoLocalView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoLocal.setWhereClauseParam(0,valor1);
    TipoLocal.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoLocal.executeQuery();
    // Fim das Configurações da Query da Lista
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoDestLixo = am.findViewObject("ListaDestinoLixoView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoDestLixo.setWhereClauseParam(0,valor1);
    TipoDestLixo.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoDestLixo.executeQuery();
    // Fim das Configurações da Query da Lista
    // Retorna o Resultado para a Página
    return new EventResult(page);
    The code works very well...
    And, I'm sorry for my two repost's in UIX Forum about this in a few time.
    Thank very much...
    Danilo

  • Define a Standalone Download Integrator with an Additional Where clause - SQL error

    Hi,
    I am trying to create a standalone integrator with an Additional Where clause. Followed the steps mentioned in the metalink note 360105.1. When I run the integrator, I get the following error message.
    Please resolve the following error to continue.
    SQL error: ORA-00936: missing expression occurred
    processing stored SQL for Content 20007:GENERAL_441_CNT.
    When I look at the log file, here is what I can see:
    10/22/14 10:50 AM AJPRequestHandler-HTTPThreadGroup-15 TRACE          BneHrSQLControl - SQL:SELECT  FROM PER_PEOPLE_V where last_name=$PARAM$.last_name
    10/22/14 10:50 AM AJPRequestHandler-HTTPThreadGroup-15 TRACE          validateSQLStatement value of sqlStatement is: SELECT  FROM PER_PEOPLE_V where last_name=:RSQLP1
    10/22/14 10:50 AM AJPRequestHandler-HTTPThreadGroup-15 DETAIL         BneHrSQLControl.validateSQLStatement() paramName: last_name
    10/22/14 10:50 AM AJPRequestHandler-HTTPThreadGroup-15 DETAIL         BneHrSQLControl.validateSQLStatement() error in SQL: java.sql.SQLSyntaxErrorException: ORA-00936: missing expression
    So, clearly, the SQL statement that is getting built internally is wrong. Ideally, I would expect the statement to be something like this:
    SELECT *  FROM PER_PEOPLE_V where last_name=$PARAM$.last_name.
    RDBMS : 11.2.0.3.0
    Oracle Applications : 12.1.3
    Any pointers towards the resolution of the issue would be of great help.
    Thanks in Advance!
    Lalitha.

    This is a duplicate post of your other question:  create trigger automatic
    DO NOT start duplicate threads for the same question.
    Locking this thread

  • Cardinality estimator 2014 is off with OR in where clause

    Here is my test setup on SQL Server 2014.
    -- Create big table
    CREATE TABLE [dbo].[Store](
    Id int IDENTITY(1,1) NOT NULL,
    City int NOT NULL,
    Size int NOT NULL,
    Name varchar(max) NULL,
    CONSTRAINT [PK_Store] PRIMARY KEY CLUSTERED ([Id] ASC)
    GO
    CREATE NONCLUSTERED INDEX [IX_Store] ON [dbo].[Store] (City ASC, Size ASC)
    GO
    -- Fill with 100k rows
    INSERT Store
    SELECT i % 101, i % 11, 'Store ' + CAST(i AS VARCHAR)
    FROM
    (SELECT TOP 100000 ROW_NUMBER() OVER (ORDER BY s1.[object_id]) AS i
    FROM sys.all_objects s1, sys.all_objects s2) numbers
    GO
    -- Create small table
    CREATE TABLE #StoreRequest (City int NOT NULL, Size int NOT NULL)
    GO
    INSERT #StoreRequest values (55, 1)
    INSERT #StoreRequest values (66, 2)
    Now I execute the following query (I force the index to show statistics estimates)
    SELECT s.City
    FROM #StoreRequest AS r
    INNER JOIN Store AS s WITH(INDEX(IX_Store), FORCESEEK)
    ON s.City = r.City AND s.Size = r.Size
    WHERE s.Size <> 1 OR r.City <> 55
    Here are the estimates that I get (I'm not allowed to upload pictures):
    Index Seek IX_Store
    Actual Number of Rows: 90
    Estimated Number of Rows: 50000
    Fixing WHERE clause to use one table not two makes the estimate perfect:
    SELECT s.City
    FROM #StoreRequest AS r
    INNER JOIN Store AS s WITH(INDEX(IX_Store), FORCESEEK)
    ON s.City = r.City AND s.Size = r.Size
    WHERE s.Size <> 1 OR s.City <> 55
    Index Seek IX_Store
    Actual Number of Rows: 90
    Estimated Number of Rows: 89.74
    Switching to 2012 compatibility mode gives estimate of 1 in both cases:
    Index Seek IX_Store
    Actual Number of Rows: 90
    Estimated Number of Rows: 1
    Could anyone explain the first result? I'm a bit worried about it. The fix in this case is trivial, but this problem gave us quite some headache in more complex real life queries with multiple joins.
    Thank you!

    But not full statistics on a field basis, just sometimes some default stats like total row count that some plans will build.  Even your StoreRequest table only has one two-field index that will have a full histogram.
    But I've seen SQL Server make massively bad plans on two-field indexes.
    I've seen SQL Server go wrong one-column indexes, so that is not a very relevant point.
    Temp tables or not, the estimate here is clearly incorrect. SQL Server knows the density of Size and City. It knows the cardinality of the temp table. The density information gives how many rows the the join will produce. The WHERE clause will then remove
    a certain number of rows. With no statistics for the temp table, it does not now how many, but it will apply some standard guess.
    50000 is a completely bogus number, because the join cannot produce that many rows, and SQL Server is able to compute the join with out the WHERE clause decently. (Well, it estimates 90, when the number is 180.) No, this is obviously a case of the cardinality
    estimator giving up completely.
    It is worth noting that both these WHERE clauses gives reasonable estimates:
     WHERE r.Size <> 11 OR r.City <> 550
     WHERE s.Size <> 11 OR s.City <> 550
    Whereas these two gives the spooky 50000:
     WHERE s.Size <> 11 OR r.City <> 550
     WHERE r.Size <> 11 OR s.City <> 550
    Erland Sommarskog, SQL Server MVP, [email protected]

  • On success of form save I want to go to another for with a detail where clause

    I have the follow code snippet which is intented to go to a form on a successfull save. I query some data based on the save then build a url to navigate to a new form. I want the form to show only data that is lacking in one column not being populated (column is null). The url works, but the form detail where clause is ignored. Does anyone have any experience with passing detail where clauses to a form? Did I miss something in the code below?
    begin
    select count(rl_id) into n_rl_id_cnt
    from rfq_lines
    where part_part_id is null and rh_rh_id=n_rh_id;
    exception
    when others then
    null;
    end;
    htp.p('cnt '||to_char(n_rl_id_cnt));
    if n_rl_id_cnt>0 then
    htp.p('cnt >1');
    my_url := 'PORTAL30.wwa_app_module.link?' ||
    'p_arg_names=_moduleid&p_arg_values=3677858481' ||
    '&p_arg_names=_show_header&p_arg_values=YES' ||
    '&p_arg_names=rh_id&p_arg_values=' || LTRIM(TO_CHAR(n_rh_id)) ||
    '&p_arg_names=_rh_id_cond&p_arg_values=%3D'||
    '&p_arg_names=_detail_where_clause&p_arg_values=part_part_id%20is%20null'; -- <this is not working right. where clause is ignored.
    htp.p(my_url);
    go (my_url);

    Hi Jeffrey ,
    You need to use a custom Format script for the field.
    Regards
    Sukrit Dhingra

  • Create a view with a changing where clause

    Hi all,
    i'm developing an application with oracle forms i want to create a view in the database with a different where clause in every time , the where clause is determined due to the department id of the current user .
    thanks alot.

    SQL> create view emp_view as select empno, ename, deptno from emp;
    View created.
    SQL> select * from emp_view where deptno = 10;
         EMPNO ENAME          DEPTNO
          7782 CLARK              10
          7839 KING               10
          7934 MILLER             10
    SQL>

  • Issue with Dynamic Link with Premiere CC and After Effects

    I'm having a strange and annoying issue with Dynamic linked clips in Premiere CC:
    When I render or export my timeline the progress will stall when it hits a dynamic linked clip.  It will stay stalled until I click the After Effects application and make it the active window.  Once that happens the render/export resumes at normal speed. 
    This is annoying as I can't start a render and walk away or work on different windows, I have to babysit all the renders to make sure they go through.
    Has anybody experienced this and know of any solutions? 
    I'm running the latest version of Premiere (7.2.1) and After Effects 12.2.0.52 on Mavericks 10.9.1 with a GTX 770 Video Card.

    Does it still pause if AE is closed completely? I often experience slower AME renders from Premiere over dynamic link material when AE is open. Closing AE speeds things up. Go figure.

  • Set Where Clause of VL Using Coding???

    How to Set Where Clause of VL(View Link) Using Coding???

    i think,if you can not change the VL def,change the SQL(like give a translate column)

  • Dynamic XQuery Where clause

    I have the following schema:
    <?xml version="1.0"?>
    <xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="CountryRiskService"
    targetNamespace="CountryRiskService"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
    <xs:element name="CountryRiskParameters">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="countryId" type="xs:int" minOccurs="1" maxOccurs="unbounded"/>
    <xs:element name="catA" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    I am passing this into my Logical Data Service, what I want to do is create a dynamic XQuery where clause if the catA field is populated, ignore it if it isn’t, so basically, I want to be able to create a dynamic query based on the parameters requested, so I have the following XQUERY:
    declare function tns:getCountries($countryRiskInput as element(ns7:CountryRiskParameters)) as element(ns0:CountryRiskInfo)* {
    for $tbl_high_risk_countries in ns1:tbl_high_risk_countries()
    where $countryRiskInput/ns4:countryId = $tbl_high_risk_countries/country_id
    where $countryRiskInput/ns4:catA = $tbl_high_risk_countries/risk_catA
    I really thought that DSP would be able to handle this on the fly since the element is optional but if I don’t populate it, I get nothing back, the idea is I want to increase the number of elements in my schema so my consumers have the ability to filter the results they want, so above, I don’t want the second where clause if catA isn't specified, any ideas how to accomplish this?

    Simply add the disjunction of the input being empty.
    for $tbl_high_risk_countries in ns1:tbl_high_risk_countries()
    where $countryRiskInput/ns4:countryId = $tbl_high_risk_countries/country_id
    where ( $countryRiskInput/ns4:catA = $tbl_high_risk_countries/risk_catA or empty( $countryRiskInput/ns4:catA )
    But suppose you have 27 different elements that you might want to filter on - the xquery gets long and ugly. You might want to looking into using FilterXQuery. Visit http://edocs.bea.com/aldsp/docs25/, search on FilterXQuery, look for the tutorial.
    If your queries get more complicated, you would do well to look into generating ad hoc queries. (edocs as well).

  • I am exporting a 2 min video, using a custom compressor setting. i have not had issues with this setting in the past, but recently its taking upwards of 4 hours to process. Any idea what is going on?

    I am exporting a 2 min video, using a custom compressor setting. I have not had issues with this setting in the past, but recently its taking upwards of 4 hours to process. Any idea what is going on?

    Name: Vimeo HD Encode
    Description: No description
    File Extension: mov
    Estimated size: 2.3 GB/hour of source
    Audio Encoder
              AAC, Stereo (L R), 44.100 kHz
    Video Encoder
              Width: 1920
              Height: 1080
              Pixel aspect ratio: Square
              Crop: None
              Padding: None
              Frame rate: (100% of source)
              Frame Controls On:
                        Retiming: (Best) High quality Motion Compensated
                        Resize Filter: Statistical Prediction
                        Deinterlace Filter: Best (Motion Compensated)
                        Adaptive Details: On
                        Antialias: 0
                        Detail Level: 0
                        Field Output: Progressive
              Codec Type: H.264
              Multi-pass: On, frame reorder: On
              Pixel depth: 24
              Spatial quality: 75
              Min. Spatial quality: 25
              Key frame interval: 30
              Temporal quality: 50
              Min. temporal quality: 25
              Average data rate: 5.12 (Mbps)
    Compatible with Mac
    My video in the timeline is 1920 x 1080 / 23.98 fps
    I've installed Toast and photoshop elements recently, i also updated my apps the other day.
    I have had this problem before the updates of the apps though

  • Is anyone else having issues with their mail , where the reply from the person you just contacted contains very old emails from a different contact ?

    Is anyone else having issues with their mail , where the reply from the person you just contacted contains very old emails from a different contact ?

    I mean that I sent an email to a contact of mine yesterday. His reply contained a stream of very old emails I had received in 2009 from a totally different contact all together !! The reply email was in my inbox as being from the original person I sent the email to. This is starting to happen more regularly now , so is a problem !

  • Dynamic Order by with user defined Where clause...

    Hello!
    I have a block based on a table, with no order by set and no where clause.
    The block is queryable so users can filter the data to be retrieved.
    Each of the columns on the form have a button above which requeries the block, applying the order by (SET_BLOCK_PROPERTY ( 'B12', ORDER_BY, :bc1.h_b12_custom_orderby ); )
    The problem is that each time the block is requeried the user definied filter criteria is lost. Is there any way I can get a handle on this and maintain the filtering?
    GET_BLOCK_PROPERTY(item, DEFAULT_WHERE); only retrieves the query entered while in design mode so this won't work.
    I'm using Oracle Forms 6i, web based. Any suggestions are very much appreciated.
    Thanks in advance,
    Jay

    Many thanks for your response Hedy,
    Below is the procedure I used to achieve this.
    I found GET_BLOCK_PROPERTY ( p_block, LAST_QUERY ) worked better than :SYSTEM.last_query. As the first time it is called within a block :SYSTEM.last_query returned the query made in another block - which I'm sure has it's applications.
    Thanks again,
    Jay
    PROCEDURE set_last_query_where ( p_block IN VARCHAR2
    , p_where IN VARCHAR2 DEFAULT NULL )IS
    l_last_query VARCHAR2(10000);
    l_last_where VARCHAR2(10000);
    BEGIN
    IF p_where IS NULL THEN
    l_last_query := UPPER(GET_BLOCK_PROPERTY ( p_block, LAST_QUERY ));
    l_last_where := SUBSTR ( UPPER ( l_last_query),
    INSTR ( l_last_query, 'WHERE')+6, INSTR(SUBSTR(UPPER(l_last_query), INSTR(l_last_query, 'WHERE')+8), 'ORDER BY'));
    ELSE
    l_last_where := p_where;
    END IF;
    SET_BLOCK_PROPERTY ( p_block, DEFAULT_WHERE, l_last_where );
    EXCEPTION
         WHEN FORM_TRIGGER_FAILURE THEN
         ref_raise_ftf;
         WHEN OTHERS THEN
         ref_others( 'P-SLQW' );
    END;

Maybe you are looking for