Assign numeric value to a variable from an item

Someone please help me. I am attempting to assign a variable a numerical value from a text field. For example,
my text field item is :P202_AMOUNT. How do I assign the number that is entered into this item to a PLS_INTEGER variable? I have attempted to uss this line of code but it hasn't worked:
v_amount PLS_INTEGER := :P202_AMOUNT;
Please help.
-Stefano

Stefano,
The code you showed will work in the declaration section of a PL/SQL block that is part of your application's metadata (region, process, computation, etc.). Perhaps you are attempting to compile such a block externally using the bind variable. If that is the case, try v('P202_AMOUNT') instead. Or maybe your question is about format masks... How about giving us a bit more to go on?
Scott

Similar Messages

  • Assigning a value to a variable from a .txt file

    Hello, I'm having a slight problem doing this.
    I have a text file called text.txt, and within it is the text "one two" (minus the speechmarks).
    I'm simply trying to assign the second one of these words, (i.e. "two"), to a string variable of mine called second.
    import java.util.*;
    import java.io.*;
    public class Class
        public static void main() throws FileNotFoundException
            FileReader file = new FileReader("C:\\Documents and Settings\\Admin\\Desktop\\numbers.txt");
            Scanner scanner1 = new Scanner(file);
    String first = scanner1.next();
    //String second =   // this is the part I don't know.
    System.out.println(first); //this works fine, and shows "one"
    System.out.println(second) // this is what I'm trying to make work, by showing "two".
    }I hope I've explained myself clearly.
    Thanks a lot, I'm really struggling with this seeminly-simple problem.

    The Scanner API has good examples of how to use the class's methods. Try
    String second =scanner1.next();And change the name of your class from "Class" to something else. Java uses that name for one of its classes.

  • Assign value to ODI variable from Jython

    Hello Experts,
    I have a procedure where I'm using Jython code. I want to assign a value to an ODI project variable from a Jython function:
    Example:
    #COUNTER = len(v_jythonList) ---> being #COUNTER the ODI project variable and len() the jython function
    Now, i noticed that using ODI variables adds # sign which is use for comments in Jython code. Is there a way to assign values to ODI variables from Jython script?
    Please help!.
    Thanks.
    Pablo.

    Hi,
    Does this post help you :- How to assign value for a ODI variable from Jython Script
    Doc id 424579.1 on metalink should help.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to check empty string and null? Assign same value to multiple variables

    Hi,
    1.
    How do I check for empty string and null?
    in_value IN VARCHAR2
    2. Also how do I assign same value to multiple variables?
    var_one NUMBER := 0;
    var_two NUMBER := 0;
    var_one := var_two := 0; --- Gives an error
    Thanks

    MichaelS wrote:
    Not always: Beware of CHAR's:
    Bug 727361: ZERO-LENGTH STRING DOES NOT RETURN NULL WHEN USED WITH CHAR DATA TYPE IN PL/SQL:
    SQL> declare
      2    l_str1   char (10) := '';
      3    l_str2   char (10) := null;
      4  begin
      5  
      6    if l_str1 is null
      7    then
      8      dbms_output.put_line ('oh STR1 is null');
      9    elsif l_str1 is not null
    10    then
    11      dbms_output.put_line ('oh STR1 is NOT null');
    12    end if;
    13  
    14    if l_str2 is null
    15    then
    16      dbms_output.put_line ('oh STR2 is null');
    17    elsif l_str2 is not null
    18    then
    19      dbms_output.put_line ('oh STR2 is NOT null');
    20    end if;
    21  end;
    22  /
    oh STR1 is NOT null
    oh STR2 is null
    PL/SQL procedure successfully completed.
    SQL> alter session set events '10932 trace name context forever, level 16384';
    Session altered.
    SQL> declare
      2    l_str1   char (10) := '';
      3    l_str2   char (10) := null;
      4  begin
      5  
      6    if l_str1 is null
      7    then
      8      dbms_output.put_line ('oh STR1 is null');
      9    elsif l_str1 is not null
    10    then
    11      dbms_output.put_line ('oh STR1 is NOT null');
    12    end if;
    13  
    14    if l_str2 is null
    15    then
    16      dbms_output.put_line ('oh STR2 is null');
    17    elsif l_str2 is not null
    18    then
    19      dbms_output.put_line ('oh STR2 is NOT null');
    20    end if;
    21  end;
    22  /
    oh STR1 is null
    oh STR2 is null
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Can one assign a numerical value to a variable?

    Hi All,
    Good afternoon,
    I am currently working on a form that has strings as values in 2 different listboxes, and depending on what is selected a message pops up. Here is the script I wrote, but it does not seem to work right
    var a=aKlaclistbox.raWvalue=="SSK";
    var b=bZlaslistbox.raWvalue=="SGT";
    a.value=1;
    b.value=2;
    if(a > b){
        xfa.host.messagebox("You cannot select a lower officer as the rating officer");
    It does not work, and I am just wondering if there is any way I can get around it so that I can compare the values. I need help from anyone on this forum.
    Thanks
    v/r
    Tammy

    There's probably a better way of doing this, as, depending on how many ranks you have, it could get cumbersome. Like using an array or something like that but not sure how to accomplish that.
    If there are a lot of ranks to compare I think I'd suggest reworking things so that you can use the numeric value of the list box, it will be much easier in the long run.
    As I mentioned above, I don't think the following is valid code:
    var a=aKlaclistbox.raWvalue=="SSK";
    Nor is (unless dealing with global variables):
    a.value=1;
    I think you need to do something like the following (hopefully someone else around here might have a better idea!):
    var a;
    var b;
    if (aKlaclistbox.rawValue == "SSK") {
         a = 1;
    if (bZlaslistbox.rawValue == "SGT") {
         b = 2;
    //You would need a series of else/if with the above to map the different rank values.
    if (a > b) {
       xfa.host.messagebox("You cannot select a lower officer as the rating officer");

  • Assign a value to a variable

    Kind of a newbie question here.  In TestStand I use an action (ReadTemp see attached) to call a .vi that reads a temperature from a sensor.  One of the parameters in the action (the return from the vi) is the temperature value as a DBL.  I would like to assign that numeric value to a FileGlobal variable to decide which test step get executed next.  It doesn't seem like this should be difficult but I don't know how to do it.  Any help would be appreciated.
    Solved!
    Go to Solution.
    Attachments:
    Test.seq ‏11 KB

    I can not read your attachment at the moment but I notice that you are using TestStand 4.1
    So you should be able to assign your FileGlobal to the output connection of your VI but you have to make sure you have connected this output in your VI to the VI's connector pane. Back in TestStand SeqEditor, If you are not seeing this connection try doing a reload prototype.
    Regards
    Ray Farmer

  • Error  while assigning resultset value to Querytable variable in Coldfusion 10

    We are upgrading from coldfusion 8 to 10. Internally we were using java function to to get the data.
    In java function we have a resultset object, if we assign this resultset value to Querytable variable, we are getting below error. This code was working fine in coldfusion 8.
    Detail    This exception is usually caused by service startup failure. Check your server configuration.
    Message    The Runtime service is not available.
    StackTrace    coldfusion.server.ServiceFactory$ServiceNotAvailableException: The Runtime service is not available. at coldfusion.server.ServiceFactory.getRuntimeService(ServiceFactory.java:117) at coldfusion.runtime.RequestMonitor.<clinit>(RequestMonitor.java:14) at coldfusion.sql.QueryTable.populate(QueryTable.java:358) at coldfusion.sql.QueryTable.populate(QueryTable.java:283) at coldfusion.sql.QueryTable.<init>(QueryTable.java:96) at com.myCompany.myClass.myFunct(myClass.java:627) at
    Here is the function which is causing error.
    static private QueryTable myFunct(String userId, SessionFactory sf) {
            PreparedStatement pStmt = null;
            ResultSet rs = null;
            QueryTable ret = null;
             try{
                Query q = sf.getCurrentSession().getNamedQuery("ListUsers");
                pStmt = sf.getCurrentSession().connection().prepareStatement(q.getQueryString());
                rs = pStmt.executeQuery();// works fine till here
                ret = new QueryTable(rs);  // error line         
                rs.close();
            }catch(Exception e){
                e.printStackTrace();
                throw new RuntimeException(e.getLocalizedMessage());
            return ret;
    Can you provide some help on this. Please let me know if you need any other details.

    We have found this error is logs
    coldfusion.runtime.Encryptor$InvalidParamsForEncryptionException: An error occurred while trying to encrypt or decrypt your input string: The input and output encodings are not same..
        at coldfusion.runtime.Encryptor.decrypt(Encryptor.java:303)
        at coldfusion.runtime.Encryptor.decrypt(Encryptor.java:284)
        at coldfusion.runtime.CFPage.Decrypt(CFPage.java:5353)
        at coldfusion.runtime.CFPage.Decrypt(CFPage.java:5326)
        at coldfusion.runtime.CFPage.Decrypt(CFPage.java:5458)
        at com.vmware.vcp.service.impl.EncryptColdFusionImpl.decrypt(EncryptColdFusionImpl.java:65)
        at com.vmware.vcp.web.servlet.ApplicationConfigServlet.initEmailService(ApplicationConfigSer vlet.java:119)
        at com.vmware.vcp.web.servlet.ApplicationConfigServlet.init(ApplicationConfigServlet.java:51 )
        at javax.servlet.GenericServlet.init(GenericServlet.java:160)
        at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:121)
        at coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:59)
        at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5001)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5278)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:722)

  • Assigning Javascript value to ABAP variables

    Hi Experts,
    I have written the HTML code mixed with Javascripts to create a table in the 'View' of a BSP Component.
    I was able to set the value of assign the value of ABAP parameters into HTML fields.
    This table has some input fields. I need to fetch the value of input parameters which has been entered by screen on an event which is present in Overview Page.
    I can calulate the value mentioned in input field but i am not able to assign the same value to ABAP parameter for further processing.
    I have already referred the following link but it did not work.
    Assign Javascript variable to Abap variable
    Please help me how i should i acheive it.
    Thanks In Advance,
    Rajeev Singh

    Hi,
    I am not understanding your problem and what you want due to description, but it seems to be very similar to a post which I answered very recently [here|How to return values from a BSP page to Javascript;.

  • Assign a value to class variable

    I want to define a class variable in class. And I want all subclasses of that class ot have a different value for that class variable. How can I do that?
    public class BaseClass {
      public static String tableName = "";
    }Now if I have a ClassA and I want to assign a value like this :
    public class ClassA extends BaseClass {
      tableName = "location";
    } I got an error message.
    I can move it in a static initializer block but then it will only work when the class is loaded. In my case its possible i want to get this value without loading the class.
    Ditto if i move it to constructor.
    Any input? Thanks

    Are you saying that if i have 2 classes ClassA and
    ClassB inherited from BaseClass, then both are
    sharing the same copy of 'tableName' staticvariable?
    If yes then I should go with an instance variable.No, I am saying that you can easily declare a
    tablName in A and another tableName in B.
    A.tableName will be shared between all the instances
    s of A. B.tableName will be shared between all the
    instances of B. And BaseClass.tableName is
    irelevant. I think you try to use
    BaseClass.tableName as some kind of template for
    sub-classes, but this does not happen: you need to
    declare tableName again and again in each subclass.
    IThanks for clarifying. Each class needs to have a variable "tableName" and it needs to have one copy of this variable for all of that class's objects. 2 classes will not have the same value of this tableName variable.
    Thats why I was defining it as static variable. And I define it in BaseClass so that I dont have to define it again in each subclass.
    Is there any better way? Thanks

  • How to assign a value to ODI Variable using ODI Procedure

    Hi ,
    Is it possible to assign a value to a ODI Variable using ODI Procedure ?
    If it is possible how we can do that.
    BEGIN
    IF #Counter=1
    Then
    #Next_Increment:=#Counter+1;
    End if;
    END;
    In my example I have 2 ODI Variables #counter and #Next_increment.
    I am trying to assign VALUE TO A ODI VARIABLE #next_increment from another ODI Variable #counter.
    thanks
    prasanna

    Prasanna,
    I have a similar requirement where I need to assign values to ODI variables within a procedure. How do we make use of an ODI package to accomplish this ?
    Actually, I have a sequence of ODI steps, and there is a call to a procedure 'LOG ERROR' from every step which gets called in case error occurs in any step. I just need to identify from which step the error came.
    Please help.

  • How to assigne a value to UNIX variable inside a oracle plsql block

    Hi All,
    How can a assign a value to my UNIX (Shell script)variable inside a oracle procedure and read it back from shell script.
    Can you please help me out regarding this.
    Thanks in advances.
    Regards
    Krishna Shrivas.

    SQL> create or replace function setvar return varchar2 is
      2  begin
      3     return('SOMETHING');
      4* end;
    SQL> /
    Function created.
    SQL> get readvar
      1  select setvar from dual
      2  /
    SETVAR
    SOMETHING
    SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options
    [oracle@linuxas tmp]$ cat readvar.sh
    MYVAR=`sqlplus -s scott/tiger @readvar`
    echo $MYVAR | awk '{print $3}'
    [oracle@linuxas tmp]$ ./readvar.sh
    SOMETHING
    [oracle@linuxas tmp]$

  • XSL-How to get value of a variable from inside loop-- to the outside loop?

    Pls help
    hi im currently working on this xsl file..
    This works on generating a txt file,my problem right now is
    ' how can i get the value of a variable generated from the inside forloop,
    i have to get the total,sum value of this variables after performing the loop
    ***this is the for loop
    <xsl:for-each select="OutboundPayment">
    <xsl:variable name='id' select='generate-id(OutboundPayment)'/>
    <xsl:sort select="PaymentNumber/CheckNumber" data-type="text" />
    <xsl:variable name='PValue' select='format-number(100*PaymentAmount/Value,"0000000000000")'/>
    <xsl:value-of select='$id'/>
    <xsl:text>D</xsl:text>
    <xsl:value-of select='$DDate'/>
    <xsl:value-of select='$Batch'/>
    <xsl:text>3</xsl:text>
    <xsl:value-of select='format-number(PaymentNumber/PaymentReferenceNumber,"0000000000")'/>
    <xsl:value-of select='format-number(PayeeBankAccount/BankAccountNumber,"0000000000")'/>
    <xsl:value-of select='substring(Payee/Name,1,20)'/>
    <xsl:value-of select='$PValue'/>
    <xsl:variable name='Addend' select='concat($DDate,substring($DAcct,5,5),$Batch)'/>
    <xsl:variable name="LHash">
    <xsl:call-template name="GetHash">
    <xsl:with-param name="A1" select="$PValue" />
    <xsl:with-param name="A2" select="$Addend" />
    </xsl:call-template>
    </xsl:variable>
    <xsl:value-of select="concat('[',$LHash,']')" />
    <!--LHash*i have to get the total amount of this one from the outside loop /---->
    <xsl:call-template name='NewLine'/>
    </xsl:for-each>
    <!--I have to put in here the total value of that LHash/---->
    <!--This is the template on how to get the value of that variable in the inside loop/---->
    <xsl:template name="GetHash">
    <xsl:param name='A1'/>
    <xsl:param name='A2'/>
    <xsl:variable name='TwoSum' select='format-number($A1+$A2,"000000000000000")'/>
    <xsl:variable name='Weight' select='317191314191112'/>
    <xsl:call-template name="WDigit">
    <xsl:with-param name="Cnt" select="15"/>
    <xsl:with-param name="Sum" select="$TwoSum"/>
    <xsl:with-param name="Wgt" select="$Weight"/>
    <xsl:with-param name="Tot" select="0"/>
    </xsl:call-template>
    </xsl:template>
    <xsl:template name='WDigit'>
    <xsl:param name='Cnt'/>
    <xsl:param name='Sum'/>
    <xsl:param name='Wgt'/>
    <xsl:param name='Tot'/>
    <xsl:choose>
    <xsl:when test="$Cnt > 0">
    <xsl:variable name='Multip' select='substring($Wgt,$Cnt,1)'/>
    <xsl:variable name='Factor' select='substring($Sum,$Cnt,1)'/>
    <xsl:variable name='Prduct' select='$Multip$Factor'/>
    <!--xsl:value-of select="concat($Tot,'[',$Cnt,']')"/-->
    <!--xsl:value-of select="concat($Multip,'x',$Factor,'=',$Prduct)"/-->
    <!--xsl:call-template name='NewLine'/-->
    <xsl:call-template name="WDigit">
    <xsl:with-param name="Cnt" select="$Cnt - 1"/>
    <xsl:with-param name="Sum" select="$Sum"/>
    <xsl:with-param name="Wgt" select="$Wgt"/>
    <xsl:with-param name="Tot" select="$Tot+$Prduct"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <xsl:variable name="Rem" select="$Tot mod 11"/>
    <xsl:variable name="Chk" select="11 - $Rem"/>
    <xsl:value-of select="format-number(concat($Tot,$Chk),'00000')"/>
    </xsl:otherwise>
    </xsl:choose>
    <xsl:template name='GetTotal'>
    </xsl:template>
    Thanks in advance for those who are willing to help.
    -Leighya

    It would have helped if you had posted your code as CODE but as it is, I could hardly read it. My guess about what you are asking is, if you want a template to return a value, just write that value to the result stream inside the template.
    If that wasn't what you were asking, then please post your code in a readable format.

  • Assigning a value to two variables

    I need to assign the same value to two variables is there a way to do this like in some other languages.
    e.g. I have the following currently:
    l_test := 'valval'
    l_counter := 'valval'
    I want to condense this down into something simpler such as:
    l_test := l_counter := 'valval'
    Is anything like this possible?
    Many thanks in advance.

    Because I need to build up two queries gradually since they depend on situations at runtime i.e. I cannot just write the query in one statement and run it since it is built up gradually based on the application.
    One is to obtain the results of the query and the other is purely to count up the results. The reason I am doing this is because it is more efficient than running two CURSORs which is the current situation.
    This will result in a cursor containg the results to loop through and a value which equals the number of results. Where the variables will have the same added to them is with the WHERE clause, since the conditions don't change just how they are stored changes. i.e. One is CURSOR to loop through and one is a straight value.

  • Want to assign a value to a dff (from a sql )whenever the record is saved

    Hi
    I am new to OAF and would like to know how can i extend my VO and assign a value returned by a sql which returns a value on the basis of some fields from some fields in the same VO .
    Thanks
    Narinder

    Narinder,
    You can extend the SEEDED VO by creating a new VO and using the extends property in the VO wizard to refer to the seeded VO. Now in the new VO query you can make changes as appropriate to retrieve your values. The last step is to substitute this VO in the Applicatin so that the newly created Custom VO is used instead of standard to make sure your changes are visible.
    Best would be to read the section on Substitution in the Dev guide.
    Regards
    Sumit

  • Is there a way to request values of configuration variables from EM?

    Hi, All.
    Please advise is there a way to request values for some configuration variables from EM.
    For example there is a variable - DefaultRowsDisplayedInDownload.
    How can I get its value in Repository or Analyses?
    My use case is: disable navigation in aggregated report with count > DefaultRowsDisplayedInDownload
    Thanks in advance.

    I dont think you can call them in analysis since these tags are used in the form of xml files used as instructions to the application, within the application you may not use them.
    More over there is no syntax as obiee variable to call them.
    if helps pls mark as correct/helpful

Maybe you are looking for

  • Help Ipod Menu is empty of song names but files acessible thru iPod Control

    Hi when I scroll to Ipod / Music / Artists etc. Nothing shows up. However when I view hidden folders and look in the Ipod_control/Music folder all the songs are still there listed in folders such as FE1 etc. I've checked for the Itunes DB file in the

  • Finder dies when opening Applications

    Whenever I open Applications, regardless of which user account I'm logged in as, the Finder dies. Starting apps from the doc does this too. Some of them will actually start up, some won't, but in any event the finder dies and restarts. Help! Thanks,

  • N95 RM-159 V 20.0.015 Pictures quality [HELP].

    After upgrade firmware in my N95 pictures looks realy bad now. Before everything was ok. Can someone tell me why? What I done wrong? Can I put old firmware in to my phone?Message Edited by adam_wlkp on 03-Dec-200702:49 AM

  • NAC incorrectly identifies AV

    We are using the AnyConnect client (v3.1.04063) and NAC agent (v4.9.3.5). Some of the clients are not successfully detecting that one of the NAC requirements is present (Microsoft Systsem Center Endpoint Protection - is installed and updated to withi

  • Service PR price unit change

    Hi all, I would like to make the currency field editable in service PR generated from MO ? REGARDS pushpa