Assigning object name dynamically !!!

Dear Friends,
Is it possible to assign the object name dynamically. Something like this ...
class DynamicObject
public static void main(String ggg[])
int runtime= ....getNumber(); // ... some method which returns int and val returned is dynamic
for (int i=0; i<runtime;i++)
String obj+i = new String("sasfdf"); // this line is giving error !! is there any other way ???
I want to generate n object. So I need to do this way.
Can anyone share how to achieve this.
Thanx

Using Arra??
Can you give me the clue ??
Thanx

Similar Messages

  • Dynamically assigning table name in select statement

    how can i assign the table name dynamically in Select statement?
    i tried following code
    create or replace procedure proc1
    as
    x varchar2(100);
    y varchar2(10);
    begin
    x='UNIT_MASTER';
    execute immediate 'select unit_code into y from x where
    rownum=1';
    dbms_output.put_line(y);
    end;
    the procedure is created but when i execute the procedure the
    error is shown in the execute immediate statement

    Do the following :
    Create or replace procedure pro1 as
    x varchar2(100);
    y varchar2(10);
    begin
    x := 'UNIT_MASTER';
    EXECUTE IMMEDIATE 'select unit_code from '||x||' where rownum
    = 1' INTO y;
    dbms_output.put_line(y);

  • How to know the workflow object name assigned to a Transaction code

    Hi Friends,
    There is one workflow object assigned to one transaction code VKM1. How can i know the workflow object name assigned to that particular transaction. Can anybody help me?
    Regards
    shankar

    HI
    Please check t.code PPOMW
    Thanks & Regards
    Phaneendra

  • Passing a string as an object name...how?

    I've searched all over the place for a solution to this to no avail.
    I have a program that reads input from a text file. The text file holds information on student IDs, so it look something like this:
    "ID_1234"
    "ID_1235"
    "ID_1236"
    So, every line of the text file has a student ID.
    I have a class called Student, that takes the student ID as a parameter, so I can create a Student object pretty easily by going, for example:
    Student newStudent = new Student("ID_1234");
    Now, my problem is that I want to read the contents of the text file that is given to me and create an object for each student, and use as a name for that object the student's ID. I have the program reading the data from the text file no problem, it's just the object name assignment I'm having trouble with.
    //Start code
    private void readInStudents(String fileName){
    BufferedReader reader = new BufferedReader (new FileReader (studentIDFile.txt));
    String line = reader.readLine();
    while(line != null)
    Student line = new Student(line);
    //End code
    Ideally I would like this to crate three Student objects, with the names "ID_1234", "ID_1235", and "ID_1236" respectively.
    However, this is not the case as I get an error when assigning "line" as the object name in the line within the while loop.
    Any help would be much appreciated!!!!!!
    Many thanks.

    elsombreron wrote:
    Thanks to all for your quick replies. I ended up using an ArraList to store the objects without needing to give them all a dynamic name.
    I come from a purely procedural programming background where the sort of assignment I was trying to do would work, so still have to get used to OO style.
    Thanks again.Huh? I don't see what procedural vs object oriented has to do with it.
    FORTRAN, COBOL, C and Ada (pre 95) are all procedural languages and as far as I can remember, you could not do that in any of them.
    Perhaps many scripting languages allow this. The various *nix shells come to mind.
    What languages are you referring to that have tis feature?

  • Filling record object types dynamically

    The example below shows the code to create two object types, and in the PL/SQL block the record object type is filled.
    create type parameter_type as object
    (name varchar2(30)
    ,value varchar2(250));
    create type parameterset_type as table of parameter_type;
    declare
    l_parameters parameterset_type;
    begin
    l_parameters := parameterset_type
    (parameter_type('par1', 'value1')
    ,parameter_type('par2', 'value2')
    end;
    Is it possible to fill the record object type in a more dynamic way than by a single assignment, as in the example? I would like to be able to create a loop in which I fill the rows one by one.
    So something like:
    declare
    cursor c_prm is
    select name
    from parameters
    order by seqnr;
    begin
    for r_prm in c_prm
    loop
    -- add parameter c_prm.name to parameterlist
    end loop;
    end;

    just guessing but in that case, build an array or table where you can put every record.
    type t_dummy is table of parameter_type;
    declare
    v_dummy t_dummy := t_dummy(null);
    v_dummy.extend;
    v_dummy(i) := parameterset_type
    (parameter_type(r_prm.name, 'value1');

  • How to pass the table name dynamically in xml parsing

    Hi All,
    I have created one procedure for parsing xml file which is working perfectly.
    FORALL i IN t_tab.first .. t_tab.last
             INSERT INTO Test_AP VALUES t_tab(i);Now I want to put the table name dynamically+. For that I have added one query and modify above code as follow:-
    I have already declare dml_str varchar2(800) in declaration part.
    Query is as follows:-
    select table_name into tab_name from VERSION_DETAILS where SUBVERSION_NO=abc;  -- here abc is variable name which contains values.
    FORALL i IN t_tab.first .. t_tab.last
              dml_str := 'INSERT INTO ' || tab_name || ' values :vals';
              EXECUTE IMMEDIATE dml_str USING t_tab(i);But it's not working. How I will resolve this or through which way I achieved the intended results. Anyone can guide me on this matter.
    Thanks in advance for your help...

    Hi,
    But it's not working.Don't you think it would help to give the error message?
    Put the assignment before FORALL.
    FORALL only accepts one subsequent DML statement (static or dynamic SQL) :
    dml_str := 'INSERT INTO ' || tab_name || ' values :vals';
    FORALL i IN t_tab.first .. t_tab.last          
    EXECUTE IMMEDIATE dml_str USING t_tab(i);

  • Find object Names in a file and print all those objects Names

    Hi All,
    I am new to this forum.
    I want to know how to read only objects names in txt file. In the text file i have sql queries, package names, Function Name. I need to read all the objects and display out put. The file contains around 20000 Lines.
    Please suggest me.
    Thanks & Regards
    Suresh.

    Gurram wrote:
    want to read .rex File. The file contains combination of SQL code with table Names, Packages,Functions,There are three basic ways to read an external file.
    You can use UTL_FILE and use standard/basic file I/O calls like fread() and fwrite() - common amongst most (if not all) programming languages.
    You can define an external table for the file, and SQL*Load the contents of the file dynamically via a SQL SELECT statement.
    You can load the file into a CLOB using DBMS_LOB and then process it - quite useful if the text file is XML as the XMLTYPE supports parsing a a CLOB containing XML.
    I want to pick Each object name put in a separate file line by line.That in turn will need to use UTL_FILE to create an external file.
    Keep in mind though that your in a database environment with PL/SQL. The very best place for data is inside the database in SQL tables. Not outside as external files. Thus you need to ask yourself whether dealing this way with external files is the best solution, and a robust and scalable one.
    Granted, many times from the database side we need to deal with external files. The optimal method usually is to load that file's data into a database table as structured data - data that can be accessed via SQL and sorted, filtered, aggregated and analysed.
    To provide a "file" as output - this should ideally be done directly from structured data (SQL tables). And can be done using HTTP (via a web enabled PL/SQL procedure that supplies the file content as a http Mime stream), using FTP (via <i>UTL_TCP</i>) or as a CLOB via a PL/SQL call interface. Using UTL_FILE is not necessarily the only option.

  • System Center Virtual Machine Manager SC VMM 2012 SP1 Installation fails: Unable to assign the name NO_PARAM to this host because this name is already in use.

    I'm trying to install VMM 2012 SP1 on a Windows Server 2012 machine and it fails with this error,
    the scenario is as follows,
    Old database (from 2012 RTM) exists on remote SQL 2012 SP1 server
    Server was 2008 R2 SP1 so I decided to make a fresh installation of 2012 with the same name
    installed ADK
    specific error: 01:42:13:VMMPostinstallProcessor threw an exception: Threw Exception.Type: Microsoft.VirtualManager.Setup.Exceptions.BackEndErrorException, Exception.Message: Unable to assign the name NO_PARAM to this host because this name is already in
    use.
    please help

    I had a similar problem today when upgrading from SCVMM 2012 RTM to SCVMM 2012 SP1 RTM. To re-create the issue you describe originally you can actually just uninstall SCVMM 2012 SP1 RTM with "retain data" option and re-install the software on the same
    computer (with the same name of course), attaching it to the retained DB. If you change the SCVMM server name I believe it will make some things go wrong after your install, like missing VM template passwords for example as the data gets encrypted in
    the DB. Maybe it didn't but I didn't risk it. I definitely know if you change service accounts on a scenario like this you will be without the encrypted DB data which isn't much fun. To avoid changing the computer name, if you look in the setup log
    files in %systemdrive%\ProgramData\VMMLogs\, specifically the SetupWizard.log file. You will see details on it failing because the same computer name is in the DB table "dbo.tbl_ADHC_AgentServer" and until it is removed from that table I wasn't able to get
    the install to complete at all. The error in my logs looked something like this "InnerException.Type: System.Data.SqlClient.SqlException, InnerException.Message: Violation of UNIQUE KEY constraint 'unique_ADHC_AgentServer_ComputerName'. Cannot insert duplicate
    key in object 'dbo.tbl_ADHC_AgentServer'. The duplicate key value is (computername.is.writtenhere). The statement has been terminated." In the row data in the DB it also seems to suggest that the computer name had "Virtual Machine Manager Library Files" on
    it which is strange since I always remove the local SCVMM server as a library server after I install it and use an off box library server.

  • Cost element report with cost object name column

    Hi,
    i'm looking for a report similar to S_ALR_87013601: Cost Elements: Breakdown by Object Type, but including a column with the cost object name. Does anyone know if such a report exists? If it doesn't exist, how can i create a report like this?
    Some of my company costs are assigned to cost centers and some of them are assigned to wbs elements. We would like a report where we could have all the information together.
    Thank you very much

    Hi Xavi ,
    Some of my company costs are assigned to cost centers and some of them are assigned to wbs elements. We would like a report where we could have all the information together.=>
    There is not standard report available..  which will display total cost per company code.. i,e cost booked on cost centers, internal order and WBS elements ... This is becuse each modules store data in seperate tables.
    You have to create a ABAP report to serve your pourpose. You have to collate all the costs booked in a company code for cost centers, IO and WBS elements . Pick up real costs only as per company code..
    We are using such custom report and its working fine.
    Regards
    Sarada

  • BDC selecting component - Assigning object dependencies

    Hi,
    I am facing a problem in developing a BDC program. In transaction CS02, for a configurable material there may be n number of components. The number of components may vary from material to material. My requirement is to assign object dependency Q & S to all the components for a given material.
    Through BDC program how can i pick the components one by one and assign object dependencies Q and S at runtime??? Dynamically on what basis do i have to pick the component? Any supporting code will be more helpfull. Very thankfull to you for solving the issue.
    Thanks,
    RAM

    I have a program which does exactly this.   What it does it excepts a flat comma-delimited file and uses this to chose the component and assign the obj dep.  Now that I'm looking at it, it looks that it will allow up to three obj dep to be added for a single component.  The file layout will need to have......
    material number
    plant
    item number
    component material lnumber
    object dep 1
    object dep 2
    object dep 3
    I can send you the code if you email me at the address on my business card.
    Regards
    Rich Heilman

  • How to get Object Name

    hi
    i make a widget in flex for Captivate5.5, now i want to get my Object Name(widget->Animation->ObjectName) in flex , how can i get that name
    how can i get Object Name in Flex Dynamically....

    thnx Jim Leichliter for ur replay
    i'm using  http://blogs.adobe.com/captivate/2010/10/flex-based-widgets.html classes,

  • HOW TO GIVE CLASS NAME DYNAMICALLY???

    Hi all!
    I want to give class name dynamically to my statment
    <jsp:useBean id="myBean" scope="session" class="myPackage.myClass"/>
    now here i want to pass a String as class name how can i do it?
    Jiaa:):):)

    Hi,
    You can't assign dynamically a classname in the instruction jsp:useBean
    S�b

  • Passing INLCUDE name dynamically

    Hi,
    Is there any way of passing the INCLUDE name dynamically?
    Scenario is as follows
    Requirement is to consolidate approx 6 enhancements (user exits) of the same name from 6 different systems into 1system . Objective is to put each of the code in an INCLUDE and then call the relevant INCLUDE based on some data maintained in a z-table
    Z-table would have entries like this
    Scenario      Include
    S1                I1
    S2                I2
    S3                I3
    Hence final enhancement code should read the entry from z-table and accordingly pass the relevant INCLUDE name
    INCLUDE <include name from z-table>
    Valuable suggestions are needed.
    Poonam

    Hi Poonam,
    <li> Create one function group.
    <li> Write your 6 includes code in 6 function modules. function module is nothing but include in Function group.
    <li>Try to give importing and exporting parameters are same.
    <li>Try the below way.
    REPORT ZTEST_NOTEPAD.
    DATA: BEGIN OF IT_FUNC OCCURS 0,
            NAME TYPE RS38L-NAME,
          END OF IT_FUNC.
    "Build your it_func with function modules.
    LOOP AT IT_FUNC.
      CALL FUNCTION IT_FUNC-NAME "You can call fm dynamically
        EXPORTING
          DAY_IN            = IMPORTING
          LAST_DAY_OF_MONTH = EXCEPTIONS
          DAY_IN_NO_DATE    = 1
          OTHERS            = 2.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDLOOP.
    Thanks
    venkat.O

  • ERROR - JBO-25005: Object name  for type View Object is invalid

    Hi All,
    I am getting this error "JBO-25005: Object name for type View Object is invalid" while executing my VO query in Controller code. Can any one please tell me the reason behind this error?
    I am creating a VO dynamically and .xml file of a VO is placed in a proper directly. Please let me know some inputs to resolve this.
    Thanks & Regards,
    -Abm

    I found the below explanation for the error mentioned. Check if your package name, Object names confirm to the standard specified
    JBO-25005: InvalidObjNameException
    Cause: An attempt has been made to associate a business component name with an object for which it is not valid.
    Action: The name should be a valid Java identifier with no spaces or punctuation. Names are of the format myProjectPackage.BusinessPackage.BusinessComponent

  • How to get the class name and field name dynamically

    Hi
    I have a class (ex: Contract) the fields (ex : a,b,c) .i need to get the class name and field name dynamically
    ex
    if( validation file for the field Contract.a){
    return contract.a;
    }else if(validation file for the field Contract.b){
    return contract.b;
    how to pass the field name and object dynamically
    Please help me .............
    Thanks in Advance..
    Edited by: 849614 on Aug 11, 2011 6:49 AM

    YoungWinston wrote:
    maheshguruswamy wrote:
    Agreed, but IMO, i still feel its best if there is no tie in between consumer class level details and the database it talks to. A service layer is needed in between them.Sounds like you've done a bit of this before. Me, I've either been a modeller/DBA, doling out data, or a nuts and bolts programmer (and actually more toolmaker than apps, but did a bit of that too).
    Do you know of a good book about the "middle ground" (ie, these service layers)? I understand it empirically, but haven't had a lot of exposure to it.
    Winston
    Edited by: YoungWinston on Aug 11, 2011 10:34 PM
    PS: Apologies. Edited my previous post, presumably while you were composing your reply, when I finally realized what '.filed' meant.Most of my work is in web development, never been a DBA :) . The biggest 'concern' in my shop is 'separation of concerns'. The UI group reports up to a different IT head, the DB group reports up to a different IT head and so on. The looser the coupling between these systems, the lesser the project costs (Integration, QA etc) are. Martin Fowler's books contain good information about separation of concerns in an enterprise environment. The two books which i recommend are
    [url http://www.amazon.com/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420]Enterprise Application Architecture and
    [url http://www.amazon.com/Enterprise-Integration-Patterns-Designing-Deploying/dp/0321200683/ref=pd_sim_b_1]Enterprise Integration Patterns

Maybe you are looking for

  • How do you add multiple videos to one single timeline in encore cs6

    please need assistance, i have 10 separate video files that i am trying to burn onto as few of dvd dl's as possible

  • Using databases and container events?

    I'm having trouble finding documents show how one should use databases and listen for container events? I'm using Berkley Java DB. I'll need all my remote object to have access to the database. How do I pass that in? Custom adapters? Also, when Tomca

  • Microsoft SQL Server JDBC driver and WLS JMS problem?

              Greetings,           I'm using the Microsoft SQL Server JDBC driver with WLS with JMS           persisted to SQL Server, during WLS startup the JMS attempts to           read the JMSStore and JMSState tables in the db, if they are          

  • Good receipt exceed purchase order quantity

    Hello all, I am trying to do a good receipt that exceed purchase order quantity but I have an error message that I can´t do it. I configure tolerance limits B1, B2 and VP but it doesn´t work. I only can do a good receipt that exceed purchase order if

  • Acrobat3D Javascript A.B.C.D child subnode visiblity control?

    How can we fetch a reference to a 3D Model (U3D) in the scene within the Acrobat3D JavaScript context and get 3D scene node visibility to match what is shown in the Model Tree? Currently we are using JavaScripts of the form of the following to preset