[SOLVED]overriding VO's SQL query in an application module

Hi, can anybody help me in searching examples of everriding some aspects of VO in an application module.
As i learned we can override, for example the "WHERE" clause of an VO's SQL query in different application modules, using as i supply the addWhereClause method on SomeViewObjImpl object.
... but are there any examples of using this possibility? Should i create a custom method in application module java class?
Thanks in advance. Best Regards.Alex.
Message was edited by:
Timin
Message was edited by:
Timin

Hi, can anybody help me in searching examples of everriding some aspects of VO in an application module.
As i learned we can override, for example the "WHERE" clause of an VO's SQL query in different application modules, using as i supply the addWhereClause method on SomeViewObjImpl object.
... but are there any examples of using this possibility? Should i create a custom method in application module java class?
Thanks in advance. Best Regards.Alex.
Message was edited by:
Timin
Message was edited by:
Timin

Similar Messages

  • How can i track the all sql/query executed from application

    How we can track all sql/query that has executed or being executing on oracle database server 10g r2.
    regards
    Prabhaker

    select s.sid,
           s.status,
           s.process,
           s.osuser,
           a.sql_text,
           p.program
    from v$session s,
         v$sqlarea a,
         v$process p
    where s.sql_hash_value = a.hash_value
      and s.sql_address    = a.address
      and s.paddr          = p.addr
      and s.schemaname     = '&1'
      and s.status         = 'ACTIVE'

  • SQL Query failure in application involving GP

    Hi,
    In one of the WDJ applications I am using, there is creation of GP instance involved and within the callable object of GP, back end connectivity is obtained through RFC. This application is not working properly and when I took traces of the same, I could find out that all transactions are failing at a particular query which looks like this.
    Backends|ggp|adhn5362-1527(Oracle DB)|SQL|Prepared|Query|Select* from "CAF_GP_USRHSH" WHERE "HASHVALUE"=?
    I can see such queries wherever back end connectivity is involved. Has any one faced such error before? Is this due to some authorization issues?
    Helpful answers will be appreciated.
    Thanks,
    Shifa

    << Do not post the same question across a number of forums >>

  • Sql query slow from application but executes in 1 min in Toad

    Hello,
    When I execute a big select query from DB itself , it gives results in a min.
    But when called from .Net application it takes 10 mins to execute.
    But after trying to excute no of times, it suddenly works faster sometimes.

    Hello,
    When I execute a big select query from DB itself , it gives results in a min.
    But when called from .Net application it takes 10 mins to execute.
    But after trying to excute no of times, it suddenly works faster sometimes.

  • SQL query from C++ application using ODBC 10.2.0.4 is very slow

    Hi,
    We are using ODBC oracle driver to access 10g Oracle server from C++ apllication. But the performace is very slow.
    Recently we tried with Microsoft Oracle ODBC driver, which we found faster than 10.2.0.4 Oracle ODBC driver.
    Please let me know is anything is ther any issue with this driver or is it better to use Microsoft ODBC driver.
    Thanks,
    Sabbi

    Hi StephenEP,
    As the issue is more related to C++ programming, I would like to recommend you post the question in the Visual C++ forum at
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vcgeneral  . It is appropriate and more experts will assist you.
    Thanks,
    Lydia Zhang

  • Calling Oracle BugDB PL/SQL Package Procedures from Application Modules

    Hi Experts,
    I am using JDev 11g R2.My requirement is as follows:
    1.Create a public database link to remote bugDB using the Testing Environment.(Done)
    2.Access the data from local database to BugDB using that DB link (Done)
    3.Insert/Create a bug using the Create_Bug procedure in the API provided by BugDB(Failed).In the Application ModuleImpl class I have added the following code(Just an Example) to call the API containing a pl/sql procedure which creates a bug in the remote db table.
    public void Create_Bug(String Product, String Component, String Subcomponent, String Status) {
    CallableStatement st = null ;
    try {
    StringBuffer str = new StringBuffer();
    str.append(" BEGIN ");
    str.append(" Bug.Bug_API_V1.Create_Bug@bugtest( ");
    str.append(" Product => :1, ");
    str.append(" Component => :2, ");
    str.append(" BugNo => :3 ");
    str.append(" Status => :4 ");
    str.append(" ")
    str.append(" ); ");
    str.append(" END; ");
    st =getDBTransaction().createCallableStatement(str.toString(), 1);
    st.setString(1, Product);
    st.setString(2, Component);
    st.setString(3, Subcomponent);
    st.setString(4, Status);
    st.execute();
    } catch (SQLException sqle) {
    // TODO: Add catch code
    sqle.printStackTrace();
    } catch (NumberFormatException nfe) {
    // TODO: Add catch code
    nfe.printStackTrace();
    4.Added a managed bean to invoke this AppModuleDataControl which stores the value in the remote database.(Failed in this part).
    Its not showing any errors in the log but the bug is not created either in the remote database.Could anyone guide me where am I going wrong or what is the better way to handle this requirement.Any suggestion for materials,links or tutorials would be highly appreciated.Thanks in advance.
    Regards,
    Prasanna

    Prasanna,
    this is a public form_ and the Oracle bug database API is not public! Can you please post internal questions to Oracle internal forums and mailing lists?
    thank you
    Frank

  • Show SQL Query Info

    It seems every portal user can use 'Show SQL Query Info' at application component manage page. How to disable it?

    In case anyone is interested I found 2 methods to get round this problem:
    1. First if you are calling the url directly you may need to convert some characters to their hexidecimal equivalent to make this be interpreted correctly by the browser.
    i.e. Space = %20
    % character = %25
    & character = %26
    So in the example I used this would become:
    ?p_arg_names=costcentre&p_arg_values=B15&p_arg_names=projsearch=%25Teach%25
    Binding:
    :cost_centre binding with B15
    :projsearch binding with %Teach%
    2. The second method is to use a pl/sql stored procedure to call the report passing the parameters in as follows.
    PORTAL_CUST.P11_PROJECT_SEARCH_RESULTS.show (
    p_arg_names => PORTAL.wwv_standard_util.string_to_table2 (
    'parameter1:' ||
    'parameter2'),
    p_arg_values => PORTAL.wwv_standard_util.string_to_table2 (
    p_parameter1_value || ':' ||
    p_parameter2_value));
    Cheers,
    Gary.

  • Override a Look Up SQL Query

    Is it possible to override the look up SQL query in the Key Look Up Operator?
    Suppose I want to run the following query
    select customer, max(revenue) from CUSTOMER group by customer_id and then look up the customer id and get the max revenue from the look up and populate the target table.
    Is it possible with a Key Look Up operator or we need to use an aggregator and join it with the main flow.

    You are spot on. Thats what I have experienced while working with OWB for the last couple of months.
    1.The look up is actually a join. Dont understand then why it is called a look up. It should have been called a pseudo joiner.
    2. The second irritating part is - there is nothing called a multiple look up match policy. If more than one records are matched,then the records loaded to the target are also increased. You dont have something called " Select first match " or "Select last match" etc etc.
    3. You dont have the facility to override the look up query, which can at times be required and can be a very smart way of doing a mapping.
    3. Due to this poor functionality of the key look up operator, I was myself compelled to split a single innocent looking mapping to two parts, which is painful.
    An ETL tool having this kind of look up functionality, I am afraid is pathetic.
    I am eager to see what changes they make in 10g R2 if at all.#
    regards
    -Arnab

  • Please Solve The SQL Query

    Please Slove the Query as below:
              T1
    |     A1     |     A2     |
    |     TRUE     |     FALSE     |
    |     FALSE     |     TRUE     |
    |     TRUE     |     TRUE     |
    |     FALSE     |     TRUE     |
    Table Name is: T1 and it is having 2 columns A1 and A2.
    Question is:
    Using a simple SQL query try to get the total number of "TRUE" in the Table T1. Don't use any PL/SQL command,
    just use simple SQL command.
    Please write the full query.
    Manojit.

    select (Nvl(a.cnt_a1,0) + Nvl(b.cnt_a2,0)
    from (select count(1) CNT_A1 from t1 where a1 = 'TRUE') A
    (select count(1) CNT_A2 from t1 where as = 'TRUE') B
    Please Slove the Query as below:
              T1
    |     A1     |     A2     |
    |     TRUE     |     FALSE     |
    |     FALSE     |     TRUE     |
    |     TRUE     |     TRUE     |
    |     FALSE     |     TRUE     |
    Table Name is: T1 and it is having 2 columns A1 and A2.
    Question is:
    Using a simple SQL query try to get the total number of "TRUE" in the Table T1. Don't use any PL/SQL command,
    just use simple SQL command.
    Please write the full query.
    Manojit.

  • [Solved partially] Sql query for updates compliance

    Hello
    I'm trying (with no success) to translate the "Software+Updates+-+A+Compliance%2fCompliance+1+-+Overall+compliance" report into a sql query that must run for a specific
    Software update group and for a specific Collection ID.
    The expected result should be like the report it self, I mean 3 lines with Kpi (pourcentage).
    The main query in this report is : 
    select
    CollectionID=@CollID,
    Status=sn.StateName,
    cs.NumberOfComputers,
    PComputers=convert(float, isnull(cs.NumberOfComputers, 0)*100.00) / isnull(nullif(cs.NumTotal, 0), 1),
    AuthListID=@AuthListID
    from (select CI_ID, NumTotal, [0]=NumUnknown, [1]=NumPresent+NumNotApplicable, [2]=NumMissing
    from fn_rbac_UpdateSummaryPerCollection(@UserSIDs)
    where CI_ID=@CI_ID and CollectionID=@CollID
    ) cnt
    unpivot (NumberOfComputers for [Status] in ([0], [1], [2])) cs
    left join fn_rbac_StateNames(@UserSIDs) sn on sn.TopicType=300 and sn.StateID=cs.Status
    where cs.NumberOfComputers>0
    order by cs.NumberOfComputers desc
    I have no clue on how to replace or use fr_rbac view when run outside a report.
    Can you please help me ?
    Thanks

    Hi,
    Glad to hear that and thank you for your sharing.
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • SQL query for empty string

    I am trying to execute the following SQl query, SELECT * FROM Failure WHERE ID = '123' AND RepairAction = ' ';, using the DB Tools Execute Query.vi. This query never finds the record in my database. My database contains a record where the ID filed contains the value of '123' and the RepairAction field is an empty string. If I remove the 'AND RepairAction ' ';' text from my query statement, the record is found. I believe my problem is that I am not using the correct syntax to describe and empty string. I have tried the following: '', ' ', "", " ", and NULL as empty string arguments, and none of these work.
    I was hoping someone might be able to tell me what the correct syntax is for an empty string or if there is another approach I need to take.
    Thank you in advance for your help,
    Jim
    Solved!
    Go to Solution.

    Hi,
    While creating your table "Failure", was the column "ID" delclared as intiger or varchar? If it is intiger and you use '123' , it wont return the results. You will have to try without the inverted comas ' '.
    Regards,
    Nitzz
    (Giver Kudos to good Answers, Mark it as a solution if your problem is Solved)

  • How To Write A Sql Query to Show 0's

    I never can remember this :-/ What do I have to do to get a SQL Query to return 0 if the Count of a condition is 0?  For example lets say Joe, Jay, Jim could log on, but only Joe & Jim logged in Jay would not be returned in the query below.  What
    would I need to set-up so that All 3 users would be returned
    Select logonName, Count(Logon)
    From logonUserInfo
    where logonName is not nullGROUP BY logonName

    Currently there is only 1 table involved.  I would need a separate table?  What would this table need to hold?
    You wouldn't need a separate table unless and until you want to store who logged in at what time and so on... then your table structures looks like below..
    CREATE TABLE loginnames
    loginid INT
    name VARCHAR(30),
    GO
    CREATE TABLE loginTimes
    loginid INT,
    logintime DATETIME
    GO
    So, now you can do a left join on both tables on a certain date directly and find out who actually logined and who didn't with a count 0 for the one's who didn't login... and that will abide the principles of normalization as well...
    If you don't want to use an another table, you would have to duplicate the loginnames everytime that user logins and also you don't have a track on what date the login happened.. So you will be considering from day 1 to Till date...
    Please mark as answer, if this has helped you solve the issue.
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

  • How to bind UI component to a view object which is created from a SQL query

    I am using JDeveloper 11.1.1.2.
    I created a method in my ApplicationModule to create an instance of ViewObject dynamically based on a "voCode" passed in :
    public ViewObject loadVO(String voCode) {
    ViewObject viewObject = findViewObject(voCode);
    if (viewObject == null) {
    viewObject = createViewObject(programCode);
    return viewObject;
    I created a Client interface for this method and refreshed the data control of the ApplicationModule.
    From the "Oracle JDeveloper 11g Handbook", I should be able to create a tree binding and a methodIterator executable for the "loadVO" method via the data control of the AM.
    I tried to add the binding manually to the page definition of my jspx page as I like to see if I can replace an existing binding with this new binding.
    I was not able to add the binding as the "Create Tree Binding" required both the "Root Data Source" and "Tree Level Rules" to be specified.
    I could specify the "Root Data Source" to point to the "loadVO" and corresponding parameter but not able to add any rule.
    When I clicked on the "+" icon to add rule, nothing happened that allowed me to specify the rule (if I know what rule I need to add).
    How should I bind the application module method "loadVO" so that it can be exposed in the Data Control to provide the data for a UI component like dynamic table?
    On the other hand, I could create the "methodIterator" first for the AM method "loadVO" but I wasn't able to create a tree binding to reference the "methodIterator".
    Is it possible to invoke the loadVO method with specific parameter value via the "methodIterator" from a bean method?
    Edited by: pyin_amec on Jan 25, 2010 3:57 PM
    I corrected the subject line and change my question to better reflect the problem I tried to solve.
    Edited by: pyin_amec on Jan 26, 2010 7:41 AM

    Hi,
    This worked for me .. I created a inputtext area where I can enter a query and execute ..
    Hope it helps..
    AM Impl
         public void createVoWithQuery( String pQuery )
              ViewObjectImpl vo = null;
              if( findViewObject( "DemoVo" ) != null )
                   findViewObject( "DemoVo" ).remove();
              vo = ( ViewObjectImpl )createViewObjectFromQueryStmt( "DemoVo", pQuery );
              //  vo.setKeyAttributeDefs( new int[]{0} );
              vo.executeQuery();
         @Override
         protected void prepareSession( Session session )
              super.prepareSession( session );
              if( findViewObject( "DemoVo" ) == null )
                   createViewObjectFromQueryStmt( "DemoVo", "Select 1 from dual" );
         }Page Def
    <executables>
        <variableIterator id="variables">
          <variable Type="java.lang.String" Name="createVoWithQuery_pQuery" IsQueriable="false"/>
        </variableIterator>
        <iterator Binds="DemoVo" RangeSize="25" DataControl="AppModuleDataControl"
                  id="ViewObj1Iterator" Refresh="deferred"/>
      </executables>
      <bindings>
        <tree IterBinding="ViewObj1Iterator" id="ViewObj1">
          <nodeDefinition Name="Dummy">
          </nodeDefinition>
        </tree>
        <methodAction id="createVoWithQuery" RequiresUpdateModel="true" Action="invokeMethod"
                      MethodName="createVoWithQuery" IsViewObjectMethod="false"
                      DataControl="AppModuleDataControl"
                      InstanceName="AppModuleDataControl.dataProvider">
          <NamedData NDName="pQuery" NDType="java.lang.String"
                     NDValue="${bindings.createVoWithQuery_pQuery}"/>
        </methodAction>
        <attributeValues IterBinding="variables" id="pQuery">
          <AttrNames>
            <Item Value="createVoWithQuery_pQuery"/>
          </AttrNames>
        </attributeValues>
      </bindings>page
    <af:panelStretchLayout id="psl1" startWidth="0" topHeight="100px" bottomHeight="0">
              <f:facet name="center">
                <af:table rows="#{bindings.ViewObj1.rangeSize}"
                          fetchSize="#{bindings.ViewObj1.rangeSize}"
                          emptyText="#{bindings.ViewObj1.viewable ? 'No data to display.' : 'Access Denied.'}"
                          var="row" rowBandingInterval="0"
                          value="#{bindings.ViewObj1.collectionModel}"
                          selectedRowKeys="#{bindings.ViewObj1.collectionModel.selectedRow}"
                          selectionListener="#{bindings.ViewObj1.collectionModel.makeCurrent}"
                          rowSelection="single" id="t1" partialTriggers="::cbEx">
                  <af:forEach items="#{bindings.ViewObj1Iterator.attributeDefs}" var="def">
                    <af:column headerText="#{def.name}" sortable="true" sortProperty="#{def.name}"
                               id="c1">
                      <af:outputText value="#{row[def.name]}" id="ot1"/>
                    </af:column>
                  </af:forEach>
                </af:table>
              </f:facet>
              <f:facet name="bottom"/>
              <f:facet name="top">
                <af:panelFormLayout id="pfl1">
                  <af:inputText value="#{bindings.pQuery.inputValue}"
                                label="#{bindings.pQuery.hints.label}"
                                required="#{bindings.pQuery.hints.mandatory}"
                                columns="60"
                                maximumLength="#{bindings.pQuery.hints.precision}"
                                shortDesc="#{bindings.pQuery.hints.tooltip}" id="it1" rows="2">
                    <f:validator binding="#{bindings.pQuery.validator}"/>
                  </af:inputText>
                  <af:commandButton actionListener="#{bindings.createVoWithQuery.execute}"
                                    text="ExecuteQuery"
                                    disabled="#{!bindings.createVoWithQuery.enabled}" id="cbEx"/>
                </af:panelFormLayout>
              </f:facet>
            </af:panelStretchLayout>

  • How to pass parameter value as "where [fieldname] = [fieldvalue]" in sql query under query type in SSRS report?

    I am having trouble with passing dynamic string to sql query for executing SSRS reports.
    I am using oracle database and I want to pass where clause parameter as "where LAND_NR = 6" to my select query.
    For example: I want to execute Select * from employee :p_where.
    where p_where parameter holds value "where LAND_NR = 6"
    So it will treat as "Select * from employee where LAND_NR = 6" statement which will give me the list of records to display in my reports.
    But it's not taking correct sql command throwing an error as "SQLcommand not properly ended."
    How can I achieve this?

    You need to use dynamic sql
    But please keep in mind that since you're using Oracle you may be better off posting this in some Oracle forums
    This forum is specifically for SQL Server
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Generate PDF file from sql query

    I have a table having some now i want to perform some calculation on tht data and then want to export it into a 
    pdf file.
    All this thing thing i want to write in a sql query so tht i can put it in a stored procedure .
    Kindly suggest.

    timberwoods,
    One way is to use SSRS. You may embed a query and it generates the report which you can always download as pdf, excel etc. Look up on the net for this - that shud probably solve your requirement!!
    If not, found this at codeproject - allows you to generate pdfs - again using SSRS !
    http://www.codeproject.com/Articles/19236/Create-data-driven-PDF-on-the-fly-by-using-SQL-ser
    http://www.sqlservercentral.com/articles/Miscellaneous/creatingapdffromastoredprocedure/1104/
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

Maybe you are looking for