[b]how to assign whole expression to a temporary variable[/b][/b]

Good afternun. Can someone help me how to assign the whole expression to a temporary variable. The expression is
id = catDao.findByPK(info.getCategoryId());
Thanks in advance and may I know how to validate the temporary variable?

You can do this with an anonymous class and a command pattern.
interface LazyEval {
   public Object getValue();
LazyEval le = new LazyEval() {
  public Object getValue() {
    return catDao.findByPK(info.getCategoryId());
id = le.getValue();However, this sound like a solution to a problem which should be done another way.

Similar Messages

  • How to Assign a Field value to a Variable??

    Dear All,
    Kindly let me know, if <b>"HOW TO ASSIGN A FIELD VALUE TO A VARIABLE????"</b>
    Situation is, we have a Field (OBJK-TASER) in which 2 tables (SER01 & SER03) are stored. And we want to access names of the Tables which are there in the field(TASER) in  (OBJK) table  to a variable and then passing that variable to the sql query as a table name to get data accessed dynamicaly.

    try this
    select TASER from OBJK into table it_table.
    loop at it_table.
    select field1 field2 from (it_table-table) into table it_fields.
    endloop

  • How to assign whole Function Group in a Transport

    Hi Experts,
    I have to transport a big Function Group from one system to another. So how i can assign whole Function Group to a Transport without going each and every function module (includes and text) and attaching them to Transport.
    Thanks in advance.
    Regards,
    Anil

    Hi Amit,
    I tried this option. it was not accepting the Transport Request.
    Please, give some details.
    Regards,
    anil

  • How to assign bean value to a local variable in JSP using struts.

    Hi everybody!
    I've a problem that puzzled me on how to assign a bean value to a local variable like String in JSP using struts.
    we can have someting like this to display the value
    <bean:write name="detailService" property="status" />or
    <bean:define id="theStatus" name="detailService" property="status"/>
         This is country: <%=theStatus%>but an error occured when I tried like this:
    String currentStatus = "<bean:define id="theStatus" name="detailService" property="status"/>";
    or
    String currentStatus = "<bean:write name="detailService" property="status" />";Is there a way to do this?.....
    Any help pretty much appreciated

    Java != JSP.
    The <bean:define> and <bean:write> tags are custom tags meant to appear in the HTML section of a JSP file, as opposed to the scriptlet section. They actually get turned into java code as part of the translation process.
    The <bean:write> tag naturally just writes out what you tell it to.
    The <bean:define> tag defines a local variable, and gives it a value.
    this should do it.
    <bean:define id="theStatus" name="detailService" property="status" type="java.lang.String"/>
    <%
      String currentStatus = theStatus;
    %>With the advent of JSTL, you shouldn't really need to use scriptlet code anymore. Personally I am for 0% scriptlet code in any jsp I write.

  • How to assign a sql statement to a variable

    hey
    i am assigning a sql statement into a variable. But in sql statement where condition i am passing a variable, i am getting syntax error while processing this statement . Could please help me
    my code is like this
    sSql:='select id from SOURCES where name=' || vc_arr(i);
    Open C for sSql;
    ....

    If you use bind variables, you don't need the single quotes, and may avoid significant performance and security problems otherwise associated with dynamic SQL.
    sSql := 'select id from SOURCES where name = :some_value';
    OPEN C FOR sSql USING vc_arr(i);

  • How to assign an expression to a statement Step in TestStand automatically?

    Hi,
    I am using VC++ and I am trying to create a statement step inside a SequenceFile already created. I can actually create my Statement type of step and insert it at the right place. Unfortunately, I can't find a way to set the Expression for this step. How can I do it?
    Here is what I tried:
    TS:tepPtr step = engine->NewStep(TS::NoneAdapterKeyName, TS:tepType_Statement);
    // Assign its name to the step
    _bstr_t calledName(stepName);
    step->put_Name(calledName);
    // Get all the sequence file variables into a PropertyObject
    // TS:ropertyObject variables = TS::Execution.GetFileGlobals ( seqFile );
    // Expression construction
    _bstr_t expression("resourceHeader=ResStr(");
    expression += _bstr_t(id_ptr) + ")";
    step->CustomActionExpression.Assign(expression);
    I get the expressions created but nothing in the Expression field.
    NB: I use TS 4.0
    Any hints are welcome.
    - Eric

    Works fine.
    But as you are looking familiar with the kind of programming I do, can I ask another question?
    There it is...
    I highly inspire myself from a solution found on a discussion. I would like to create SequenceFile Global variables for a SequenceFile object but can't get it to work. Here is the code that should do it:
    TS:equenceFilePtr CreateSeqFileGlobals(TS:equenceFilePtr seqFile) {
    TS:ropertyObjectPtr propObjPtr = seqFile->AsPropertyObject();
    propObjPtr->SetValString("Data.FileGlobalsDefaults.resourceHeader", 1 ,""); // resourceHeader
    propObjPtr->SetValString("Data.FileGlobalsDefaults.resourceFail", 1, ""); // resourceFail
    seqFile->IncChangeCount(); // Signify the file changed
    return(seqFile);
    Any idea why this doesn't do what I expect it to do?
    Regards,
    - Eric

  • How to assign an expression to an array of strings

    i'm assuming this is simple, but have searched the forums and googled and a can't seem to make this work
    all i need to do is create an element in the "to" array
    here's info from the wsdl:
    8< snip -------
    <xsd:complexType name="ArrayOfString">
    <xsd:complexContent>
    <xsd:restriction base="SOAP-ENC:Array">
    <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/>
    </xsd:restriction>
    </xsd:complexContent>
    </xsd:complexType>
    8< snip -------
    <message name="sendmsgInput">
    <part name="session_id" type="xsd:string" />
    <part name="api_id" type="xsd:int" />
    <part name="user" type="xsd:string" />
    <part name="password" type="xsd:string" />
    <part name="to" type="tns:ArrayOfString" />
    8< snip ---------
    here's an example of the XML i need to send:
    <to xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[2]">
    <item xsi:type="xsd:string">2799912345</item>
    <item xsi:type="xsd:string">27999123134</item>
    </to>
    i'm having trouble making the "Assign" activity work using copy, append or insert-after
    i'm new to BPEL and i suspect an expert can whip out the copy XML for this in no time
    if you're that expert, please reply
    thanks
    brett

    sorry about nto givng a detailed reply to your question but i hope this link would help you out.
    http://www.oracle.com/technology/products/ias/bpel/pdf/orabpel-Tutorial3-DataManipulationTutorial.pdf

  • How to assign a value to the page variable to enable partial page rendering

    This is part of my code:
    <bc4j:rootAppModuleScope name="App1"
    rendered="on@ctrl:page">
    Now, I want to change the value of "on@ctrl:page" to "true" after user click a button so that part of the page will be displayed. But how do I assign the value to "on@ctrl:page". I tried to put the followings in my even handler:
    <bc4j:setPageProperty name="on" value="true">
    <bc4j:parameter name="on" />
    </bc4j:setPageProperty>
    But it doesn't work. Could someone pls tell me how I should do it.
    Thanks a lot!
    Ling

    You should do is:
    in your event handle codes,you add the list:
    public static EventResult eventname(
    BajaContext context,
    Page page,
    PageEvent event) throws Throwable
    EventResult result = new EventResult(page);
    result.setProperty("on","true");//or "false"
    return result;
    then,
    change
    rendered="on@ctrl:page" -> data:rendered="on@ctrl:eventResult"
    also ,you should see the 5th part of 'UIX Developer's Help'

  • How to assign DOT ( current context ) to a variable ?

    If i use XML dot (.) within Href , i am getting current context (http://servername/test)
    Like this -->
    <TD>
    <xsl:element name="a">
    <xsl:attribute name="href">./</xsl:attribute>
    <xsl:value-of select="NAME" />
    </xsl:element>
    </TD>
    But if i try to assign dot to a variable ,variable is not picking up the current context.
    How can do this ?

    <xsl:variable name="a" select="."/>
    Usually this is not necessary, since you can refer to the current context using the current() function.

  • How to assign value from insert statement to variable from a trigger

    Hi,
    I got this really annoying problem and I don't know if I am doing it correctly.
    I have a BEFORE INSERT trigger on a table. When someone executes an insert statement I want to grab the value of a column from that statement and assign it to a variable and then do stuff with it. I'm stuck on the assignment.. look below..
    CREATE OR REPLACE TRIGGER CARS.geotest2_trigger
    BEFORE INSERT ON CARS.GEO_TEST2
    FOR EACH ROW
    DECLARE
    v_chainkey nchar(32);
    v_chainkey2 nchar(32);
    not_exists EXCEPTION;
    BEGIN
    :NEW.CHAINKEY := v_chainkey;
    SELECT GEO_TEST.CHAINKEY INTO v_chainkey2 FROM GEO_TEST WHERE GEO_TEST.CHAINKEY = v_chainkey;
    IF v_chainkey2 = '' or v_chainkey2 is null THEN
    RAISE not_exists;
    ELSE
    INSERT INTO GEO_TEST2 VALUES(:NEW.CHAINKEY, :NEW.BLA, :NEW.FOO);
    END IF;
    EXCEPTION
    WHEN not_exists THEN
    RAISE_APPLICATION_ERROR(-20010, 'Chainkey does not exist in parent table GEO_TEST');
    END;
    I keep getting this error
    Error: ORA-04098: trigger 'CARS.GEOTEST2_TRIGGER' is invalid and failed re-validation
    SQLState: 42000
    ErrorCode: 4098

    It isn't assigning because v_chainkey is not at the left hand side of the assignment statement.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G> declare
      2    x  number := 5;
      3    y  number;
      4  begin
      5    x := y; -- does not assign anything to y; assigns NULL to x,
      6            -- because y is NULL at this point
      7            -- so, essentially the value 5 of x is *LOST* now
      8    dbms_output.put_line('x = '||x);
      9  end;
    10  /
    x =
    PL/SQL procedure successfully completed.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G>In any case, here's what you are probably looking for:
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> drop table geo_test;
    drop table geo_test
    ERROR at line 1:
    ORA-00942: table or view does not exist
    test@ORA10G> drop table geo_test2;
    drop table geo_test2
    ERROR at line 1:
    ORA-00942: table or view does not exist
    test@ORA10G>
    test@ORA10G> create table geo_test (chainkey nchar(32));
    Table created.
    test@ORA10G> insert into  geo_test (chainkey) values ('a');
    1 row created.
    test@ORA10G> insert into  geo_test (chainkey) values ('');
    1 row created.
    test@ORA10G>
    test@ORA10G> create table geo_test2 (chainkey nchar(32), bla number(1), foo number(1));
    Table created.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G> CREATE OR REPLACE TRIGGER geotest2_trigger
      2  BEFORE INSERT ON GEO_TEST2
      3  FOR EACH ROW
      4  DECLARE
      5    v_chainkey2  nchar(32);
      6    not_exists   EXCEPTION;
      7  BEGIN
      8    SELECT GEO_TEST.CHAINKEY INTO v_chainkey2 FROM GEO_TEST WHERE nvl(GEO_TEST.CHAINKEY,'~') = nvl(:new.chainkey,'~');
      9    IF v_chainkey2 is null THEN
    10      RAISE not_exists;
    11    END IF;
    12  EXCEPTION
    13    WHEN not_exists THEN
    14      RAISE_APPLICATION_ERROR(-20010, 'Chainkey does not exist in parent table GEO_TEST');
    15  END;
    16  /
    Trigger created.
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> insert into geo_test2 (chainkey,bla,foo) values ('b',1,1);
    insert into geo_test2 (chainkey,bla,foo) values ('b',1,1)
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "TEST.GEOTEST2_TRIGGER", line 5
    ORA-04088: error during execution of trigger 'TEST.GEOTEST2_TRIGGER'
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> insert into geo_test2 (chainkey,bla,foo) values (null,1,1);
    insert into geo_test2 (chainkey,bla,foo) values (null,1,1)
    ERROR at line 1:
    ORA-20010: Chainkey does not exist in parent table GEO_TEST
    ORA-06512: at "TEST.GEOTEST2_TRIGGER", line 11
    ORA-04088: error during execution of trigger 'TEST.GEOTEST2_TRIGGER'
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> insert into geo_test2 (chainkey,bla,foo) values ('a',1,1);
    1 row created.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G>pratz
    I think the sole purpose of that "not_exists" exception is this -
    If you try to insert a NULL value for GEO_TEST2.CHAINKEY, then this trigger will throw an error even if at least one NULL value exists in GEO_TEST.CHAINKEY column.
    Not sure if that's something that you wanted.
    Message was edited by:
    pratz

  • How to add regular expression in viewobject bind variables

    Hi,
    Am using java class to set the adf bind variables
    vm.setWhereClause("FIRST_NAME = :fname");
    vm.defineNamedWhereClauseParam("fname", null, null);
    vm.setNamedWhereClauseParam("fname","Alana");
    It works fine and it returns Alana
    But what i want is to set a regular expression where it returns all the names that are starting with A.
    I tried with this.
    vm.setNamedWhereClauseParam("fname","A*");
    also
    vm.setNamedWhereClauseParam("fname","A%");
    but both didn work.
    Please help.
    Thanks,
    Hari

    Perfect... Thanks Arun.
    I tried including last name too. i.e when either of the one matches (first name or last name)
    vm.setWhereClause("upper(FIRST_NAME) LIKE upper(:fname||'%')");
    vm.defineNamedWhereClauseParam("fname", null, null);
    vm.setNamedWhereClauseParam("fname","A");
    vm.setWhereClause("upper(LAST_NAME) LIKE upper(:lname||'%')");
    vm.defineNamedWhereClauseParam("lname", null, null);
    vm.setNamedWhereClauseParam("lname","A");
    But i guess we should not give it like this as it doesnt seem to work.
    Hari

  • How does Java keep the value from temporary variable?

    Hello all:
    I have a Question for Java Assignment operator.
    Object v1;
    Object v2;
    v1 = v2; // Java assignment by reference if I understand correctly
    ///// for example:
    import java.io.*;
    import java.util.*;
    public class TestOne {
    Vector v1;
    public void changeV() {
    Vector v2 = new Vector();
    v2.addElement(new Integer(10));
    v2.addElement(new Integer(11));
    v2.addElement(new Integer(12));
    v1 = v2;
    public TestOne() {
    changeV();
    System.out.println(v1.size());
    System.out.println("0: " + v1.elementAt(0));
    System.out.println("1: " + v1.elementAt(1));
    System.out.println("2: " + v1.elementAt(2));
    public static void main(String[] args) {
    new TestOne();
    // Output from Screen
    bash-3.00$ java TestOne
    3
    0: 10
    1: 11
    2: 12
    If I understand correctly, " v1 = v2; " is assigned by reference.
    So the question is when function 'changeV' return, why v1 still holds the
    values from v2 which has been destroyed?
    Thank you
    -daniel

    firstly, the assignment is by-value, not by-reference.
    the value the variables hold is a thingy called "reference." (In other languages such as C or C++ it might be called "pointer.") So "v1 = v2" always copies the value of v2 to v1.
    secondly, the vector object that is created in the changeV method, is created on the heap, that is, in dynamic memory. The variable v2 holds only a reference to it. So when the method returns, only the reference is destroyed, not the actual object.
    The object is automatically destroyed when there are no more reachable references to it (it is "garbage collected").

  • How to add '%' to a query with bind variables

    Hi,
    I am using oracle jdeveloper 11g.
    I am trying to create a table to display rows using the below query in a jspx page,
    select * from ade_txns where series='WORKPLACE_PT.11.1.1.8.0_GENERIC' and transaction like 'rkumara%'
    I am using a view with query and binding variables as below,
    select * from ade_txns where series= :p_series and transaction like :p_QAEngineer
    I will be passing p_QAEngineer using binding variable using 'ExecuteWithParams' using a dropdown(eg: 'rkumara'). But I need to add a '%' to this value as I am using a 'LIKE' clause in my query.
    I tried using,
    select * from ade_txns where series= :p_series and transaction like :p_QAEngineer+'%'
    But this is not working for me.
    Can someone please tell me how i can solve this.
    Thanks,
    Ranjeet

    does this help also?
    How to add regular expression in viewobject bind variables
    ~Abhijit

  • Regular expression-- How to match whole word

    I use java.util.regex in my case,
    my problem is following:
    here is a sentence: "oRs As ordoRs"
    i use this pattern: (?!\w)oRs(?<!\w)
    the first word oRs should match, but why the third word also match?
    Maybe my problem also could be scribled as following:
    How to match whole word?

    here is a sentence: "oRs As ordoRs"
    i use this pattern: (?!\w)oRs(?<!\w)
    the first word oRs should match, but why the third
    word also match?What's even more interesting, there should be no matches at all! Just because the pattern is inherently inconsistent:
    the (?!\w) requires the next char to be a non-letter, but
    at the same time this char is reqired to be a letter 'o'.
    The same thing in the end: the last char should be 's' but not a letter. So the pattern must match nothing.
    Maybe my problem also could be scribled as following:
    How to match whole word?It's simple, use word boundaries - either directed ( "\<" and
    "\>") or undirected ("\b").
    The word pattern will look like "\b\w+\b" or "\<\w+\>"
    Test it here
    http://jregex.sourceforge.net/demoapp.html

  • How to assign sessionscope variable to the bind variable in Query of VO

    Hi all,
    I want to know how to assign a sessionscope variable in the binvariable of Query in VO
    My sessionscope variable holds the value of currently selected column in the table. eg:empname of the currently selected column which is in empdetails table...
    I want display the schemes available for the selected employee in the next table..The schemes are in another table named empschemes which has the empname and empschemes as column
    I have created a vo for empschemes table with bind variable 'scheme_bind'..I need to set the sessionscope variable '#{sessionScope.empname}" to the bind variable.
    Its urgent,..Pls do reply asap
    Thanks in advance
    Nasrin

    HI,
    You can use
    adf.context.sessionScope.get("YourSessionVariable")this code for assigning VO's bind variable value.write this code where you create bind variable and do not forget click on expression radio button.
    Rafat

Maybe you are looking for

  • Safari 4: Problems with animated GIF

    Hi, since I've updated to Mac OS X 10.6 my Safari 4.0.3 has Problems with some animated GIF. Some of these smileys look strange. OS: Mac OS X 10.6.1 Mac: iMac (24-inch Early 2008)

  • How do u transfer a file from a desktop to an ipad?

    I installed itunes and have the usb cable connected. I can see the ipad. How do i transfer files from my desktop to the ipad?

  • Always on top of main page.

    Hi Experts, I have a smartform and I need to include a text on every start of main page. What can I use in order to always put the include text on the start of the next main page when the main data is overflows the first main page. I need to have the

  • Quality inspection stock for scrapping

    Hello SAP expert, In MMBE there are 2800 PC in the Quality inspection SLoc 1005.We want to scrap those 2800 PC. We want to do this with MB1A, movement type 551 or 554. With movement type 551, the quantity must be transferred to unrestricted. For move

  • Form trigger failure in WHEN-VALIDATE-RECORD still saves data

    Hi, I have a WHEN-VALIDATE-RECORD trigger on one of my data blocks. When there is an problem with the data, I use RAISE FORM_TRIGGER_FAILURE. The error dialog appears, but it's still saving the data to the database! Here is the code for the WHEN-VALI