How to find the value variable

Hi, I am doing looping and dynamically creating the variable, after this, I will get the string that is the variable. In this stage how can I get the variable value.
For Example, pls look into the follow proc
CREATE OR REPLACE PROCEDURE VALUE_TEST AS
MYSTRING1     VARCHAR2(100);
MYSTRING2     VARCHAR2(100);
A     VARCHAR2(100);
B     VARCHAR2(100);
BEGIN
     MYSTRING1     := 'FIRST VALUE';
     MYSTRING2     := 'SECOND VALUE';
     FOR I IN 1..5 LOOP
          A := 'MYSTRING' || I;
          B := 'MYSTRING' || I;
          DBMS_OUTPUT.PUT_LINE(A || ' ' ||B);
     END LOOP;     
END;
When I print the value of A, I should get the value of MYSTRING1, that is 'FIRST VALUE'.
If anybody know, how to do that, pls let me know ASAP.
Thanx a lot.
Vijay.P

Hi Vijaykumar...
In A := 'MYSTRING' || I; you are NOT replacing your variable named 'A' with the variable named 'MYSTRING' concatenated to the value of the loop counter.
You are replacing you variable named 'A' with a character string 'MYSTRING' concatenated to the value of the loop counter. The confusion may come from the fact that the name of the variable is a character string that is identical to the character string in your replacement statement.
So you get...
MYSTRING1 MYSTRING1
MYSTRING2 MYSTRING2
MYSTRING3 MYSTRING3
&....The PL/SQL compiler intreprets the characters between the 's as a character string.
To get...
FIRST VALUE1 FIRST VALUE1
FIRST VALUE2 FIRST VALUE2
FIRST VALUE3 FIRST VALUE3
&....remove the ' so the PL/SQL compiler will reconize it as a named variable.
If you are trying to construct a variable name using concatenation, that cannot be done in PL/SQL without dynamic sql, a somewhat more complicated endeavor.
Good luck. Hope this helps.

Similar Messages

  • How to find the value of a variable in other program

    How to find the value of a variable in other program say I am in a FM and this FM is being called in from other program and I want to know some of the variable details of the program from the FM itself. Imagine if this is a txn. and I need to know the details from some of the programs while executing the same transaction
    Regards
    Vin

    Hi Vinayak,
         you will be having your first program values in internal table or some variables,
        when you are calling the second program you wii use like this,
        SUBMIT <Second Program Name> USING SELECTION-SCREEN '1000'
                           WITH s_emp(second program select-options)   IN t_emp(first program variables)
                           WITH p_chk   EQ t_chk
                           WITH p_r1    EQ t_r1
                           WITH p_month EQ t_month
                           WITH s_cust1 IN t_cust1
                           WITH p_r2    EQ t_r2
                           WITH s_cust2 IN t_cust2
                           WITH s_week  IN t_week
                           AND RETURN.
    you have pas like this to get your first program details.

  • How to find the Values of SAP Gateway Server Host  and Gateway Service Valu

    Hi All,
    I installed SAPR/3 4.7 EE on Windows. For configuring SLD and LDAP i am unable to give the SAP Gateway Server Host and Gateway Service values.
    Can any one plz suggest me how to find these values.
    Regds
    Phanikumar

    Hello, SAP Gateway Server Host and Gateway Service are used to set up rfc connectivity, that is the host name and the system number where your sld and ldap is responding, if you have no sld and no ldap , just simply uncheck that options while installing.
    Have a nice week end, Luciano.

  • How to find the value of STO

    hi SAP gurus,
    pls help me out.
    is there any T-code to find the values of STO made.

    Hi Gaurav
    PLease use the Tcode ME81
    Regards
    Aasif

  • How to find the value of date char used as exception aggregation reference

    Hi BI Gurus,
    On a BEx report I need to list three things by material:
    1)   the open (not yet delivered) Purchase Order quantities
    2)   the PO quantity to be delivered next and
    3)   the date that belongs to the next delivery
    The model supports these data i.e. for each material I can list all open quantities by Purchase Order / Item / Schedule line and the scheduled delivery dates are also available as a characteristic.
    Determining 1) is easy – as the drilldown is fixed (materials only) the open quantities get summarized for all PO-s belonging to the materials.
    To determine 2) I used a Calculated KF simply including KF 1) “=Open PO Qty” in the definition and setting Exception Aggregation (first value) with a reference char of the delivery date. This gives back the Open PO Quantity to be delivered first.
    My question is about how to determine the 3rd value (actually this is not a KPI but a characteristic value). In other words, for each materials I would need to determine the first among all of the possible delivery date char values of the open PO Items / schedule lines. This is the date the quantity shown in the 2nd KPI will be delivered on.
    Does anybody have an idea how to approach this issue?
    Thanks for you help in advance,
    Attila

    Hi Olivier,
    Thanks for your suggestion. I got a bit closer with the replacement path formula variable and the CKF. I tried to apply the same logic of KPI 2) but for some reason it did not work. Actually, it delivers the right value but only when 0SCL_DELDAT (Scheduled delivery date) is in the drilldown… But what I need is the first delivery date by Material only, and without this 0SCL_DELDAT drilldown.
    Any other ideas?
    Thanks and bye,
    Attila

  • How to find the value that is in structure???

    hi experts,
                 i am changing standard form QM_INSP_RESULT I have an field MITTELWERT in QGRES
    ie QGRES-MITTELWERT where QGRES is a structure .i need the value that is present in the field.How to find it.

    Hi Manikandan Muruganandham ,  
    To find fields the refined search is through Transaction SE84.
    Go there and find the fields of your choice.
    1> <b>ABAP DICTIONARY</b>
    2> <b>FIELDS</b>
    3> Select <b>Table fields</b> to know where you can find the field of your choice.
    Reward Points if useful.
    Thanks,
    Tej..

  • How to find the value in the table in database ?

    Hi, Could you please advise me, How to findout the data-value in the table in database ?

    what do you mean by value ?
    --Girish                                                                                                                                                                                                                           

  • How do I find the value of GWYUID from within a form?

    Hi, can someone help me with the below?
    I'm trying to determine the value of the environment variable GWYUID from within a form so I can pass this value to the fnd_webfile.get_url function at runtime to display the output of a concurrent program in a web browser.
    I've tried the below but this just brings back null. Any ideas on how to find the value at runtime in 11i?
    v_gwyuid varchar2(100) := name_in('$environments$.gwyuid');
    fnd_message.set_string('GWYUID:'||v_gwyuid);
    fnd_message.show;
    Thanks, Geoff

    wow, many, many, many.... and many thanks!
    Just add a tiny modify to check out the Batch_type
    doc_id = (select batch_id from gme_batch_header where batch_no='&batch_number' and batch_type = 0)
    Because the batch_no can be duplicated as we also create Batch and Filrm Planned Order.
    Many thanks for your support!
    P/S: Sorry for my terrible English :P

  • How to get the value of a variable defined in javascript in JSP

    how to get the value of a variable defined in javascript in/through JSP????

    In Javascript you can use the DOM to access the input element and set it's value before submitting the form. Then it's value will just be passed.

  • How to get the value of a variable in FOX?

    Hi,
    In the FOX program how to get the value of a variable defined in planning area?
    can anyone give me some sample code?
    thanks

    Adding to the last reply,
    you can use VARI(variable) to get the count of the values.
    In the latest version of BPS, you may also use the following new foreach construct:
    FOREACH var IN VARIABLE  variable_id.
    Regards - Ravi

  • How to find the most matched values in the set of map?

    Hi friends!
    I have two vectors
    vector<int> V1; vector<int> V2;
    and a map<int, set<int>> M1;
    I want to select common values from both V1 and V2 and check those values with the set in the map M1.
    For example:
    V1 contains;
    2  4  6  8  9
    V2 contains;
    4  5  6  9  10 
    M1 contains;
    1=>1  2  5  9
    2=>4
    3=>5   10
    4=>2  4  8
    5=>4   9
    6=>4   6
    7=>9  12
    When we select the common values of V1 and V2 it is 4, 6, 9.
    And we search for all 4, 6, 9 from the values of M1 which give more appropriate.
    But, no all values in the set of map.
    Then, we delete any value from 4, 6, 9, then remaining values would match any values from the map.
    From the example, if we delete 6, then remaining 4, 9 will match with 5=>4  9, or if we delete 9, then 6=>4   6. Any one of the keys can be selected.
    I know how to select the common values from V1 and V2, but I do not know how to match with the values and select the appropriate key from M1.
    Could anyone help me to solve this?

    This is not the question you asked, except perhaps in the subject. The subject is not the right place to put key features of the question. It is also important to use the body to ask just the question you want
    answered. For example your real question has nothing to do with V1 and V2, just the common vector V (e.g. 4 6 9).
    One way to solve your problem would be to create a new map
    map<int, set<int>> M2;
    with the same keys as M1. Each set of M2 should contain the elements of V that are
    not in the corresponding set of M1.
    Then pick the key of M2 that has the smallest set. If that set is empty, then the whole of V can be used. Otherwise the smallest set tells which elements of V have to be removed, and which is the desired key of M1.
    In your example, key 5 of M2 will contain just 6, so you should remove 6 from V and select key 5.
    Yes fine. I tried the following code and it creates the map M2 (NewMyMap in my code). But how to find the smallest set starting from size 1?
    #include <vector>
    #include <algorithm>
    #include <iostream>
    #include <map>
    #include <set>
    using namespace std;
    typedef vector<int> IntVec;
    typedef set<int> IntSet;
    typedef map<int, IntSet> SetMap;
    bool IsValueNotInSet(int value, IntSet& S);
    SetMap CreatNewSetMap();
    IntVec IVec; //This vector is for selecting certain keys from mySet map.
    IntVec myVec;
    SetMap mySet;
    SetMap NewMyMap;
    int main()
    IVec.push_back(3); IVec.push_back(4); IVec.push_back(5); IVec.push_back(6);
    myVec.push_back(4); myVec.push_back(6); myVec.push_back(9);
    IntSet tempS;
    tempS.insert(1); tempS.insert(2); tempS.insert(5); tempS.insert(9);
    mySet.insert(make_pair(1,tempS));
    tempS.clear();
    tempS.insert(4);
    mySet.insert(make_pair(2,tempS));
    tempS.clear();
    tempS.insert(5); tempS.insert(10);
    mySet.insert(make_pair(3,tempS));
    tempS.clear();
    tempS.insert(2); tempS.insert(4); tempS.insert(8);
    mySet.insert(make_pair(4,tempS));
    tempS.clear();
    tempS.insert(4); tempS.insert(9);
    mySet.insert(make_pair(5,tempS));
    tempS.clear();
    tempS.insert(4); tempS.insert(6);
    mySet.insert(make_pair(6,tempS));
    tempS.clear();
    tempS.insert(9); tempS.insert(12);
    mySet.insert(make_pair(7,tempS));
    cout<<"MYVEC\n";
    cout<<"-------------\n";
    for(IntVec::iterator itv = myVec.begin(); itv != myVec.end(); ++itv)
    cout<<(*itv)<<" ";
    cout<<"\n\n";
    cout<<"\nMYSET\n";
    cout<<"-------------";
    for(map<int,set<int>>::iterator its = mySet.begin(); its != mySet.end(); ++its)
    cout << endl << its->first <<" =>";
    for(IntSet::iterator sit=its->second.begin();sit!=its->second.end();++sit)
    cout<<" "<<(*sit);
    cout<<"\n\n";
    NewMyMap= CreatNewSetMap();
    cout<<"\nNEWMYSET\n";
    cout<<"-------------";
    for(map<int,set<int>>::iterator its1 = NewMyMap.begin(); its1 != NewMyMap.end(); ++its1)
    cout << endl << its1->first <<" =>";
    for(IntSet::iterator sit=its1->second.begin();sit!=its1->second.end();++sit)
    cout<<" "<<(*sit);
    cout<<"\n\n";
    return 0;
    bool IsValueNotInSet(int value, IntSet& S)
    IntSet::iterator it=find (S.begin(), S.end(), value);
    if (it!=S.end())
    return false;
    return true;
    SetMap CreatNewSetMap()
    IntSet TSet;
    for(IntVec::iterator it = IVec.begin(); it != IVec.end(); ++it)
    SetMap::iterator its = mySet.find(*it);
    if (its != mySet.end())
    TSet.clear();
    int key = its->first;
    IntSet& itset = its->second;
    for(IntVec::iterator itv = myVec.begin(); itv != myVec.end(); ++itv)
    if(IsValueNotInSet((*itv), itset))
    TSet.insert(*itv);
    NewMyMap.insert(make_pair(key,TSet));
    return NewMyMap;

  • How to get the session variable value in JSF

    Hi
    This is Subbus, I'm new for JSF framewrok, i was set the session scope for my LoginBean in faces-config.xml file..
    <managed-bean-name>login</managed-bean-name>
    <managed-bean-class>LoginBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope> like that...
    So all parameter in LoginBean are set in session right ?... for example i used userId is the Parameter...
    Now i need to get the the userId parameter from that session in my another JSP page.. how i get that ?..
    Already i tried
    session.getAtrribute("userId");
    session.getValue("userId");
    but it retrieve only "null" value.. could u please help me.. it's very urgent one..
    By
    Subbus

    Where i use that..is it in jsp or backend bean...
    simply i use the following code in one backend bean and try to get the value from there bean in the front of jsp page...
    in LogoutBean inside
    public String getUserID()
         Object sessionAttribute = null;
         FacesContext facescontext=FacesContext.getCurrentInstance();
         ExternalContext externalcontext=facescontext.getExternalContext();
         Map sessionMap=externalcontext.getSessionMap();
         if(sessionMap != null)
         sessionAttribute = sessionMap.get("userId");
         System.out.println("Session value is...."+(String)sessionAttribute);
         return (String)sessionAttribute;
         return "fail";
    JSP Page
    <jsp:useBean id="logs" scope="session" class="logs.LogoutBean" />
    System.out.println("SS value is ...."+logs.getUserID());
    but again it retrieve only null value.. could u please tell me first how to set the session variable in JSF.. i did faces-config only.. is it correct or not..
    By
    Subbus

  • How to find the nearlest value in 1-D array ?

    Hi.. everybody..
    I need to seperate the raw data(1-D) into 2 group of array by the center value and then make the average value in each array. But I also still have the problem about if the center value is not the same of some value in the 1-D array. I cannot use the split function.
    "How to find the nearlest value to the center point that I calculated, in the 1-D array ?"
    Thanks a lot for anybody help

    In a general sense, since I'm not sure what your data values are or how far away your calculated center is from the true value, I would do it one of two ways:
    1) Use a threshold value and scan the array until the threshold is reached (assumes constantly increasing values in the array).
    2) Use either a) round to nearest integer b) round to + Infinity (round up) or c) round to - infinity (round down). If you don't have decimal values, you'll have to devide the values by a power of 10.
    2006 Ultimate LabVIEW G-eek.

  • How to find the inserted values in alv

    Hello All,
    How to find the inserted and deleted values in ALV.
    Regards,
    lisa.

    Hi,
    copy the output table before calling set_table_for_first_display and refresh_display
    then in your event call
    CLASS lcl_alv_handler_1100 DEFINITION.                        
      PUBLIC SECTION.
        METHODS:
          handle_data_changed                                      
             FOR EVENT data_changed OF cl_gui_alv_grid
                 IMPORTING er_data_changed,
    ENDCLASS.  
    after this here you can find modified new output table
    then compare the new output table with older one
    aRs

  • How to find the column name and table name with a value

    Hi All
    How to find the column name and table name with "Value".
    For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
    Any help is highly appricatable
    Thanks & Regards
    Srikkanth.M

    2 solutions by Michaels (the latter is 11g upwards only)...
    michaels>  var val varchar2(5)
    michaels>  exec :val := 'as'
    PL/SQL procedure successfully completed.
    michaels>  select distinct substr (:val, 1, 11) "Searchword",
                    substr (table_name, 1, 14) "Table",
                    substr (t.column_value.getstringval (), 1, 50) "Column/Value"
               from cols,
                    table
                       (xmlsequence
                           (dbms_xmlgen.getxmltype ('select ' || column_name
                                                    || ' from ' || table_name
                                                    || ' where upper('
                                                    || column_name
                                                    || ') like upper(''%' || :val
                                                    || '%'')'
                                                   ).extract ('ROWSET/ROW/*')
                       ) t
    --        where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
           order by "Table"or
    SQL> select table_name,
           column_name,
           :search_string search_string,
           result
      from cols,
           xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
           columns result varchar2(10) path '.'
    where table_name in ('EMP', 'DEPT')
    TABLE_NAME           COLUMN_NAME          SEARCH_STRING        RESULT   
    DEPT                 DNAME                ES                   RESEARCH 
    DEPT                 DNAME                ES                   SALES    
    EMP                  ENAME                ES                   JONES    
    EMP                  ENAME                ES                   JAMES    
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   PRESIDENT
    EMP                  JOB                  ES                   SALESMAN 
    9 rows selected.

Maybe you are looking for

  • HT204387 ow to pair ipad with iphone?

    How do I pair my ipad with my iphone?

  • Routing link to BOM alternative

    Hi all, In our current SAP solution (SAP R/2) each routing alternative stores a link to an associated Bill of Material alternative.  We have noticed that in mySAP ERP the routing alternatives can store BOM alternatives in the Component Allocation tab

  • Firefox/3.6.20 can't loading certain websites. while they are loading with IE

    After upgrading to Firefox/3.6.20. certain websites don't loading(I see empty page). Same files do loading by IE8. OS: Windows XP prof. SP3. Sometimes when I am searching, search results page is displayed in that manner, that I can not use references

  • Flash for firefox download page not working

    The download link for the adobe flash player plugin for firefox does not appear to be working. I'm getting a page load error when clicking on the download link on the following URL: http://get.adobe.com/flashplayer/ I've tried revisiting the page ove

  • Forms Warning with Interactive PDF from InDesign

    Hi all, I have created an interactive PDF in InDesign CS5 with a series of buttons, and those buttons link to bookmarked pages within the document. These buttons are setup on one of the Masters. It seems that whenever I get more than 10 buttons on th