ViewCriteria Vs BindVariables Vs whereclause: HELP!

Hey ppl,

I don't know if this question has been addressed before, I promise you that I did a good amount of research on the forum, impossible to find a convincing answer.

My question is what is the most effective approach by using the objects from view of the interrogation. I mean, when I need to change the existing when the results in clause to beautify my rank. The way I see there are 2 options:

(1) I put a where clause with bind variable clause

(2) I work using criteria from view.

What I understand so far:
I know for a fact that bind variables are extremely effective and are almost always the right thing to do. But, my question is how effective uses the criteria of comparison view. I tried to go through the documentation of viewcriteria, but can't find anything convincing. The way I see if you frequently have a change where clause (as in the clause itself whole seems to change not only the value of the parameter whereclause, you add additional variables to be queried against), view criteria is the way to go, but if you have the same where clause to be changed, but each only once the value of the variable changes We do a setwhereclause with bind variables.
Questions I would like to know the answers for (and would be grateful for the "answering machine"):

(a) "usually", which is the best way? See criteria or adjustment whereclause with whereclauseparams? or is it too loose a question deserves an honest answer?
(b) here is another big question, is it possible to use meet the criteria of display bind variables? I tried, but couldn't.

I use Jdev 10.1.2 versions and 10.3.2, have not made the move to 11 again.

Hello

"A corollary of the view criteria feature described above is that whenever you apply a new view criteria (or delete an existing one), the text of the view object SQL query is actually changed. Changing the SQL query causes the database to re - analyze the statement the next time it is executed. "If you plan to use the criteria for view filtering feature to apply values of different for basically the same criteria criteria assigns each time, you will get better performance by using a view object whose WHERE clause contains named bind variables as described in Section 5.9,"with the help of named Bind Variables.

See: http://download-uk.oracle.com/docs/html/B25947_01/bcquerying008.htm#BCGIFHHF

Frank

Tags: Java

Similar Questions

  • BindVariable setting for the iterator

    I created a viewobject that has 1 ViewCriteria. I created a page of query using ViewCriteria as query component. Everything works perfectly. Now, I've added my a few extra bindVariable a whereclause whch who aren't in ViewCriteria. I have attached my own queryListener so that I can only provide values for these bind variables before you run the query. After setting it, when I run the query, it gives me error "Missing IN or out parameters" which means that it is not picking value of bindvariable which are used in my own where clause. Any help on this?

    Hello

    But still, you must check the box. It is mandatory.

    For the default implementation: you can get more information from this link

    http://jdeveloperandadf.blogspot.com/2011/03/custom-Java-bind-variable-in-where.html

  • Trigger is not updated correctly

    Hello

    I have problem to trigger

    CREATE OR REPLACE TRIGGER TABA_temp_insert
    AFTER update
    ABOUT TABA
    REFERRING AGAIN AS NINE OLD AND OLD
    FOR EACH LINE
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    IF THE UPDATE
    THEN
    IF: NEW.status = 'WAIT' THEN
    INSERT into TABA_temp (select * from TABA where tsinvoiceid =:new.tsinvoiceid);
    END IF;
    END IF;
    COMMIT;
    END;

    This trigger is not inserting new status at TABA_temp which is "WAIT" its old insertion status which is "reported".

    Why?

    I want the new status will be inserted in the TABA_temp even if I give status =:new.status and invoiceid =:new.invoiceid whereclause

    Help, please
    Thank you
    REDA

    Try

    CREATE OR REPLACE TRIGGER taba_temp_insert
       AFTER UPDATE
       ON taba
       REFERENCING NEW AS NEW OLD AS OLD
       FOR EACH ROW
    DECLARE
       PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
       IF UPDATING
       THEN
          IF :NEW.status = 'WAIT'
          THEN
             INSERT INTO taba_temp
                (SELECT col1,col2....,'WAIT' STATUS,..., COLN
                   FROM taba
                  WHERE tsinvoiceid = :NEW.tsinvoiceid);
          END IF;
       END IF;
    
       COMMIT;
    END;
    

    * 009 *.

  • With the help of sysdate and systimestamp etc. in ViewCriteria

    Hello

    I have a VO based analytic query that performs some stacks based on time.

    This table based VO, for example 'all items sold 10 days ago 4 days ago' County, now open a search page. Which will be displayed exactly all items sold in this time.

    In a first part of the soln to achieve, I started and created Scvs for the different periods I have. For the field soldDate (timestamp), I created a condition using the clause "between (soldDate between to_timestamp(sysdate-10) and to_timestamp(sysdate-4)). But I realized that it does not work. I used the link variable and the option "expression" instead of "literal" for the value of bind variables and the VO test throws an exception. Of course, he does not expect these constructions.

    QTS is how I could accomplish this kind of condition to be applied to a VC.

    I know that I put as a sql string and add to the place where clause. A VC based soln is possible.

    I use version 11.1.x.x.x of Jdev and not 12 c .x

    Kind regards

    I'm not sure what exactly you have defined in the VC (VC Editor screenshot would probably help)

    In any case, you probably need something like this: http://adfspecialists.blogspot.ba/2012/12/adf-view-criteria-view-criteria-row.htm

    Dario

  • Autorun - ViewCriteria in a filtered Table

    Jdev 11.1.1.7

    I have an object display and display on the View object 5 criteria. I want to show these 5 in separate tables, but I see the same data (it does not apply the criteria) in all tables.

    Question: How to Auto run viewcriteria of just displayed in table form.

    Thank you.

    Hello

    Have you viewCriteria applied to instances vo in the Module of the Application.

    Refer to this Andrejus Baranovskis Blog: application of the criteria to view the Module of the Application.

    Please copy - paste the ApplicationModule XML so that we can help.

    Thank you

    Aman J

  • How to get the update since viewcriteria table?

    Hello

    My version of jdev is 11.1.1.2.3

    I created a test to view based on two tables by using a common attribute in both tables,

    I dragged this viewcriteria as datacontrols viewcriteria named perticular instance table.

    My problem is that I have to update my table (upgrade mode)

    can someone help me please...

    Thank you

    As I said before, if you drop a vc as a query with table, the table will be read-only. Drop it as a query and after the query Panel is generated drop the VO of the Victoria Cross was built on table, and then select do not read only to make it editable. Then you will need to make the change in the Panel of the query and set the property resultComponentId to the id of the table that you fell forward. Then you get the Panel request with editable table.

    Timo

  • Need help with Data Bridge/DataAssist!

    Hi all

    So Ive recently brought Data Bridge I need to create a search box on a site I'm developing. I have a limited knowledge of Dreamweaver and so advised to buy Data Bridge to help me create my search box. This is what I would like as my Web page to do.

    The site is a funeral and I need to create a page for donations with a search box, so that donors can enter the name of the deceased and therefore a name (or names that are similar to what has been entered) will appear. Next to the name will be a URL.  Every deceased person will have a unique URL, used gift payments actually being taken on this site, the URL will link to a page of different gifts for that person on another site, the link will redirect them to this site (I hope all this makes sense!).

    Ive Setup MAMP on my computer, created a database table in phpmyadmin, deamweaver connected to this base with a Recordset, created a page php DataAssist Search Wizard automatically inserts the form on my donations.html page (see below - donations.html and php)

    But I'm stuck now what to do next. The results will appear on this page or do I create a html page appear on the results and a new php page for results? I'm confused as to what I should do?

    Any help REALLY appreciated!

    screenshot.jpg

    <? php require_once('Connections/milesdata.php');? >

    <? php require_once("webassist/database_management/wada_search.php");? >

    <? PHP

    (Copyright 2005, WebAssist.com) WA database search

    Recordset: milesdata;

    Advanced: donations.html;

    Form: form1;

    $WADbSearch2_DefaultWhere = "";

    If (! session_id()) session_start();

    If ((isset($_POST["WADbSearch2"])) & & ($_POST ["WADbSearch2"]! = "")) {}

    $WADbSearch2 = new FilterDef;

    $WADbSearch2-> initializeQueryBuilder("MYSQL","1");

    statements of keyword tables

    $KeyArr0 = array ('name');

    comparison list additions

    $WADbSearch2-> keywordComparison (' $KeyArr0, "".) ((isset($_POST["Name"])))? "$_POST ['Name']:" ") ."","and","includes",",%20","%20","%22","%22",0);"

    Save the query in a session variable

    If (1 == 1) {}

    $_SESSION ['WADbSearch2_search'] = $WADbSearch2-> whereClause.

    }

    }

    else {}

    $WADbSearch2 = new FilterDef;

    $WADbSearch2-> initializeQueryBuilder("MYSQL","1");

    get a session variable filter definition

    If (1 == 1) {}

    If (isset($_SESSION["WADbSearch2_search"]) & & $_SESSION ['WADbSearch2_search']! = "") {}

    $WADbSearch2-> whereClause = $_SESSION ["WADbSearch2_search"];

    }

    else {}

    $WADbSearch2-> whereClause = $WADbSearch2_DefaultWhere;

    }

    }

    else {}

    $WADbSearch2-> whereClause = $WADbSearch2_DefaultWhere;

    }

    }

    $WADbSearch2-> whereClause = str_replace ("\" "," "", $WADbSearch2-> whereClause);

    $WADbSearch2whereClause = ";

    ? >

    <? PHP

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via PHP_VERSION < 6) {}

    $theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;

    }

    $theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);

    Switch ($theType) {}

    case 'text ':

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "long":

    case "int":

    $theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';

    break;

    case "double":

    $theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';

    break;

    case "date":

    $theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";

    break;

    case "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    @mysql_select_db ($database_milesdata, $milesdata);

    $query_milesdata = "SELECT url OF Don WHERE name = 'name' ORDER BY name ASC";

    setQueryBuilderSource($query_milesdata,$WADbSearch2,false);

    $milesdata = mysql_query ($query_milesdata, $milesdata) or die (mysql_error ());

    $row_milesdata = mysql_fetch_assoc ($milesdata);

    $totalRows_milesdata = mysql_num_rows ($milesdata);

    ? >

    <? PHP

    mysql_free_result ($milesdata);

    ? >

    DO NOT copy anything from the donation.php page is the reason why it probably doesn't just copy the code I pasted above and paste it into a new .php file - save as what you want BUT remember to point the scope of shapes on the page.

  • How to assign a value to the attribute support bean viewcriteria?

    Hello

    I have a readonly VO with the following query

    Select value attr2, attr1, attr4, attr3
    from sometable

    I have a criterion for display in the t above, something like
    attr1 =
    and attr2 =

    I dragged and dropped this criterion on a Status.jsff page in the Panel of the query with table. If the user can search the records by manually entering the values in the query Panel. In addition, there are another page Main.jsff where, if the user clicks on a button, it redirects him to the page Status.jsff carrying a digital value from the page Main.jsff. Now, I have to assign this numerical value of "attr1" criteria to display and execute this VO and show results updated in the Status.jsff page.

    I used the code below:
    ViewObject vo = appModule.findViewObject("VOName");
    ViewCriteria criteria = vo.getViewCriteriaManager () .getViewCriteria ("CriteriaName");
    criteria.getVariableManager () .setVariableValue ('attr1', numericValue);
    vo.applyViewCriteria (criteria);
    vo.executeQuery ();
    For the above code, I got an error saying that "attr1" Variable not defined in the 'VOName '.

    Then I tried to place where simple clause of
    vo.setWhereClause ("attr1 =" + numericValue);
    vo.executeQuery ();
    For this code, I got an error saying that the SQL error in the preparation of the statement. Statement: SELECT * FROM (select attr1, attr2, attr3, attr4, of VOName) QRSLT WHERE (attr1 = 1234)

    Please let me know the solution to this problem.

    You can set the variable bind display property to hide. If variable binding will not appear in the query.

    bindvariable control flag > show hint > hide.

    TUTTU JOSE

    Published by: josetuttu on November 13, 2011 21:45

  • How to reset the ViewObject/ViewCriteria

    Hello
    I use Jdev 11 g.
    I developed a simple login application that has validated the user name and password on the database table 'USERS '.
    For the validation, I added a method in my grain of support that does the following.
             AppModuleImpl am = this.getAm();
             ViewObject loginVO = am.findViewObject("AcrUsersView1");
             System.out.println("after getting VO");
             ViewCriteria uc = loginVO.createViewCriteria();
             System.out.println("after getting View criterria"+uc);
             ViewCriteriaRow loginVcr = uc.createViewCriteriaRow();
             String username = this.getLogin().getValue().toString();
             String password = this.getPassword().getValue().toString();
             loginVcr.setAttribute("Username",username);
             loginVcr.setConjunction(0);
             loginVcr.setAttribute("Password", password);
             uc.add(loginVcr);
             loginVO.applyViewCriteria(uc);
             System.out.println("setting username and password"+loginVO.getQuery());
             loginVO.executeQuery();
               if(loginVO.getRowCount() > 0){
            
                 return "gotoMenu";
               }else{
                 m1.setMessage("Incorrect username or password, please try again");
                 return "gotoLogin";  
               }
    }
              
            
    First of all I'm not sure if this is the way I should authenticate the user, but I can't find the exact material online.
    In this way, the user is validated and the control is passed to the next page that displays the user's table (using UserViewObject to create the table in the ADF).
    Basically, the idea is that the user (IE admin) connects and can now display/modify/remove the entries in the user table.
    But the problem I am facing the table user made 2 inputs but on the page, it shows only that that username, password corresponding to the ones I entered on the login screen.
    So I think the viewcriteria I added by authentication program is still used. I need to find a way to reset this object.
    I tried to use all of the following characteristics, but it did not work.
                 uc.resetCriteria();
                 uc.reset();
                 loginVO.applyViewCriteria(uc);
                 loginVO.reset();
    When I go directly to the Users.jspx page (I have not yet added any any phaslistener) it displays the table user with 2 inputs.


    Any help is appreciated!
    Thank you
    Ash

    Published by: user1175461 on July 14, 2010 10:34

    Published by: user1175461 on July 14, 2010 11:17

    Hello:
    Your custom user login page can authenticate the user against jazn (via JAAS) or database or LDAP, it is really based on your business needs. The only flaw that I see from your code is the password is plain text in the database table, one who has access to the database schema can display or are likely to change.
    You must explicitly issue: loginVO.executeQuery () again after the application of the new criteria.
    If you feel my answer, please mark it as the correct answer. If it is useful, please mark it as useful.

    Thank you
    Alex

  • Error then copy all lines in an ArrayList... help please

    Hi all

    IAM doing a little POC on the module of editing as webservices... Application iam stuck when copying the whereclause results in an arraylist... someone please help... below is the code
    public class matrixVOImpl extends ViewObjectImpl {
        /**This is the default constructor (do not remove)
         */
        ArrayList al=new ArrayList();
        public matrixVOImpl() {
        }
    public  ArrayList getCompLevels(String role){
        int x=0;
        int pos=0;
        setWhereClause("matrixEO.ROLE='"+role+"'");
        executeQuery();
        if (!hasNext())
        {
                throw new JboException("unable to find role " +role);
        }
        long i=getEstimatedRowCount();
        
        for(x=0;x<=i-1;x++){
        Row rw=getRowAtRangeIndex(x);************ //here lies the problem for me********************
       
    
    String comp= rw.getAttribute("Competency").toString();
        String lr=rw.getAttribute("LevelRequired").toString();
       
       al.add(0,comp);
      pos=pos+1;
       al.add(1,lr);
      pos=pos+1;
        }
        return al;
        
    
    }
    
    }
    
    
    
    
    
    problem is at  Row rw=getRowAtRangeIndex(x); for loop is not workin here...when i manually put zero,first(),last() in place of x works fine i get the first row ..but if i put 1,2...10 or any number i get a null pointer exception..
    
    how to get all the rows ...wch can b copied to an arraylist...can someone help pllzz.
    Published by: Oraclerr on April 10, 2009 12:31

    To iterate over a set of rows that you usually use

    while(hasNext())
    {
      Row row = next();
      // Copy your attributes
    }
    

    Timo

  • I have a lg 4 k tv (40 "40UH630V TV LG ULTRA HD 4 K) with HDMI 2. 0 and if I buy apple tv 4 can be used with HDMI 2. 0 port or do I HDMI 3 port to use this? Please help me

    I have a lg 4 k tv (40 "40UH630V TV LG ULTRA HD 4 K) with HDMI 2. 0 and if I buy apple tv 4 can be used with HDMI 2. 0 port or do I HDMI 3 port to use this? Please help me

    You can use it with your TV.

  • Need help to find an adapter for a third-party monitor

    Hi all! I find myself in need of a little guidance, and I hope that someone out there will have a quick n easy for me...

    I have a Mid-2011 27 'iMac. which has two ports Thunderbolt It is taken with a Wacom tablet that I use constantly, and the other is made by an external hard drive to a solid state, which has a built-in cable to Thunderbolt (no way to hang it on a different port). I also have a 27 "HP monitor that is currently connected via an HDMI USB adapter.

    The problem is that the HP monitor is actual "jiggy" - the USB does not seem fast enough to deal with requests for the monitor. It is almost unusable. I know I should run it via a HDMI adapter Thunderbolt, but as I have already mentioned the two my Thunderbolt ports are already in use.

    Someone at - it ideas? I need sort of three to two ports Thunderbolt hooks, but I can't seem to find anything for less than $300 that would work. (I am illiterate when it comes to the different cables, adapters, ports, etc., so I hope someone can point me in the right direction by using short words... Most of the products that I travel through list specifications that me Chicane).

    The monitor has two HDMIs and a VGA port, and my iMac has a Firewire 800 port, if that helps at all...

    2011 iMac have only 1 Thunderbolt port and there is no such thing as a Mid-2011, you must have an iMac of year later, if it has 2 ports Thunderbolt. All the 27 "iMacs, from 2012 to 2015 the current have 2 ports Thunderbolt.

  • Help with Safari!

    My macbook air from apple not to open the Web page like www.investing.com! Help! Different Web pages all okey, but it's not working!

    Works fine for me.

    What extension you have installed and activated?

    Do you have any adware installed on your MBA?

  • He can't change the region of my account! Help, please! Thank you ~ ~ ~

    Hello

    I want to change my account area. But I still balance ($0.02) so I couldn't change. Please delete my balance.

    Thank you!

    and now I can not contact the Apple Support it's always show

    We're sorry.

    We are unable to respond to your request at this time. Please try again or come back later.

    1c14bb55-ED82-4B43-9c22-fc79914a022c

    is could someone please help me contact the apple support to clear my balance or help me another way to change the region on my account please!

    Thank you!!

  • Sierra is a bomb, need help to return to El Capitan

    Could someone more at Apple just try it once to make sure that the "new and improved" operating systems actually work before releasing? With all the money goes to Cupertino, there is no money to hire testers rather than rely on Mac users? Talk about Stockholm syndrome. I'll cut to the Chase, now my computer has been upgraded to Sierra without my knowledge, and several apps are now, not to mention that I can't access my company's server today. How to return to El Capitan - can I save all my work from today and use Time Machine to restore my machine? If this isn't the case, should I really erase everything and start from scratch? Someone please stop me to jump on a ledge, I have work I need to pass on to customers. Any suggestions, help, you can give would be appreciated. Carl

    Restore your backup, and if you do not upgrade your Mac, who did? Maybe you should tell them not to do the without you knowledge or approval.

Maybe you are looking for