Using Variable Length Argument in Constructor

Hi All,
I am tring to create class Address which represent Address of different people, However not all the information will be available for all the entries.I am thinking of using a Variable Length Argument in Constructor (String).Now I am unable to create a proper constructor as If few of the information say city is missing then how should the cons behave.Any help is highly appreciated.
Below is the class
package javaProg.completeReferance;
import java.util.*;
import javaProg.completeReferance.*;
public class Address
     private String name,address,city,pincode;
     public Address(String ...)
}

The problem with using a variable argument constructor here is that you don't know which of the pieces of information are being supplied. Var args is nice if the information being passed has a known "meaning", but may consist of an unknown number of parts (although it's little better than an array): but that's not what you have here.
If some of the arguments have sensible default values (even null) you could have something likepublic Address(String name, String address, String city, String pincode) {
    this.name = name;
    this.address = address;
    this.city = city;
    this.pincode = pincode;
public Address(String name, String address) {
    this(name, address, null, null, -1);
}(I'm treating pincode as an int by way of example.)

Similar Messages

  • What is the proper way to javadoc a variable length argument list

    What is the proper way to javadoc a variable length argument list?
    Lets say I have the following function:
    public void foo(Integer... intArray){
    }I am just not sure how I would doc that, well, is there anything special I should note?
    Thank you for your time,
    Brandon

    Same as any other argument. Name it and say what it's for.

  • Ambiguity in variable-length arguments

    I noticed by mistake that the following compiles:
        public int method(int x) {
            return 0;
        public int method(int ...x) {
            return 1;
        }I'd ahve thougth that it would't compile, because when there is 1 argument there is ambiguity. But it compiles and it works, if I use 1 parameter the first method is called, else the second is called.
    I think that this thing is very error prone, I discovered this wondering why a varargs method didn't work as expected, and it was just that I had another method with the same name, analogous to the example I gave above.
    Is this done purposely or is there a bug in the JVM?

    Its not a bug. Java would every time try and call the
    most specific method instead of generalized one. e.g.
    see the code below. if you try and create an object
    of this class passing null into the constructor, It
    calls the String Constructor. Notice it has two
    constructors: 1) takes String 2) takes Object
    public constructorTest(String str){
    System.out.println("String Constructor Called");
    public constructorTest(Object obj){
    System.out.println("Object Constructor Called");
    }Is this similar to your problem ?
    String is more
    specific than Object and hence a call with null is
    passed on to the most specific one that could take
    this type.
    r u sure ? bcoz i passed null as argument and got compile error "ambiguous reference"
    >
    IMHO this is analogous in concept to what you
    observed.
    Regards

  • Variable length argument lists

    What is their point? I can't see any.
    If we have
    void xyz (String ... strings)why can't we just use an array of Strings instead?

    What is their point? I can't see any.
    If we have
    void xyz (String ... strings)why can't we just use an array of Strings instead?You could. It's just basically a convenience factor, so that you can invoke it like this:
    xyz("one", "two", "three", "four");
    instead of:
    xyz(new String[] { "one", "two", "three", "four" });

  • I need to update specific records(of variable lengths) in a file. I can get the correct record but when I update it(add info), it overwrites part of the record following it. I am using labview 6.0

    I need to update specific records(of variable lengths) in a file. I can get the correct record but when I update it(add or change info), it overwrites part of the record following it. I am using labview 6.0. I need to be able to insert information into the middle of a file without disturbing the data before and after

    It's hard to give more specifics without more detail, but in general you're going to need to read in the entire file, split it into three pieces (everything before the record of interest, the record itself, and everything after the record of interest), modify the record, reassemble the three pieces in proper order, and write the whole thing back to the file.Of course if the file is very large you might not want to actually implement it this way, but conceptually at least, this is what you are looking at.If this file some sort of proprietary format?Mike...PS: this type of issue is why I really like databases...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to use datamerge with variable lengths of text?

    Hello,
    I'm looking for a way to automaticly format brochures from a database . I allready found out that datamerge lets you do this quite easily. But I encounter a problem when I use large amounts of text.
    How I see it, the only solution is to reserve enough space for the larges text in order to make all of the text appear in the document. But this leaves large open spaces and even blank pages in my document when I deal with less text.
    Is there a way to make the document adapt to the amount of text? So that Indesign creates more space for large amounts of text and erases blank pages when there is less text?
    Maybe Datamerge isn't the right solution for my problem, I'm open to suggestions.
    Thanks in advance!
    Iris

    I'm just finishing up a directory that I build with data merge and I have the problem of variable length business descriptions, as well as some have extra mailing addresses or websites. My solution is to do it in several steps with multiple files. I do a normal merge first (and I use a single record per page for this, but only bcause that allows me to create some alphabetical lists of business names and owners's names that I can key to a listing number), then I stitch together the individual stories into a single text thread that I copy/paste into place in the final document. If you have a lot of frames, Rorohiko.com has a nifty text stitch script that will help.
    One tip that helps with this method is to be sure you have a paragraph break at the end of each story so stiching the frames together maintains your paragraphs.

  • File Sender, Content Conversion - how to define variable length last field?

    XI 3.0 SP17
    With a File Sender communication channel, that uses Content Conversion - how do I define a 'variable length' last field?
    The scenario - the input file has four fields, of which the first three are a known fixed length, and the last (fourth, trailing) field is variable in length.
    Using a Message Protocol of 'File Content Conversion', how do I define that last variable length field (field name 'WOData' below) in the Content Conversion Parameters section?
    My current parameters are:
    Recordset Structure  -  Row,*
    ignoreRecordsetName  -  true
    Row.fieldFixedLengths  -  1,12,5,99999
    Row.fieldNames  -  WOType,WONum,WOLine,WOData
    I've tried the following for 'Row.fieldFixedLengths' to no avail -
    '1,12,5,*'
    '1,12,5,0'
    '1,12,5,'
    '1,12,5'
    The last two were grasping at straws )
    The only thing I've got to work is specifying a 'large' value for the final field (99999 above).
    In addition, does anyone know if specifying a large value (e.g. 99999) for the final trailing field will give rise to performance issues when the file is being processed?
    In the help for "Converting File Content in a Sender Adapter", it states -
    <Begin Quote>
    NameA.fieldFixedLengths
    If you make a specification here, the system expects a character string that contains the lengths of the structure columns as arguments separated by commas.
    If you also specify a separator for the columns, you must not add its length to the length of the columns.
    This entry is mandatory if you have not made an entry for NameA.fieldSeparator.
    <End Quote>
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm

    << note that fieldFixedLengths will not take any wildcard entries like *. So in these case it is ideal to provide a maximum char length.  But note that while the file is being created that many spaces will be created in your file !!! >>
    Hi Shabarish,
    Yes, no wildcard is the conclusion I came to, hence my maximum )
    The message size did not increase by any 'blank padding'.  When I look in [Message Display Tool (Detail Display)] 'Audit Log for Message: X'  -
    2006-10-17 18:22:42 Success Channel X: Entire file content converted to XML format
    2006-10-17 18:22:42 Success Send binary file  "X" from FTP server "X", size 103290 bytes with QoS EO
    2006-10-17 18:22:42 Success Application attempting to send an XI message asynchronously using connection AFW.
    2006-10-17 18:22:42 Success Trying to put the message into the send queue.
    2006-10-17 18:22:42 Success Message successfully put into the queue.
    2006-10-17 18:22:42 Success The application sent the message asynchronously using connection AFW. Returning to application.
    The input flat file in non-XML format was 92,132 bytes and the message payload into XI was 103,290 bytes.
    My understanding is that trailing spaces are stripped from XML nodes.

  • Bank statement: problem to load variable length field

    we have many bank accounts with different banks, and we would like to use the bank reconciliation module to do bank reconciliation.
    we have problem in load the MT940 bank statement. All these banks are providing so called standard SWIFT940 format, which not able to give fixed length field.
    we have problem on line 61 which have a lot of variable length fields.
    line 61 comprise of 7 fields, which are:
    A) Value date - fixed 6 chars.
    B) Entry date - fixed 4 chars.
    C) Credit/debit - variable 1-2 chars.
    D) Fund Code - fixed 1 char
    E) Transaction amount - variable 15 chars
    F) Transaction code/type - fixed 4 chars
    G) MID, cheque#, BIS - variable 16 chars
    How can we write the SQL Loader script if there is no delimiter, and the start position of the fields are not fixed?
    we can load A and B easily, but C onwards we will have problems.
    please help.
    INTO TABLE ce_stmt_int_tmp
    WHEN rec_id_no = '61'
    TRAILING NULLCOLS
    (rec_no RECNUM,
    rec_id_no POSITION(1:2) CHAR,
    column1 POSITION(4:9) CHAR,
    column2 POSITION(10:13) CHAR,
    column3 ??
    column4 ??
    column5 ??
    column6 ??
    column7 ??
    ------

    Hi Linda,
    As said by gupta, please check, whether the bank statement has the statement 62F:
    If not, please get the statement again from bank and ensure that the end statement 62F exists in the statement..
    This will help you to overcome your problem..
    Regards,
    Praisty

  • Changing a variables length for text input in Captivate 6

    I am using eLearning CS6 (non-subscription I believe, but no one at my office can confirm) and use a machine where all software is deployed via push from IT. The ability to check for updates has been removed from me.
    I need to be able to have users enter data into the course and have it both be forwarded on to our database AND appear in later segments of the course.
    I recall being able to update the TEB variable length in previous versions but can not find the option anywhere in CS6. or perhaps I'm imaging it.
    I am running version 6.0.1.240 and there is no Format option in my TEB properties. I do not see alignment options, and instead see Characters as a menu above the Shadow & Reflection option.
    I do know where to set the value in a text caption box. However, I seem to be limited to entering a single variable in the caption field in order for this to be option. However, there are times where we'd rather have multiple variables strung together on a single line, or a word or two of static text appearing before or after the variable.
    If I want to string the user entered data from multiple variables into a single caption box there appears to be no way to change the variable's character length from 15 to a higher value.
    Does anyone know of another way to work around this other than through the use of multiple caption boxes?
    I've been driving myself a bit batty trying to think of a way around the 1 caption 1 variable limit...
    Thanks.
    Note: Please don't advise me to upgrade. I've already been told the office will not pay for an update to the software so quickly on the heels of our upgrade from CS 5.5 to CS6 (happened within a 6 month span).

    15 characters is the default when you insert the variable into a text caption.  But you can set this to anything from 1 to about 250...as long as you use the Insert Variable icon in the Properties tab > Format accordion to insert the variable.  Look for the field in the dialog that allows you to specify the variable's display length.

  • Problem in sending a variable length string

    Hello friends,
    I have created a scenario as follows.
    Our
    Application ==>(SOAP) ==> XI  ==> (RFC) ==> SAP TABLE.
    I am sending a record with one of the fields of the type 'VARILRAW'
    When I send this, it is sending me a response that it was inserted in the table succesfully, But when I try to retrieve, all fields get returned correctly, but not this variable length field. This sends me back a huge string of letter 'A's.
    Here is what I see on SXMB_MONI
    The following shows that for insertion, the proper data is coming in XML format.
    ===============================================
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:ZBAPI_ADD_CONFIG_DNA xmlns:ns1="urn:sap-com:document:sap:rfc:functions">
    - <CONFIG_DNA_DATA>
      <CONFIG_ID>4607.1164846986188077.494</CONFIG_ID>
      <STRING_NAME>USC1</STRING_NAME>
      <STRING_FORMAT>TXT</STRING_FORMAT>
      <STRING_VALUE>ONE,TWO,THREE,FOUR</STRING_VALUE>
      <OBJECT_NAME>TEMP</OBJECT_NAME>
      </CONFIG_DNA_DATA>
      </ns1:ZBAPI_ADD_CONFIG_DNA>
    =================================================
    When I try to search for the same data again using the Key field CONFIG_ID,
    I am getting back the following. Notice that all fields are coming back with right data but for STRING_VALUE, which is coming as a long string of As
    ====================================================
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:SEARCH_CONFIG_DNA_RESPONSE xmlns:ns1="http://cincom.com/config">
    - <RETMSG>
      <RETURNMESSAGE>1 Records found</RETURNMESSAGE>
      <SUBRC>0</SUBRC>
      </RETMSG>
    - <CONFIG_DATA>
    - <item>
      <CONFIG_ID>4607.1164846986188077.494</CONFIG_ID>
      <STRING_NAME>USC1</STRING_NAME>
      <STRING_FORMAT>TXT</STRING_FORMAT>
      <STRING_VALUE>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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1:SEARCH_CONFIG_DNA_RESPONSE>
    ========================================================
    Any help will be greatly appreciated.
    Thanks
    Ram

    go to RFC and insert a BREAK-POINT and check what do you receive in the field. if you receive same you send so its a problem of SAP Team.
    try this

  • How to save blob data (variable length string) in a customized table?

    Dear Friends
    I have written a very simple program to update table with 2 fields which
    looks as follows.
    ========================================================
    Table name ZTESTBLOBDATA
    Field         Key          Init    Data Element   Data Type  Length  
    ID          Checked                 ZID                 NUMC        2
    BLOB                                   ZBLOB           STRING       0
    =========================================================
    FOllowing is the sample program that I have written (Transaction SE38).
    =========================================================
    REPORT ZTESTBLOBPROG
    TABLES: ZTESTBLOBDATA
    data :  itab like ZTESTBLOPDATA occurs 1 with header line.
    select * from ztestblobdata into table itab.
    ztestblobdata-id  =   sy-dbcnt +1.
    ztestblobdata -blob = 'abcdefghijklmnopqrstuvwxyz.'.
    insert ztestblobdata.
    =========================================================
    When I try to save and activate the program, I get the following
    error message
    'ztestblopdata' must be a flat structure. You cannot use internal
    tables, strings, references, or structures as components.
    ==========================================================
    Using the data type STRING is a must since it is a variable length
    data which varies from few characters to few gig.
    How can go around this problem.
    Any feedback will be highly appreciated.
    PS. I have checked old postings on SDN, spoken to my ABAP contacts and also couple of instructors from SAP when I took XI courses but didn't get a satisfactory answers.
    Edited by: Ram Prasad on Oct 15, 2008 12:28 PM

    Thanks a lot for the response.
    The string that we are getting is from another application via netweaver XI integration and is being sent as a string which has to be saved in an SAP table. I am not sure if IDOC option will suit our needs, but will definitely read more about it.
    If there is any other suggestion of feedback I would appreciate it a lot.;
    Tks
    Ram

  • SQL*Loader and "Variable length field was truncated"

    Hi,
    I'm experiencing this problem using SQL*Loader: Release 8.1.7.0.0
    Here is my control file (it's actually split into separate control and data files, but the result is the same)
    LOAD DATA
    INFILE *
    APPEND INTO TABLE test
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    first_id,
    second_id,
    third_id,
    language_code,
    display_text VARCHAR(2000)
    begindata
    2,1,1,"eng","Type of Investment Account"
    The TEST table is defined as:
    Name Null? Type
    FIRST_ID NOT NULL NUMBER(4)
    SECOND_ID NOT NULL NUMBER(4)
    THIRD_ID NOT NULL NUMBER(4)
    LANGUAGE_CODE NOT NULL CHAR(3)
    DISPLAY_TEXT VARCHAR2(2000)
    QUESTION_BLOB BLOB
    The log file displays:
    Record 1: Warning on table "USER"."TEST", column DISPLAY_TEXT
    Variable length field was truncated.
    And the results of the insert are:
    FIRST_ID SECOND_ID THIRD_ID LANGUAGE_CODE DISPLAY_TEXT
    2 1 1 eng ype of Investment Account"
    The language_code field is imported correctly, but display_text keeps the closing delimiter, and loses the first character of the string. In other words, it is interpreting the enclosing double quote and/or the delimiter, and truncating the first two characters.
    I've also tried the following:
    LOAD DATA
    INFILE *
    APPEND INTO TABLE test
    FIELDS TERMINATED BY '|'
    first_id,
    second_id,
    third_id,
    language_code,
    display_text VARCHAR(2000)
    begindata
    2|1|1|eng|Type of Investment Account
    In this case, display_text is imported as:
    pe of Investment Account
    In the log file, I get this table which seems odd as well - why is the display_text column shown as having length 2002 when I explicitly set it to 2000?
    Column Name Position Len Term Encl Datatype
    FIRST_ID FIRST * | O(") CHARACTER
    SECOND_ID NEXT * | O(") CHARACTER
    THIRD_ID NEXT * | O(") CHARACTER
    LANGUAGE_CODE NEXT 3 | O(") CHARACTER
    DISPLAY_TEXT NEXT 2002 VARCHAR
    Am I missing something totally obvious in my control and data files? I've played with various combinations of delimiters (commas vs '|'), trailing nullcols, optional enclosed etc.
    Any help would be greatly appreciated!

    Use CHAR instead aof VARCHAR
    LOAD DATA
    INFILE *
    APPEND INTO TABLE test
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
      first_id,
      second_id,
      third_id,
      language_code,
      display_text    CHAR(2000)
    )From the docu:
    A VARCHAR field is a length-value datatype.
    It consists of a binary length subfield followed by a character string of the specified length.
    http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a76955/ch05.htm#20324

  • How to store variable length of data in data dictionary table

    hi friends
        i want to store variable length of text in one of field of table which is created in data dictionary.
        i tried it by declaring table field type as string,
    include that table using table statement and try to insert data in abap program . but it gives error something
    "cannot use table having deep structure " i don't remember it exactly.
          can you help me how to insert variable length of data in text data dictionary table.

    Hi,
        define field with type LRAW in your table to store
        string more than 255 characters.
          LRAW                                                                               
    Uninterpreted byte string of arbitrary length, but with a minimum                   
          length of 256. Fields of this type must be located at the end of                    
          tables and must be preceded by a length field of type INT2. LRAW                    
          fields cannot be used in the WHERE condition. LRAW is functional from               
          Release 3.0.                                                                        
    Regards
    amole

  • CER for multisite variable length on-net dialplan customer

    Hello -
    I am working to deploy CER for a large customer.  They have a CCM cluster supporting, as expmple, 10 sites with the following characteristics:
    1. each site has 4 digit DNs
    2. each site has it's own phone partition
    3. sites have overlapping DNs
    4. calling from one site to another requites "8" +"3 digit site code"
    5. CCM 7.x;
    6. CER 8.0
    CER is populated with switches from multiple sites so therefore will have CER database entry for DN=4000 in site1, site2, and site 7.
    Question are:
    1. If site2, DN 4000 phone calls 911, how does CER associate this caller with ERL2?
        - I am not sure what parameters are passed in the JTAPI messaging to the 911 CER Route Point to make this association?
        - assume the basics are signalled like calling/called numbers, but is additional info like mac address passed allowing CER to map ERL accurately
    2. PSAP Callback
       -assuming ERL is mapped correctly on the outbound 911 call, if PSAP calls  back and ELIN is routed back to CER properly ...
       - CER would perform callback using ELIN<=>Phone cached mapping
                      o hence CER would send JTAPI call request to CCM for x4000
                      o x4000 exists in 3 partitions
       - if I have the CER911 CTI Route Point CSS populated with each sites phone partition, it would seem that CCM would incorrectly ring the first partition listed that contained x4000
    SRND for variable length onnet design has section on CER but nothing of value (at least that I could find).   Same with the CER docs.
    Any guidance here would really be appreciated.
    Thanks
    Andy

    So, while the switchport is pecified and used to populate the CER db, that is all done before any call is made.  At that point, CER has DN, MAC, IP,...
    Correct, you build CER configuration to your design
    Phone makes 911 call, and at this point, CER has to tie this "inbound call" to a phone in the database.  That association has to use information from the JTAPI messaging which I assume to be standard compliant.  I could be way off here because we just did a test where a phone, defined in CER using switch port, was matched up properly even though I totally changed the callerid on 911 call (i.e. phone dn=4613, phone translation for 911 prefixed changed to 1111 so CER sees calling num=1111).  This callerID was not stored anywhere in CER database but it did match up the correct zone.  I have no idea how.  JTAPI must pass in mac/IP which CER uses.
    For outbound call, when phone dials 911 and the call is routed to CER via CTI RP, CER maps this call to a phone that dialed 911 through discovered DN from the Switch via SNMP/CDP, it then identifies which port the phone is connected to, looks at what ERL is assigned to the port and uses next available ELIN on that ERL to mask ANI to it and route it to CUCM. CUCM routes the call via Route Pattern to CUCM with the modified Caller ID.
    When the call drops and 911 agent needs to call back, they dial the ELIN DID, call is routed to CUCM, matches translation pattern that routes the call to CER via another CTI RP (usually 913XXXXXXXXXX), CER sees the call coming in with ELIN and checks internal db for who last called out using this ELIN, and extends the call to that phone DN, it keeps that relationship for up to 3 hours after the call was made.
    HTH, please rate all useful posts!
    Chris

  • Use variables in a SELECT INTO FROM command

    Hi,
    How do I use variables within a select into from command? I want to loop through SYS.DBA_TABLES using a cursor and count the number of rows in a
    selection of tables an then insert into a cardinality table.
    The count of rows will be stored in a variable called CNT, that bit is easy however I need a variable in the FROM clause because that
    value changes with every iteration of the cursor.
    e.g.
    CNT := 0;
    TN := "MyTable";
    select count(*) into CNT FROM TN;
    insert into cardinality (table_name, row_count) values (TN, CNT);
    This is Oracle 9i and I need the row counts in a separate table as they are shipped over to a different environment for analysis purposes.
    Any ideas?
    Regards
    Dave
    Edited by: Yorky001 on Sep 15, 2010 10:32 AM

    Hi,
    Thanks for the info, unfortunately I can get neither example to work on this 9i system, could well be pilot error as I only ever get
    to do any Oracle about once per year. In the first query I have tried both "user_tables" and SYS.DBA_TABLES, same result.
    set serveroutput on size 1000000;
    DECLARE
    row_count INTEGER;
    vstr VARCHAR2(500);
    vstr1 VARCHAR2(500);
    BEGIN
    vstr := 'SELECT count(*) FROM ';
    dbms_output.put_line(vstr);
    FOR i IN (SELECT table_name FROM user_tables WHERE rownum < 10) LOOP
    vstr1 := vstr || i.table_name;
    EXECUTE IMMEDIATE vstr1
    INTO row_count;
    dbms_output.put_line(i.table_name || ':' || row_count);
    END LOOP;
    END;
    This one complains about the execute immediate line.
    Error report:
    ORA-00933: SQL command not properly ended
    ORA-06512: at line 12
    00933. 00000 - "SQL command not properly ended"
    *Cause:   
    *Action:
    BEGIN
    FOR i IN (select
    table_name,
    to_number(
    extractvalue(
    xmltype(
    dbms_xmlgen.getxml('select count(*) c from '||table_name))
    ,'/ROWSET/ROW/C')) count
    from user_tables
    where rownum<6) LOOP
    dbms_output.put_line(i.table_name || ':' || i.count);
    END LOOP;
    END;
    ORA-19206: Invalid value for query or REF CURSOR parameter
    ORA-06512: at "SYS.DBMS_XMLGEN", line 121
    ORA-06512: at line 1
    ORA-06512: at line 2
    19206. 00000 - "Invalid value for query or REF CURSOR parameter"
    *Cause:    The queryString argument passed to DBMS_XMLGEN.newContext was not a valid query, or REF CURSOR.
    *Action:   Rewrite the query so that the queryString argument is a valid query or REF CURSOR.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for