Rac dynamic views

Hi,
could you tell dynamic views for RAC.

user3266490 wrote:
could you tell dynamic views for RAC.Seeing that you have not supplied any database version info, the following URL is for Oracle 10.2.
Refer to the [Oracle® Database Reference|http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/toc.htm] guide for the V$ views - the following quote from this manual:
For almost every V$ view described in this chapter, Oracle has a corresponding GV$ (global V$) view. In Real Application Clusters, querying a GV$ view retrieves the V$ view information from all qualified instances. In addition to the V$ information, each GV$ view contains an extra column named INST_ID of datatype NUMBER. The INST_ID column displays the instance number from which the associated V$ view information was obtained. The INST_ID column can be used as a filter to retrieve V$ information from a subset of available instances.

Similar Messages

  • Select from Query ? / Dynamic view ? Anything else ?

    Hello,
    This could be a bit challenging. (or maybe not, i hope)
    I have to create a report which is based on 3/4 tables with pretty complex SQL.
    Step 1. I have to use views (in the database currently) to select data from these tables.
    Step 2. Then create the next set of views (in the db) based on the previous views.
    Step 3. Then finally join the last set of views in Reports and create the report based on the PARAMETERS entered.
    This was fine, until the client changed the criteria. Now the views have to be created but the PARAMETERS affect the FIRST set of views.
    That is, the views in the FIRST STEP will have a where condition based on the parameters at RUN TIME.
    I was wondering about how to do this ?
    1. Can I use dynamic views (in db) passing the where condition parameter to the where clause ? Alternatively use DDL in Reports.
    OR
    2. Create a query in Reports and create subsequent QUERIES BASED ON THE FIRST QUERY (like MS Access). Can this be done ?
    3. Any other way ?
    If you need any clarification, I can provide that.
    THANKS for taking the time to read it. It would be great if you could give me any ideas.
    Pat.

    hello,
    you might look into REF-CURSOR-QUERIES for this particular case. it might help.
    regards,
    the oracle reports team

  • Dynamic view creation in Flex

    I am new to  Flex web applications and I am doing research to see if functionality
    contained in an existing web application can be replicated in a Flex web app.
    We currently have a JSP / Struts based web application that creates a data entry
    web view dynamically based on information that describes the different widgets and
    their view locations as recieved from the application backend.  We are looking at
    migrating this application and this functionality to Flex.
    When User X selects 1 of any number of data entry views, the Flex application would
    receive data from the back end that  contains information describing the different widgets
    to display on the dynamic view: what type of widget to display ( text field,combo, line,
    box, etc), the pixel specific positional information as to where each widget exists in the
    view.  These data entry views are not something the Flex developer designs or knows
    what to expect from the backend. Flex has to generate the view on the fly based on the
    information that describes the view.
    The question:  I fully expect there to be coding within the action scripts; before trying to
                         learn how to do this, is this something that Flex support.  
    Thanks,
    Brian

    Yep, we do something similar. We had to build out the infrastructure, but It works fine. E.g.,
    var bDesc:XML = <button x="10" y="5" label="hello world" color="red"/>
    var b:Button = new Button();
    b.label = bDesc.@label;
    b.x = bDesc.@x;
    b.y = bDesc.@y;
    b.setStyle('color', b.@color);
    addChild(b);
    In your app, the actual description (XML or other format) would be coming from the server. Then you just add it to the display list (and wire in any event handlers if necessary). In a real setting, you'll need error checking and a more formalized way of doing this, but it works reasonably well. No major snags.

  • How to create dynamic View Object and Dynamic Table

    Dear ll
    I want to create a dynamic view object and display the output in a dynamic table on the page.
    I am using Jdeveloper 12c "Studio Edition Version 12.1.2.0.0"
    This what I did:
    1- I created a read only view object with this query "Select sysdate from dual"
    2- I added this View object to the application module
    3- I created a new method that change the query of this View object at runtime
        public void changeVoQuery(String dbViewName) {
            String sqlstm = "Select * From " + dbViewName;
            ViewObject dynamicVo = this.findViewObject("DynamicVo");
            if (dynamicVo != null) {
                dynamicVo.remove();
            dynamicVo = this.createViewObjectFromQueryStmt("DynamicVo", sqlstm);
            dynamicVo.executeQuery();
    4- I run the application module for testing the method and I passed "Scott.Emp" as a parameter and the result was Success
    5- Now I want to show the result of the view on the page, so I draged and dropped the method from the data control as a parameter form
    6- I dragged and dropped the view Object "DynamicVo" as a table and I choose "generate Column Dynamically at runtime". This is the page source
    <af:panelHeader text="#{viewcontrollerBundle.SELECT_DOCUMTN_TYPE}" id="ph1">
            <af:panelFormLayout id="pfl1">
                <af:inputText value="#{bindings.dbViewName.inputValue}" label="#{bindings.dbViewName.hints.label}"
                              required="#{bindings.dbViewName.hints.mandatory}"
                              columns="#{bindings.dbViewName.hints.displayWidth}"
                              maximumLength="#{bindings.dbViewName.hints.precision}"
                              shortDesc="#{bindings.dbViewName.hints.tooltip}" id="it1">
                    <f:validator binding="#{bindings.dbViewName.validator}"/>
                </af:inputText>
                <af:button actionListener="#{bindings.changeVoQuery.execute}" text="changeVoQuery"
                           disabled="#{!bindings.changeVoQuery.enabled}" id="b1"/>
            </af:panelFormLayout>
        </af:panelHeader>
        <af:table value="#{bindings.DynamicVo.collectionModel}" var="row" rows="#{bindings.DynamicVo.rangeSize}"
                  emptyText="#{bindings.DynamicVo.viewable ? 'No data to display.' : 'Access Denied.'}"
                  rowBandingInterval="0" selectedRowKeys="#{bindings.DynamicVo.collectionModel.selectedRow}"
                  selectionListener="#{bindings.DynamicVo.collectionModel.makeCurrent}" rowSelection="single"
                  fetchSize="#{bindings.DynamicVo.rangeSize}" filterModel="#{bindings.DynamicVoQuery.queryDescriptor}"
                  queryListener="#{bindings.DynamicVoQuery.processQuery}" filterVisible="true" varStatus="vs" id="t1"
                  partialTriggers="::b1">
            <af:iterator id="i1" value="#{bindings.DynamicVo.attributesModel.attributes}" var="column">
                <af:column headerText="#{column.label}" sortProperty="#{column.name}" sortable="true" filterable="true"
                           id="c1">
                    <af:dynamicComponent id="d1" attributeModel="#{column}"
                                         value="#{row.bindings[column.name].inputValue}"/>
                </af:column>
            </af:iterator>
        </af:table>
    when I run the page this error is occured
    <Nov 13, 2013 2:51:58 PM AST> <Error> <oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter> <BEA-000000> <ADF_FACES-60096:Server Exception during PPR, #1
    javax.el.ELException: java.lang.NullPointerException
    Caused By: java.lang.NullPointerException
    Can any body help me please
    thanks

    Have you seen Shay's video https://blogs.oracle.com/shay/entry/adf_faces_dynamic_tags_-_for_a
    All you have to do is to use the dynamic table to get your result.
    Timo

  • Updatable , Dynamic VIEW OBJECT ??

    Hi ,
    I want to create a dynamic VO which is updatable.
    I dont have any information about the table on which my View Object is based on, at DESIGN TIME. At run time I create query for the view and create dynamic view using AM.createViewObjectFromQueryStmt(String, String) but this kind of view will not be an updatable view.
    I think if I use createViewObjectFromQueryClauses() from entity, it will be updatable,,,but in that I will have to create entities for all the table in my schema ..which sounds BAD...
    is there any thing as DYnamic Entities ??
    or any other trick to do this.....
    BC4J should support something like changing QUERY_DATA_SOURCE_NAME at runtime in oracle forms.. which allow you to update record.
    Thanx,
    Prasoon

    Hi Prasoon,
    Steve Muench's "Dive Into BC4J" page has the following example: http://radio.weblogs.com/0118231/stories/2003/07/15/creatingUpdateableMultientityViewObjectDefinitionsDynamically.html
    But this is based on pre-defined Entity Objects. It might give you some ideas, though.
    Good luck!
    Chris

  • Dynamic view object loses bind variables after passivation

    I am creating a view object definition/view object programmatically in Jdev 11.1.1.2.0. The query requires a named bind parameter. All was working fine but now I am testing with app module pooling disabled and the bind variable is not being restored after passivation -- it's like the definition has disappeared or something.
    Here is my VO creation code:
    ViewObject vo = findViewObject("FinalistsWithEvalDataVO");
    if (vo != null){
    vo.remove();
    ViewDefImpl voDef = new ViewDefImpl("FinalistsWithEvalDataVODef");
         // I add a bunch of viewAttrs here...
    voDef.setQuery(fullQuery);
    voDef.setFullSql(true);
    voDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
    voDef.resolveDefObject();
    voDef.registerDefObject();
    vo = createViewObject("FinalistsWithEvalDataVO", voDef);
    vo.defineNamedWhereClauseParam("Bind_SchlrAyId", null, new int[] {0});
    vo.setNamedWhereClauseParam("Bind_SchlrAyId", new Number(1)); //For testing
    vo.executeQuery();
    The query executes fine right there and then the VO seems to passivate fine. I even see the bind var in passivation:
    <exArgs count="1">
    <arg name="Bind_SchlrAyId" type="oracle.jbo.domain.Number">
    <![CDATA[1]]>
    </arg>
    </exArgs>
    But then when it reactivates prior to rendering the page, it invariably throws a missing parameter exception and this in the log:
    <ViewUsageHelper><createViewAttributeDefImpls> [7409] *** createViewAttributeDefImpls: oracle.jdbc.driver.OraclePreparedStatementWrapper@1af78e1
    <ViewUsageHelper><createViewAttributeDefImpls> [7410] Bind params for ViewObject: [FinalistsWithEvalDataVO]AwardViewingServiceAM.FinalistsWithEvalDataVO
    <ViewUsageHelper><createViewAttributeDefImpls> [7411] ViewUsageHelper.createViewAttributeDefImpls failed...
    <ViewUsageHelper><createViewAttributeDefImpls> [7412] java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    I have worked on this for hours and can't see anything wrong. Like I said, it works fine when not forcing passivation...
    Any help would be appreciated.
    Thanks.
    -Ed

    @Jobinesh - Thanks for the suggestions. I have read all the documentation I can find. Everything works fine without passivation. Everything still breaks with passivation. I have given up on trying to get the bind variable to restore after passivation and am currently just building the query with all values embedded in the query rather than bind variables. This is bad practice but avoids the problem. However, now that I avoided that obstacle, I'm on to the next issue with passivation of this dynamic view object, which is that the current row primary key apparently cannot be reset after activation. I get the following error:
    <Key><parseBytes> [7244] Key(String, AttributeDef[]): Invalid Key String found. AttributeCount:1 does not match Key attributes
    <DCBindingContainer><reportException> [7254] oracle.jbo.InvalidParamException: JBO-25006: Value 00010000000A30303033383133343734 passed as parameter String to method Constructor:Key is invalid: {3}.
         at oracle.jbo.Key.parseBytes(Key.java:537)
         at oracle.jbo.Key.<init>(Key.java:179)
         at oracle.jbo.server.IteratorStateHolder.getCurrentRowKey(IteratorStateHolder.java:34)
         at oracle.jbo.server.ViewRowSetIteratorImpl.activateIteratorState(ViewRowSetIteratorImpl.java:3877)
    I've been trying various workarounds for over a day now with no luck. Very frustrating.
    Thanks for trying to help.
    -Ed

  • Get bind variables of a dynamic view object

    I seem unable to retrieve the bind variables for a dynamically created view object, even though I can do the same thing for a regular view object.
    Here is the code:
    newVO = repServ.createViewObjectFromQueryStmt("newQry",strSql);
    VariableValueManager vvm = newVO.ensureVariableManager();
    if (vvm != null)
    Variable vars[] = vvm.getVariables();
    vars will be empty, even though the sql statement in strSql has bind variables in it.
    Is there any way to determine the bind variables of a dynamic view object?
    Thanks!

    I got the same problem as yours and still could not find any way out.
    However, as I can see, you wanted to get VariableValueManager of newly created ViewObject that may be not available at this moment.
    If you find way to solve the problem, please help.
    Cheer,
    MinhTran

  • Paging issues using a dynamic view object...

    I am working on an application that uses JAG to generate JSP pages, i had the requirement to use dynamic view objects where the view object query is generated at runtime. The rest of the application is more or less the same... I used the defult functionality provided by TableScrollButtons.jsp file for paging. Now the problem im facing is that while the '>' and '<' buttons are working fine, i cant seem to navigate to the pages using the drop down...
    With the default handler, whenever i select the range the range displayed remains the same ie 1-10, 10 being the rangesize, but the rows are refreshed with values from the next page. Also, if the next page is the last and is incomplete, then the rows are pushed in from the bottom, so that the last page is always full...I tried the tuning panel in the view object edit dialogue and all settings are fine (i think)...could anyone please tell me what i am doing wrong??

    could it be because i am using a dynamic view object with dynamic bindings? i am using the preparemodel() method in the action as follows...
    protected void prepareModel(DataActionContext ctx) throws Exception {
    inferRangeBindingIfUnset(ctx);
    ctx.getBindingContainer().setEnableTokenValidation(false);
    String sql = ctx.getHttpServletRequest().getParameter("sql");
    String cost=ctx.getHttpServletRequest().getParameter("CostCostCent");
    String event=ctx.getHttpServletRequest().getParameter("event");
    if (sql != null && event == null) {
    setupDynamicQueryAndDynamicBindings(ctx,sql.substring(1),cost);
    if (retrieveOnlyCurrentPageFromDatabase()) {
    ViewObject vo = getIterForPaging(ctx).getViewObject();
    if (vo.getAccessMode() != ViewObject.RANGE_PAGING) {
    vo.setAccessMode(ViewObject.RANGE_PAGING);
    // if(event==null)
    super.prepareModel(ctx);
    ctx.getBindingContainer().setEnableTokenValidation(true);
    if (ctx.getEvents() == null || ctx.getEvents().size() ==0) {
    setPage(ctx,1);
    setLastPage(ctx,getIterForPaging(ctx).getRowSetIterator().getEstimatedRangePageCount());
    else if(event.equals("setRangeStart")) {
    setPageFromRequest(ctx);
    }

  • Lov based on a dynamic view object

    Build JDEVADF_11.1.2.0.0_GENERIC_110531.1615.6017
    Hi,
    I have a database table containing a column with the Name of a Table as content.
    I created a dynamic view and overwrite this with a method in Appmodule.
    Then I add to the element in the main view the Lov. I execute the method in JSP page.
    But the SelectOnechoice list is empty!
    Where is the problem? How can I create a Lov based on a dynamic view object?
    Thanks in advance and best regards
    Edited by: NewBB on 12.08.2011 00:53

    Hi Neliel,
    thank you for your reply.
    My problem is not the same. I can also see my dynamic view objects as selectonechoice. I have a table T1 has a column t1c1 (Number),
    another table T2 (dynamic view object) with two columns t2c1 (Number) and t2c2 (varchar2).
    In my application I want to represent the values of t1c1 as selectonechoice with the values of t2c2.
    and that does not work. My list is empty. Any idea???

  • Creating and Accessing a Dynamic View Object

    Hi,
    I'm needing to create a Dynamic View Object so to have the ability to modify the FROM and WHERE clauses in an SQL statement.
    I then need to view all the columns and rows in an adf table or something similar.
    I've read up a fair bit on similar situations, however I'm struggling with the basic framework of building the View Object.
    I know I'm wanting to use ..createViewObjectFromQueryStmt..but just unsure of the syntax in using it, especially connecting the VO to an Application Module.
    This is similar to what I've got now, located in AppModuleImpl.java
        public void createDynVO(ApplicationModule appMod, String FROMclause, String WHEREclause){
        String SQL = "SELECT JOURNAL_NAME, PERIOD_NAME FROM " + FROMclause + " " + WHEREclause;
        ViewObject vo = appMod.createViewObjectFromQueryStmt("DynamicView", SQL);
        vo.executeQuery();But how does it know what the application module is?
    Any help would be greatly appreciated!
    -Chris

    Ok, I've actually modified my approach to this.
    I've created a View Object in the design view, added it to the App Module, and then created an iterator and bound an adf table to that iterator.
    The View Object which I created has the same column names as what I am going to be getting later down the track.
    Everything is working perfectly, except that I can't seem to bind variables to the WHERE clause.
    Below is what I have got running:
        public void recreateDynView(String FromClause, String whereCompany, String whereDepartment) {
             String sql_PAGE_ITEM1 = " AND PAGE_ITEM1 LIKE :P_PAGE_ITEM1";
             String sql_PAGE_ITEM2 = " AND PAGE_ITEM2 LIKE :P_PAGE_ITEM2";
             findViewObject("DynamicView1").remove();
             String SQLStmt = "SELECT PAGE_ITEM1, PAGE_ITEM2, PAGE_ITEM3, LINE_ITEM FROM " + FromClause;
             ViewObject vo = createViewObjectFromQueryStmt("DynamicView1",SQLStmt);
             vo.setWhereClause("1=1");
               if (whereCompany != null && whereCompany.length()>0){
                   vo.setWhereClause(vo.getWhereClause() + sql_PAGE_ITEM1);
                   vo.defineNamedWhereClauseParam("P_PAGE_ITEM1",null,null);
                   vo.setNamedWhereClauseParam("P_PAGE_ITEM1",whereCompany);
               if (whereDepartment != null && whereDepartment.length()>0){
                   vo.setWhereClause(vo.getWhereClause() + sql_PAGE_ITEM2);
                   vo.defineNamedWhereClauseParam("P_PAGE_ITEM2",null,null);
                   vo.setNamedWhereClauseParam("P_PAGE_ITEM2",whereDepartment);
             vo.executeQuery();
           }However whenever I input a value into one of the bound variables, I get the following error on the page.
       1. JBO-29000: Unexpected exception caught: oracle.jbo.InvalidOperException, msg=JBO-25070: Where-clause param variable P_PAGE_ITEM1 needs ordinal index array.
       2. JBO-25070: Where-clause param variable P_PAGE_ITEM1 needs ordinal index array.In the view object which i created at design stage, I've set the binding style to Oracle Named, so it should be alright. But obviously since I'm removing the view object and creating another version of it, it doesn't have the same binding style attached by default?
    Is there a work around for this? I'm so close!
    -Chris

  • Master-detail with dynamic view object

    How can you create a view link with a view object that is dynamic? I have created a master-detail relationship on a UIX page. I change the master view object at runtime using a view definition and SQL and then I bind the view object to an iterator on a UIX page. I need the new dynamic view object to maintain the link between the detail view object. Is this possible?
    The reason why I have to change the view object at runtime is because I am implementing a search module and the tables in the from clause can be modified at runtime so I need to have a dynamic view object.
    Thanks,
    Sanjay

    After playing around with ViewObjectImpl's setQuery() method some more I found out that this solution might not work for me due to the following reason: when the user tries to sort a column in the result table, the original contents of the view object get executed instead of the run time query.
    <p>
    I would like to go back to my original solution that included creating a view definition based on the runtime query and then creating a view object from that which I bind to the RowSetIterator. The missing piece to the master-detail functionality is with the detail Iterator being in sync with the master. I have tried the following but I get a ClassCastException <p>
    DCIteratorBinding detailBinding = ctx.getBindingContainer().findIteratorBinding("DetailIterator");
    detailBinding.getViewObject().<b>setMasterRowSetIterator</b>(masterBinding.getRowSetIterator());
    <p>
    here is the relevant stack trace:
    java.lang.ClassCastException
    at oracle.jbo.client.remote.ViewUsageImpl.getImplObject(ViewUsageImpl.java:1829)
    at oracle.jbo.client.remote.RowSetImpl.setMasterRowSetIterator(RowSetImpl.java:512)
    at oracle.jbo.client.remote.ViewUsageImpl.setMasterRowSetIterator(ViewUsageImpl.java:1147)
    at oracle.jbo.common.ws.WSViewObjectImpl.setMasterRowSetIterator(WSViewObjectImpl.java:1005)

  • How to create a dynamic view

    I have 5 tables
    of which one table is transaction table which stores all the trasanctions
    it has near about 30 colms
    from which i need create a dynamic view...
    where user have to passed 5, 6 parameters and get the result .
    how can i create a precompiled view ..

    Why do you want to create a dynamic view.
    It's a bad practice. You had already all column names.
    I think , you can simply create a static view in design time.

  • How to bind to a dynamic View in UIX

    I wish to have a UIX page access data from a dynamic View (i.e. the View is created at runtime). Since the View is not created at design time, I cannot create bindings for it in the UIX page's UIModel. Therefore, how do I reference this view in the UIX page?
    Brad

    Sanjay,
    No -- but I'm experimenting with something simillar to what you mention. Actually, there is a way to iterate over each element if you made the childData attribute of your contents child of the messageChoice your rangeSet, i.e.:
    <messageChoice>
    <contents childData="${bindings.myIterator.rangeSet}">
    <option text="${uix.current.myfield}"/>
    </contents>
    <messageChoice>
    The problem is that this causes a problem with the subsequent submit, the current row, and what selection shows when the page is re-rendered. I am becoming more convinced because of this and some other things I've run into that there are either problems with using ViewLinks, or problems in UIX components where ViewLinks are involved. I'm pretty much abandoning use of ViewLinks altogether. I haven't seen much of anything work with them that isn't done exactly like tutorials and examples. And with regards to those, most tutorials and examples offer very little UIX help (most of them are JSPs), and even the ones that do have in-a-vaccuum style in-line databinding rather than database databinding (you'd think Oracle, a database company, might actually use database examples), which doesn't clarify a bunch of issues someone writing a reall application runs into.
    As to an answer -- no unfortunately. Getting an answer to any ADF/UIX question is a time-consuming, frustrating, and most often fruitless process. Of my 45 some-odd posts on this forum, about 30 of them are unresponded-to posts.
    B

  • Problem in tabular form based on dynamic view and pagination

    Hi All,
    I have a manual tabular form based on a dynamic view. The view fetches the records based on search criteria given by the user in all cases. But this view fetches ALL records when user clicks on pagination, without considering the search criteria. This is the problem I am facing.
    I am doing the following:
    Since tabular form does not support pl/sql function returning query, I cannot use a table directly. I need my results based on search criteria selected by user. Hence I created a dynamic view and used a "INSTEAD OF UPDATE" trigger to update the table.
    I use a set bind variables procedure, on load before header for setting the variables.
    This view fetches the correct data based on user search always. It creates a problem only in one situation, when using pagination in the report.
    The example can be found at:
    http://apex.oracle.com/pls/otn/f?p=19399:1:
    username = [email protected]
    pwd = kishore
    Here if "manager name" is entered as test, we get 5 records in "Summary of requests" report and 5 records in "Inactive Requests" report. When user clicks on Pagination in any of the reports, ALL the 7 records get fetched in "Summary of Requests" and 6 records in "Inactive Requests". How can I overcome this problem?? The report must consider the search variables even when pagination occurs.
    Is this because, the inbuilt "html_PPR_Report_Page" executes the region query once again by considering all search variables as NULL?
    Backend Code is at:
    http://apex.oracle.com/pls/otn/
    workspace: sekhar.nooney
    Username :[email protected]
    pwd: kishore
    application id = 19399
    My region code is something like:
    select *
    from regadm_request_v
    where access_type = :F110_REGADM
    and status <> 'INACTIVE'
    order by request_id
    My view code is:
    CREATE OR REPLACE VIEW REGADM_REQUEST_V
    AS
    SELECT *
    FROM REGREGOWNER.REGADM_REQUEST
    WHERE upper(employee_name) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_EMPLOYEE_NAME),'%')||'%'
    AND upper(manager_name) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_MANAGER_NAME),'%')||'%'
    AND upper(employee_sunetid) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_EMPLOYEE_SUNET_ID),'%')||'%'
    AND upper(manager_sunetid) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_MANAGER_SUNET_ID),'%')||'%'
    AND upper(request_date) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_REQUEST_DATE),'%')||'%'
    AND upper(USAGE_AGREEMENT_RECVD) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_USAGE_AGREMNT_RECVD,'~!@',NULL,REGADM_REQUEST_PKG.GET_USAGE_AGREMNT_RECVD)),'%')||'%'
    AND upper(STATUS) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_STATUS,'~!@',NULL,REGADM_REQUEST_PKG.GET_STATUS)),'%')||'%'
    AND upper(REQUEST_APPROVED) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_REQUEST_APPROVED,'~!@',NULL,REGADM_REQUEST_PKG.GET_REQUEST_APPROVED)),'%')||'%'
    AND upper(nvl(APPROVAL_DATE,sysdate)) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_APPROVED_DATE),'%')||'%'
    AND upper(APRVL_REQUEST_SENT) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_EMAIL_APPROVERS,'~!@',NULL,REGADM_REQUEST_PKG.GET_EMAIL_APPROVERS)),'%')||'%'
    AND upper(NOTIFY_APPROVED) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_APPROVAL_NOTIFICATION,'~!@',NULL,REGADM_REQUEST_PKG.GET_APPROVAL_NOTIFICATION)),'%')||'%'
    I would be glad for any suggestions.
    Andy/Varad any ideas? You both helped me a lot on my problems for the same application that I had faced before in More Problems in Tabular form - Please give me suggestions.
    Thanks,
    Sumana

    Hi Andy,
    The view and the package for setting bind variables work properly in my entire application other than the pagination. A pity that I came across this only now :(
    I have used this same method for holding variables in another application before, where I needed to print to PDF. I used this approach in the other application because my queries were not within the APEX character limit specified for the "SQL Query of Report Query shared component".
    In this application, I initially had to fetch values from 2 tables and update the 2 tables. Updateable form works only with one table right? Hence I had created a view. Later the design got changed to include search and instead of changing the application design I just changed the view then. Still later, my clients merged the 2 tables. Once again I had just changed my view.
    Now, I wanted to know if any method was available for the pagination issue (using the view itself). Hence I posted this.
    But as you suggested, I think it is better to change the page design quickly (as it would be much easier).
    If I change the region query to use the table and the APEX bind parameters in the where clause as:
    SELECT *
    FROM REGADM_REQUEST
    WHERE upper(employee_name) LIKE '%'||nvl(upper(:P1_EMPLOYEE_NAME),'%')||'%' .....
    I also changed the ApplyMRU to refer to the table.
    Here the pagination issue is resolved. But here the "last Update By" and "Last Update Date" columns do not get updated with "SYSDATE" and "v(APP_USER)" values, when update takes place. Even if I make the columns as readonly text field, I am not sure how I can ensure that SYSDATE and v('APP_uSER') can be passed to the columns. Any way I can ensure this? Please have a look at the issue here: http://apex.oracle.com/pls/otn/f?p=19399:1:
    I have currently resolved the "last update" column issue by modifying my view as:
    CREATE OR REPLACE VIEW REGADM_REQUEST_V
    AS
    SELECT *
    FROM REGADM_REQUEST
    I modified my region query to use APEX bind parameters itself as:
    SELECT *
    FROM REGADM_REQUEST_V
    WHERE upper(employee_name) LIKE '%'||nvl(upper(:P1_EMPLOYEE_NAME),'%')||'%' .....
    And I use the "INSTEAD OF UPDATE" trigger that I had initially written for update. The code is:
    CREATE OR REPLACE TRIGGER REGADM_REQUEST_UPD_TRG
    INSTEAD OF UPDATE
    ON REGADM_REQUEST_V
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    UPDATE REGREGOWNER.REGADM_REQUEST
    SET MANAGER_EMAIL = :NEW.MANAGER_EMAIL
    , EMPLOYEE_EMAIL = :NEW.EMPLOYEE_EMAIL
    , STATUS_UPDATE_DATETIME = SYSDATE
    , USER_UPDATE_ID = (SELECT v('APP_USER') FROM DUAL)
    WHERE REQUEST_ID = :OLD.REQUEST_ID;
    END;
    Please let me know how I can resolve the "last update" column issue using the table itself. (Just for my learning)
    Thanks,
    Sumana

  • Error in creating dynamic view

    Hi,
    I am using the following to create a dynamic view which will be created on runtime and conditions will be provided by user. Here is the code:
    CREATE OR REPLACE PROCEDURE DYN_VIEW_PROC(PARA IN NUMBER)
    AS
    DEPT_NO NUMBER(3) := PARA;
    DYN_QUERY VARCHAR2(1000);
    BEGIN
    DYN_QUERY := ' CREATE OR REPLACE VIEW DYN_VIEW
    AS SELECT EMPNO,ENAME,DEPTNO FROM EMP_NEW
    WHERE DEPTNO > :1 ';
    EXECUTE IMMEDIATE DYN_QUERY USING DEPT_NO;
    END;
    But when i execute this code i got the following error:
    SQL> EXEC DYN_VIEW_PROC(10);
    BEGIN DYN_VIEW_PROC(10); END;
    ERROR at line 1:
    ORA-01027: bind variables not allowed for data definition operations
    ORA-06512: at "SYS.DYN_VIEW_PROC", line 9
    ORA-06512: at line 1
    If i hardcode the condition in the defenation of view then it works fine. Any solution of it.

    It looks strange.And more so, since the view name seems the same across each invocation (unless the example is missing that detail). So, if two users were creating this view one after the other and then subsequently try to use it, what would each user see in their output???
    Not the rows based on their where condition, possbily.
    You would create the view only once with all the necessary joins and any static conditions. Then users would use it as and when necessary, supplying their custom where condition on top of it.
    What is the need you are trying to solve using this dynamic view creation?

Maybe you are looking for