How to compute a bind variable from another?

I am trying to create a View Criteria that has the following View Object Where Clause:
(UPPER(LOCALE) = UPPER(:LocaleCode) ) OR (UPPER(LOCALE) = UPPER(SUBSTR(:LocaleCode,1,2)))
In other words, I have a bind variable called LocaleCode, and I want to return all rows that either match the LocaleCode exactly (first part of the Where Clause), or match the first 2 characters of the LocaleCode value (second part of Where Clause).
I can't seem to figure out any way to do this straight-up using the UI for a View Criteria - there doesn't seem to be a "substring" operator when adding an item to the clause.
So, my thought was to create a second bind variable (e.g. "LocaleCode2") that was computed from the first bind variable (LocaleCode). This new bind variable would contain the first 2 characters from LocaleCode. I could then have the Where Clause be:
(UPPER(LOCALE) = UPPER(:LocaleCode) ) OR (UPPER(LOCALE) = UPPER(:LocaleCode2))
My problem is that when I define the LocaleCode2 bind variable, I see the option to set it to an Expression, but I can't seem to figure out how to build an expression that refers to another bind variable.
So, my questions are:
1. How can I have a bind variable expression refer to another bind variable (e.g. "LocaleCode2 = substring(:LocaleCode,1,2)" or something)?
2. Is there a better way to do this altogether? (What I'm trying to do is set up a view criteria for a lookup table that will return rows that match a passed-in locale exactly (language and country), or just on the 'language' part (first 2 characters).)
Thanks!

I think that bind variable accessors in the VO class is what you need. You can override the getter method of the bind variable "LocaleCode2" in order to return the first 2 chars from the bind variable "LocaleCode". Have a look at this blog post for details:
http://jdeveloperandadf.blogspot.com/2011/03/custom-java-bind-variable-in-where.html
Dimitar

Similar Messages

  • How to pass a bind variable from one SQL Report to Another

    Hello~
    I've created a link on one SQL Report page (Page 1). I would like a value from Page 1 used in the SQL on Page 2 to determine the result set. The Where Clause in SQL Query containing the bind variable is as follows:
    AND hp.party_name     = ':District_Account'
    When I run Page 1 and click on the link to execute Page 2, I get 'No Data Found'. The setup of the link is as follows:
    Column_Name = District_Account
    Link Text = #District_Account#
    Target = Page in this application
    Page = 2
    I'm a rookie working in V1.6...any help would be greatly appreciated!
    Thanks,
    Becky

    I don't see any parameter being passed in that URL. A little sample: http://htmldb.oracle.com/pls/otn/f?p=33203:4<br>
    when you click on the edit link the URL looks like this:<br>http://htmldb.oracle.com/pls/otn/f?p=33203:5:16073998852455071705::NO:5:P5_TABLE_NAME,P5_OWNER:PRESIDENTS_THEMES%2CBLUETEST<br><br>
    where P5_TABLE_NAME and P5_OWNER are the items and PRESIDENTS_THEMES and CBLUETEST are the values.<br><br>
    The SQL on the filtered report looks like:<br>
    SELECT *
    FROM all_tab_cols
    WHERE table_name = :P5_TABLE_NAME
      AND owner = :P5_OWNER<BR><BR>

  • How can I call a variable from another class

    hi
    If I have two classes : one and two
    In class two I have a variable called : action
    In class one I want to check what is the value of action.
    How can I call action?

    Thank you scorbett
    what you told me worked fine, but my problem is that MyClass2 is an application by itself that I don't want to be executed.
    Creating myClass2 as in the following:
    MyClass2 myClass2 = new MyClass2();
    [/code]
    executes myClass2.
    Can I prevent the exectuion of MyClass2, or is there another way to call the variable (action)?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to call a local variable from another component controller

    Dear Experts,
           I have created 1 component controller(Controller Name as B)and methods.In that methods I Have declared Local variable(For ex data: Lv_flag). I have Created 1 more component and name as A. I used Component B in Component A(Using component usage). In A component controller I have created methods.Now I want to call a local variable Lv-flag in this method from B controller Method. Please reply your valuable answer.

    Karthikeyan,
    Please make sure that flag attribute is under some node, say NODEA. NOW please select the interface node property and input element  of NODEA.
    now NODEA will be available in interface controller. Interface controller acts like a global  controller between two different components.
    So from interface controller you can take that flag value.
    pls reply back if you have any confusion.
    Regards
    Srinivas

  • If I imported a CD into my iTunes library from one computer how can I listen to it from another computer?

    If I imported a CD into my iTunes library from one computer how can I listen to it from another computer?  I imported music from a CD into my compter at work and when I got home and went to my iTunes account none of the songs were in my library.  I also noticed that on my Work computer there were a couple songs that I had to click on the little 'cloud' icon before I could listen to them (these were not songs I imported they were songs that were already in my library).  Not sure if this makes semse...help.

    jamie171 wrote:
    My question is since I have imported them into my iTunes library from one computer why can't I access them from my iTunes library from another computer that I have authorized to access whats in my library?  Is there no way to import songs only once into the library and then access them from all my authorized computers?
    Only if you have iTunes Match or of the computers are on the same local network.

  • How can I edit my website from another computer? and how can I create a new website next to the one, I have already? Can anyone help, please?

    How can I edit my website from another computer? and how can I create a new website next to the one, I already have? Can anyone help, please?

    Move the domain.sites file from one computer to the other.
    The file is located under User/Library/Application Support/iWeb/domain.sites.  Move this file to the same location on the other computer and double click and iWeb will open it.  Remember, it is your User Library that you want and not your System Library, as you will not find iWeb there.
    Just create a new site on the same domain file and it will appear below the other site.  If you want them side by side then duplicate your domain file and have one site per a domain file and they can then be side by side.

  • Passing value to bind variable of another table from one table

    hi,
    I have a multi select table. When one row is selected from this table (no button is clicked, only selection is done), an attribute from that selected row (say userid) should be passed to the bind variable of another table and the corresponding details of that particular userid should be displayed in the other table. When more than one row is selected, the other table should display no rows.
    My main problem is what code has to be written to pass value to bind variable and where it should be written.
    Please give me a detailed explaination as soon as possible.
    Thank you.

    Sorry, didnot add this. The table is multi select table.

  • How to set default bind variable value to task parameter value

    Hi,
    I 'm implementing a BPEL process with a human task, and I autogenerate the task form. I have a custom sql table that stores opinions, different processes should show different opinios, so my ADF table can only show records related to that process. A custom process number is sent to the task form as a task parameter. How do I use that value as the bind variable default and only value?
    Thanks,
    I.D.

    Hi Shay and thanks for your reply,
    What I want is what you have but without the login page. I tried to start my flow with an action and for some reason it didn't work.
    Is there anything else you can tell me?
    Thanks,
    I.D.
    P.S. I was able to get it to work using the aproach Frank Nimphius described in another post.
    Re: How do I prepopulate a bind variable from a session variable?
    Anyway just out of curiosity could you please tell me if I could have done it your way?
    Thanks a lot,
    I.D.
    Edited by: user8696770 on 5/Ago/2009 7:12

  • HT1386 How do I unsync my phone from another person's account?

    How do I unsync my phone from another person's account? Another family member's phone was synced into the computer. As I tried to sync my phone it automatically synced into the account of the other phone. How do I sync my phone under my name so I can sync what is on my phone?

    Create another user profile on the computer so that you can log in as yourself and have your own copy of iTunes.

  • How to call a Java class from another java class ??

    Hi ..... can somebody plz tell me
    How to call a Java Class from another Java Class assuming both in the same Package??
    I want to call the entire Java Class  (not any specific method only........I want all the functionalities of that class)
    Please provide me some slotuions!!
    Waiting for some fast replies!!
    Regards
    Smita Mohanty

    Hi Smita,
    you just need to create an object of that class,thats it. Then you will be able to execute each and every method.
    e.g.
    you have developed A.java and B.java, both are in same package.
    in implementaion of B.java
    class B
                A obj = new A();
                 //to access A's methods
                 A.method();
                // to access A's variable
                //either
               A.variable= value.
               //or
               A.setvariable() or A.getvariable()

  • How do I control my mac from another mac not in the same network?

    How do I control my mac from another mac not in the same network? Thanks

    You can do it manually, but it is much simpler if you use a tool such as Back To My Mac, LogMeIn, or something like that. Those programs enable you to connect to your computer through your router without you having to adjust the router settings manually.

  • Bex exit Variable from another one.

    Hi Expert,
    Do you Know how to define a value for a variable from another that is navigable in the bex query. In other words, when i change a value during the OLAP navigation in the query, another variable must change on the basis of the first one. The first variable isn't a "variable selected from user" on the start of the query but is a "mandatory" with a default value. When the default is changed on the OLAP,  another variable must change.
    How can I do?
    Thanks.

    OK. I see - just to be sure: You dont want to call the variable screen, when making the change, right? That is how I understand it, if I am wrong, you can use an exit variable for ZC_FASCIA and fill it depending on what was set in 0calmonth variable.
    So, assuming you dont want to call the variable screen, have you tried setting the dependent variable to changeable during query navigation? I dont think it works, but anyway, try it out...
    One way of "solving" your requirement of "set value for Y when X is changed by user" could be to use a compounded characteristic where you compound ZC_FASCIA with 0calmonth. I think you should be able to compound ZC_FASCIA = 1 with 0calmonth = <blank>...
    Next, create a variable for this new char. Using a default should be possible and it would have to be changeable during query navigation and let users change the default month without calling the variable screen.
    I dont know if this works/helps...
    Regards
    Jacob
    P.S: Your requirement only seems to come from the "need" to have 0calmonth = #. If you did not need the #, you would always have 2 for ZC_FISCIA... so I was wondering why you need the blank month? Something with an annual value stored in # month??
    Edited by: Jacob Jansen on Jan 29, 2010 9:38 PM

  • How can i create "bind variable"

    How can i create "bind variable" in my DB to support any procedure in my DB.
    Thank you very much.

    In SQL*PLUS we can defined bind variable
    SQL>var x varchar2(250); -- Is x bind variable or i'm misunderstand ?
    and ... in my procedure i can used ' &x ' to pass valued of 'x' from sql prompt to my procedure.
    but i'm not sure variable x is still remain in DB because i need to pass variable
    " v_stmt := 'and employee_id between ..... ' " from FORM to PROCEDURE in DB
    how can i do

  • How to properly set bind variables

    Dear All,
    I am currently confused about how to properly set my Bind Variables
    I have this view using HR standard schema
    Select *
    from Employees
    where EMPLOYEE_ID = :EMP_IDI somehow see three options on how to use this bind variable in an application module.
    Option 1:
    ViewObjectImpl view = this.getEmployeesView();
    VariableValueManager vm = view.ensureVariableManager();
    vm.setVariableValue("EMP_ID", value);
    view.executeQuery();Option 2:
    ViewObjectImpl view = this.getEmployeesView();
    view.setNamedWhereClauseParam("EMP_ID", value);
    view.executeQuery();Option 3:
    EmployeeViewImpl empView =this.getEmployeesView();
    RowSetIterator it = empView.createRowSetIterator(null);
    empView.setEmployeeId(value);
    empView.executeQuery();Question is which is which and what should I use?
    JDEV 11G PS3

    I use is this
    DCIteratorBinding iteratorStatus = Util.getIterator("NameIterator");
    operationBinding.execute();
    Util is reserved in a class.
    public static DCIteratorBinding getIterator(String iteratorName){
    return getDCBindings().findIteratorBinding(iteratorName);
    }

  • How to use the bind variable in custom.pll

    Hi,
    How to use the bind variable in custom.pll.Its through error.
    any one gem me.
    very urgent.
    M.Soundrapandian.

    Hello,
    Please, ask this kind of questions in the e-business forum.
    Francois

Maybe you are looking for

  • How to measure true CPU usage?

    Hello, I have a program that runs on a Windows XP 32 bits machine with JRE 6u16 (8 [email protected], 16gig ram). This program gets 100,000 messages per minute, does something with it and republishes the data. We recently moved the same program to a

  • RMAN Backup Speed

    Hi All, Our Database size is 1.3 TB and we take RMAN backup but it takes around 48 Hours to do backup in oracle 9i and in oracle 10g offers block compression can this help to reduce the backup time. Regards Balu

  • Export Oracle report formula column to XMLP

    hi i am thinking about exporting an rdf report to xmlp and i am worried about keeping my formula columns in the xmlpublisher report. what is gonna happen to them ? thx Dan

  • LMS Prime 4.2 Soft Appliance on UCS

    Hi, I'm trying to install LMS Prime 4.2 Soft Appliance on UCS C220 M3 with RAID controller . I have configured RAID 1 and using Cisco_Prime_LAN_Management_Solution_4_2.iso, but when i boot from KVM DVD I received this error: Do you have any ideas how

  • Macbook freezing in dock

    Hello all, I just got a new macbook and i have had it for about 2 weeks. It has frozen 3 times now after I try to open a program from the dock. sometimes the icon just keeps bouncing or the screen will simply just freeze. Any ideas please!!! Thank yo