Variable length ByteBuffer?

I have a client sending a ByteBuffer to a server. I know the size of the ByteBuffer on the client based on the file I'm reading in. However when I'm on the server reading in the ByteBuffer I don't know the size. Since the file size on the client can be variable my ByteBuffer size needs to be variable. Is this possible? Can I make a ByteBuffer without giving it a set size?
Norman
- "Everywhere I go, there I am!"

public abstract class Buffer
extends Object
A container for data of a specific primitive type.
A buffer is a linear, finite sequence of elements of a specific primitive type. Aside from its content, the essential properties of a buffer are its capacity, limit, and position:
Buffer Class:
A buffer's capacity is the number of elements it contains. The capacity of a buffer is never negative and never changes.
A buffer's limit is the index of the first element that should not be read or written. A buffer's limit is never negative and is never greater than the its capacity.
A buffer's position is the index of the next element to be read or written. A buffer's position is never negative and is never greater than its limit.
There is one subclass of this class for each non-boolean primitive type.
BuuferedReader Class:
The buffer size may be specified, or the default size may be used. The default is large enough for most purposes.

Similar Messages

  • 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>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</STRING_VALUE>
      <OBJECT_NAME>TEMP</OBJECT_NAME>
      </item>
      </CONFIG_DATA>
      </ns1: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

  • 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.

  • 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

  • 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.)

  • 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

  • How to deal with variable length data struct in C/JNI

    I have another JNI related question. How do you handle variable length
    data structures in Java and pointer to a pointer?
    Basically, I have a backend in C which has records but we don't know
    how many. The API looks like
    typedef struct rec_list_s {
    int rec_list_cnt;
    rec_list_data_t rec_list_data[1];
    } rec_list_t;
    int rec_list_show(void handle, rec_list_t *list_ptr);
    /* Code snippet for rec_list_show */
    int rec_list_show(void handle, rec_list_t *list_ptr)
    rec_list_t *ptr;
    sz = sizeof (rec_list_t) +
    ((record_count - 1) * sizeof (rec_list_data_t));
    ptr = malloc(sz);
    /* fill the data */
    *list_ptr = ptr;
    return (0);
    So I need to wrap rec_list_show() in JNI call so I can have Java call
    it. How do i pass a pointer to a pointer from Java? I tried in the
    native C code for JNI to return the pointer to pointer as a result
    and store in a member in the Java class rec_list_t and then I pass
    that to JNI call for rec_list_show. The C backend code was fine
    since it got the pointer to pointer but Java become unhappy when
    the object it was referencing changed memory location (I suspect
    the garbage collection becomes unhappy).
    So what would be a good way to deal with this kind of code?
    Thanks,
    Sunay
    Edited by: st9 on Aug 30, 2010 5:47 PM

    I did not imply that you don't know C but you are implying that I don't understand C. Perhaps
    google Sunay Tripathi and click I am feeling lucky so that we don't get into teaching C
    discussions :) On the other hand, I am definitely looking for someone to teach me Java
    otherwise I wouldn't be asking.
    Anyway, let me explain again. The sample function rec_list_show() runs on the backend. It
    is a different process with a different VM space. It of course knows the size of the array
    and what to fill in. As a caller to that API (which is a separate process), I don't know
    what that size is but I need to get the size and corresponding data in one shot because
    the backend locks the table when its providing me the info to make sure its synchronous.
    Now I (the Java process) needs to get that count and data in one shot. Since the C library
    underneath me (wrapped around my JNI interface) has private IPC mechanism to copy
    the contiguous memory from the backend into my memory space, all I need is to provide
    a pointer to a pointer which gets filled in by backend and is available to my process. So
    my equivalent C frontend just passes a pointer to a pointer and casts the return value in
    rec_list_t. The rec_list_cnt tells it how many members it got. The first member is part of
    the struct itself but then following members are right after.
    Another way to help you understand this is with this code snippet from front end C program
    rec_list_t     *ptr, *save_ptr;
    rec_list_data_t *data_ptr;
    int          cnt;
    save_ptr = ptr = malloc(sizeof(rec_list_t));
    rec_list_show(handle, &ptr);
    assert(save_ptr != ptr);
    cnt = ptr->rec_list_cnt;
    for (i = 0; i < cnt; i++) {
         data_ptr = &ptr->rec_list_data;
    Notice the assert(). Also notice the for loop. How do I expect to walk more that one
    member when rec_list_data is a fixed size array of one member?typedef struct rec_list_s {
         int               rec_list_cnt;
         rec_list_data_t          rec_list_data[1];
    } rec_list_t;
    Anyway, I do understand that Java will not allow me to get a reference to a long and
    how Java memory management works. But the JNI native implementation is C
    and I was wondering if people have managed to do some tricks there between C
    and Java.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • I want to increase the variable length

    Hi all,
    I want to increase the variable length at runtime(When iam doing debugging).
    Can any body tell me idea..

    Hi,
    I dont think you can change variable length in debugging mode.
    What you can do is if you variable is a character format  you can declare it as string instead of character.
    You can pack -unpack with leading zeros..and many other data manuplation.
    But i doubt on changing the characterstics of the variable at runtime.
    Look for some alternative data type for your requirement.
    Regards
    Sourabh

  • Ora-06502: variable length too long on report query xml schema download

    on shared components/report queries/edit report query/
    and downloading my queries in xml schema format (radio button).
    Get
    ORA-06502: PL/SQL: numeric or value error: raw variable length too long
    when i click the download button.
    EDIT:
    i want to add that i recently changed several columns in the database from 150 to 3000 chars long.
    Edited by: Manny Rodriguez on Oct 11, 2011 7:19 AM

    "4000 bytes is the ultimate maximum. you can say 4000 *characters* , but it'll always be limited to 4000 *bytes* . "
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1224836384599#201073000346459201\
    "The maximum length of the column is determined by the national character set definition. Width specifications of character data type NVARCHAR2 refer to the number of characters. The maximum column size allowed is 4000 bytes."
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements001.htm#SQLRF50976
    By the way, you're treating your numbers as STRINGS, remove the quotes around your zero's.

  • Variable length in substring

    i am trying unsuccessfully to write a udf, as suddenly the fixed length field i was using a substring on has changed to a variable length field...
    i need to pass the field into a UDF and then pass out the last two characters for one field...
    and the last 5 for another field.
    once i have the UDF working for one, i can amend it for the other...
    i am probably a million miles away from the solution... but this is where i am so far...
    can someone guide me as to how i can pass the variable length into the substring parameter??
    String str = var1;
    int length = str.length();
    output(var1.substring(length -2))

    just one line:
    return var1.substring(var1.length()-2);
    What should "output" do in your example?

Maybe you are looking for

  • Creating ABAP queries with t-code SQ01 in SRM

    Hi. What tables are available for me to use ABAP queries with t-code in SRM as we currently use this for MM. Please can someone tell me if a list of usefull tables for Carts, Approvals, PO are available in SRM as I cannot find these in SE11. We have

  • Widget clocks, counters,   iweb

    HI All ? So i have 2 I web pages going cjthedjmanc.om and http://web.me.com/daycareinfo2/Site/Welcome.html/ My ? I need to add things, like counters, clocks, But I went to widgets down loaded a clock but my ? How do i place it on my web page iweb bui

  • Register activeX in "create installer"

    Hi Dose anybody knows how to register an activeX during setup with the installer that has been created with the "application builder of Labveiw". Best regards Behzad

  • A buzzing when I turn my computer on?

    This is the first problem I've ever experianced with my MacBook (white). I got it back in June and it has worked fine until this morning when I turned it on and it started making this obnoxious buzzing and grinding sound that won't stop until I turn

  • Resetting rpd Password (Informative)

    Hello Everybody, When i am doing some R&D work today, I come across a situation how to reset the password for rpd where I forgot the password for Administrator. All existed solutions (like NQSChangepassword.exe command) have associated with mentionin