How could I Write data into a field in Oracle whose data type is VARCHAR2

The target data I want to write into Oracle is in http://tw.yahoo.com/info/utos.html.
Now, these data is stored in Mysql database and the field which stores these data uses "Text" as its data type.
I want to derive these data from mysql database and store them into a field of oracle database.
In oracle, I create field whose data type is varchar2(4000) to store these data.
I use JSP to derive data from mysql and insert into oracle through JDBC.
But the result of the page shows me that "javax.servlet.ServletException: Data size bigger than max size for this type: 25623".
Please anyone could help to resolve this problem?
Thank you very much.

My hunch is that the problem is that VARCHAR2(4000), but default, allocates 4000 bytes of storage. Depending on your database character set, a single character may require up to 4 bytes of storage.
If you are on 9i, you can declare the column VARCHAR2(4000 CHAR) to allocate 4000 characters of storage. You can also set NLS_LENGTH_SEMANTICS to CHAR, which will cause Oracle to assume that your declarations are in characters rather than bytes.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC

Similar Messages

  • How can i store image into blob field in oracle express ??

    Hi
    am using oracle express *(2.1)* , i am devloping a small system , we have to store an image in blob filed in a table, we have to create a form which allow the user to store the image in the table and to generate a report contains the image
    any note's please
    tahnk's in advance
    sam
    Edited by: user485341 on Dec 22, 2008 1:28 AM

    hi Andy
    this is the code for download
    create or replace PROCEDURE download_my_file(p_file in number) AS
    v_mime VARCHAR2(48);
    v_length NUMBER;
    v_file_name VARCHAR2(2000);
    Lob_loc BLOB;
    BEGIN
    SELECT MIME_TYPE, BLOB_CONTENT, FILE_NAME,DBMS_LOB.GETLENGTH(BLOB_CONTENT)
    INTO v_mime,lob_loc,v_file_name,v_length
    FROM A_IMAGES
    WHERE IMAGE_ID = p_file;
    owa_util.mime_header( nvl(v_mime,'application/octet'),FALSE );
    -- set the size so the browser knows how much to download
    htp.p('Content-length: ' || v_length);
    -- the filename will be used by the browser if the users does a save as
    htp.p('Content-Disposition: attachment;
    filename="'||replace(replace(substr(v_file_name,instr(v_file_name,'/')+1)
    ,chr(10),null),chr(13),null)|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( Lob_loc );
    end download_my_file;
    thank's

  • How to use same Data Type and Length for two fields

    How to use same data type and length for two fields when using 'FOR ALL ENTRIES IN' in a select statement? For instance the select queries are :
    SELECT bukrs gjahr belnr lifnr budat bldat zlspr dmbtr waers shkzg
    FROM bsik
    INTO TABLE it_bsik
    WHERE bukrs = p_bukrs
    AND lifnr IN s_lifnr.
    IF it_bsik IS NOT INITIAL.
    SELECT belnr gjahr awkey awtyp
    FROM bkpf
    INTO TABLE it_bkpf
    FOR ALL ENTRIES IN it_bsik
    WHERE belnr = it_bsik-belnr
    AND gjahr = it_bsik-gjahr.
    IF it_bkpf IS NOT INITIAL.
    SELECT belnr gjahr lifnr xblnr
    FROM rbkp
    INTO TABLE it_rbkp
    FOR ALL ENTRIES IN it_bkpf
    WHERE belnr = it_bkpf-awkey+0(10)
    AND gjahr = it_bkpf-awkey+10(4).
    ENDIF.
    ENDIF.
    Here it gives an error in the 3rd select query that 'When you use the addition "FOR ALL ENTRIES IN itab", the fields "GJAHR" and "IT_BKPF2-AWKEY+10(4)" must have the same type and the same length.'
    Kindly clarify.

    Hi Saurabh,
    Please see the example code that I have developed for you. It will help you solve the problem.
    REPORT ZTEST_3 .
    tables : BKPF.
    data : begin of it_bkpf occurs 1,
             belnr type RE_BELNR,
             awkey type awkey,
             awtyp type awtyp,
             gjahr type GJAHR,
           end of it_bkpf.
    data : begin of it_bkpf1 occurs 1,
             belnr type RE_BELNR,
             awkey type gjahr,              " change the data type
             awtyp type awtyp,
             gjahr type GJAHR,
           end of it_bkpf1.
    data : begin of it_rbkp occurs 1,
             belnr type BELNR_D,
             gjahr type gjahr,
             lifnr type LIFRE,
             xblnr type XBLNR,
           end of it_rbkp.
    select belnr
           awkey
           awtyp
           gjahr
           from bkpf
           into table it_bkpf
           where BUKRS = 'TELH'.
    loop at it_bkpf.
    it_bkpf1-belnr = it_bkpf-belnr.
    it_bkpf1-awkey = it_bkpf-awkey+10(4).           "Here only append the required length.
    it_bkpf1-awtyp = it_bkpf-awtyp.
    it_bkpf1-gjahr = it_bkpf-gjahr.
    append it_bkpf1.
    clear it_bkpf1.
    endloop.
    select  belnr
            gjahr
            lifnr
            xblnr
            from RBKP
            into table it_rbkp
            for all entries in it_bkpf1
            where belnr = it_bkpf1-belnr
    This is just an example. Change the fields according to your requirement.
    Regards
    Abhii
    Edited by: Abhii on Mar 9, 2011 9:08 AM

  • How to insert a value into a field of binary type?

    I've been using Oracle for a while now but never dealt with BLOB
    or long raw type before. Does anyone here know how to insert a
    record into a field of either blob or long raw type?
    Any suggestions would be very appreicated.
    Thanks.

    pls used the loadfromfile procedure which is in the DBMS_LOB
    package to insert the data from external os file into blob data
    type column.
    Kunjan

  • My wife and I have made many purchases over several years on seperate accounts, how could we join them into one account, without losing everything?

    My wife and I have made many purchases over several years on seperate accounts, how could we join them into one account, without losing everything? We both use Iphone 5's and share an Imac at home.

    Purchases using one Apple ID cannot be merged or transferred to another Apple ID. Purchases are forever tied to that Apple ID used. You have to decide which Apple you want to use for purchases and stick to that Apple ID so that you can share: Settings > iTunes & App Stores > Apple ID : > use the same Apple ID here to share purchases.

  • ASR multicast: Could not write data: No buffer space available

    I am trying to multicast a disk image to multiple iMacs. Here is my plist config for the server:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Data Rate</key>
              <integer>12000000</integer>
              <key>Multicast Address</key>
              <string>224.77.2.121</string>
    </dict>
    </plist>
    I use the following command to start the server:
    sudo asr -source labmac.dmg -server multicast.plist
    The terminal responds "Ready to start accepting clients"
    Then I go to one of the iMacs that will receive the image. I am netbooting the client off of the same server that is multicasting the image over ASR. I try to start the imaging process by issuing the following command on the client:
    sudo asr -source asr://server.ip.add.ress -target /Volumes/Macintosh HD -erase
    The command is accepted, confirms that I would like to erase the drive, and then says "Restoring" but no progress shows.
    Back on the server, the terminal will output the following continuously until I cancel the multicast:
    Starting stream Sun Feb 10 15:55:10 2013
    asr: Could not write data: No buffer space available
    The multicast seems to be working because the entire network gets bogged down, so why is it that it is unable to transfer the image data?

    Did you end up figuring this out? i'm on the same boat

  • "could not deteremine data types of all wires"?

    OK, so I am porting a pretty large project over to LV8 from LV7.0
    And for one of my VIs I am getting the error "could not deteremine data types of all wires"
    When I double-click on the error, it brings up the front panel.
    huh?
    I don't see any problems with the block diagram at all.
    All of my shift registers have colored wires, so I assume that the wires' data types are resolved.

    Update II: Apparantly this bug is somehow related to the enum's name (and maybe location on disk?).
    I re-created the enum from scratch under the name "Trial Enum STYP.ctl" when I dropped it into a new subVI's diagram it didn't break the VI.
    I renamed it "Main STYP.ctl" and dropped it in; broken VI
    I renamed it "Trial Enum 1 STYP.ctl"; broken VI
    I renamed it "Trial Enum STYP.ctl" again; not broken.
    Here be dragons!
    Note: I actually got one to work by opening it when it was named something "good", and then using "Save As..." from within LabVIEW to change the name to what I wanted instead of changing the name in Windows Explorer.
    Message Edited by LVRob on 12-06-2005 03:33 PM

  • How to detect which data type is passed in ?

    Hello!
     I've built a VI function. But I want to make it more secure - that function could detect which data type is wired to the inputs and allow wiring only certain data types. How can I do this?
     Thanks
    Message Edited by ACiDuser on 05-23-2009 08:13 PM
    Solved!
    Go to Solution.

    I'm assuming you're talking about numeric datatypes. In this case that information is not available to you at the subVI level. The LabVIEW compiler will have already changed the datatype to match what your subVI expects if someone wires something of a different type.
    You could use a variant as your input. Then in the subVI you can use the Variant to Flattened Data to get the type. The OpenG LabVIEW Data Tools VIs will be useful if returning an enum specifying the datatype. Specifically, using the "Get TDEnum From Data VI".
    Now that we've gotten that out of the way, let's talk about the why. Why do you need to do this? What are you trying to "secure"?

  • How to encrypt the text in password field in Oracle Forms version 6i

    Need help!
    How to encrypt the text in password field in Oracle Forms version 6i?
    one way is to change the settings in the property palette. Can somebody provide me some script to be run while the form is running which will enable the password to be encrypted?
    Thanks!

    Hello,
    Do you mean "hidden" (replaced with stars) or encrypted (that needs to be decrypted ?
    Francois

  • How to find the Data Type of a column

    Dear All,
    How to find the Data Type of a Column dynamically in oracle Form.
    Thanks and Regards,
    Fazil
    Edited by: user11334489 on Aug 25, 2012 9:06 PM

    hi,
    you can use get_item_property built-in
    eg:
    declare
       l_item VARCHAR2(10);
    begin
       l_item := Get_Item_Property('item_name',DATATYPE);
    end;

  • How to add TIMESTAMP data type in  Enterprise Architect...?

    Hi all
    There is no data type of timestamp in Enterprise Architech. There is only
    DATE type. I have ERD prepared from Enterprise Architech. How to modify
    DATE type to TIMESTAMP type.
    How to add TIMESTAMP data type in Enterprise Architect or in ERD ?
    Thanks in advance,
    Pal

    Have you asked this question of the vendor of Enterprise Architect? They may have a later version that supports the various TIMESTAMP data types. If your ERD tool doesn't support a data type, other than talking to the vendor or working around the problem (i.e. generate DDL to a text file and edit it before applying it to the database), you're probably out of luck.
    Justin

  • How to read XI Data type in Java code and populate as array list, using UDF

    Hi,
    How to read XI Data type in Java code and populate as array list, using UDF?
    Is there any API using which  the XI data types can be read?
    Kindly reply.
    Richa

    Input Structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:CustomerCreateResp xmlns:ns0="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
       <CUSTOMER>
          <item>
             <CUSTOMERNO/>
             <MDMCUSTOMER/>
             <CREATE_DATE/>
             <RETURN>
                <TYPE/>
                <MESSAGE/>
             </RETURN>
             <PT_CONTPART_RETURN>
                <item>
                   <MDM_CONTACT/>
                   <CONTACT/>
                </item>
             </PT_CONTPART_RETURN>
             <PARTNERS>
                <item>
                   <CUSTOMERNO/>
                   <PARTNER_FUNCTION/>
                   <PARTNER_NUMBER/>
                   <DEFAULT_PARTNER/>
                </item>
             </PARTNERS>
          </item>
       </CUSTOMER>
    </ns0:CustomerCreateResp>
    Output structure
    (Sample output structure.This actually needs to be mapped and generated using UDF)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:updateCustomer xmlns:ns1="urn:xiSericeVi"><ns1:customer><ns2:ArrayList xmlns:ns2="java:sap/standard">[]</ns2:ArrayList></ns1:customer><ns1:name>2344566</ns1:name></ns1:updateCustomer>

  • How to Find the Data Type of the Field In a Database Table

    Hi Experts,
    I'm currently working on a program which needs to find out the data type of the given field in a database table. In addition to accessing DD03L directly, is there any other workaround such as function module to help me achieve this? It would be helpful if a demo example could be provided.
    Thanks a lot.

    Hi,
    Use this..
    DESCRIBE FIELD dobj  TYPE typ.
    write typ.
    type will contain the data type of the object.
    and check this thread also....
    Re: How to get datatype of fields in dynamic structures
    Cheers,
    Simha.
    Reward all the helpful answers..

  • How could I write this in java

    I have to use a parameter in a statement. I am trying but its giving error. I am trying to write it like ....
    fw.write("Object     dir/my.dat\n");I substitute my.dat with a variable dat & write like
    fw.write("Object     dir/+"dat"+\n");dat is a String variable.

    Sam_Fin wrote:
    thanks,welcome
    How could I remove this error.
    Unreported exception java.io.IOException; must be caught or declared to be thrown fw.write("#the number of patterns to be recognized\n");
    Its for every fw.write statement.read the Sun (Oracle?) [tutorial on exceptions,|http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html] and then either throw the exception or wrap in a try / catch block (the tutorial will explain how).

  • How to change the data type in the table ESLL for the field USERF2_NUM ?

    Hello Friends,
    I have a requirement in which one of the change is to convert the data type of the field 'USERF2_NUM' in the table 'ESLL'  from 'QUAN' to 'CHAR'. 
    How do i do it if i have an access to change it..........i think i should also check the impact of the change if done.
    Kindly tell me as my requirement starts with this small change.
    Regards,
    Rajesh Kumar

    Thanks for the reply Sowmya.
    I would like to know 2 things.
    1. Is it ok to change the data type of the field 'USERF2_NUM '  which is in the table ESLL. from quan to char.
    2.  The table ESLL  already has entries. if we change the data type from QUAN to CHAR what is the  effect on the existing entries of the table .
    Kindly reply me back.
    Thanks & Regards,
    Rajesh Kumar

Maybe you are looking for

  • Free goods of different material

    Hi Experts, I have mapped free goods scenario in our system.Its working well for inclusive and exclusive free goods for same material. i.e. If I have a material M1 ordered for 100 units I will get 10 units of the same material M1 free(Exclusive) and

  • Please help: Photoshop CS5 - Yosemite locked permissions?

    Please I hope someone can help! I just updated my older iMac with Yosemite, and reinstalled Adobe CS 5. What a mess. Neither Illustrator or InDesign will launch. Photoshop will work, but has problems. (Thank God I've not touched my newer, main studio

  • Sap b1 marketting

    Respected Sir, Can anybody tell me how i can make my demo of sap b1 more powerful & attractive. I think my weak point during demo is i switch from one module to another module. I m not giving proper demo, it is not systematic. Please help me and tell

  • English Windows on Japanese G20?

    Hey Chaps, I live in Tokyo and want to buy a Q20. The problem: They all come with Japanese software - which I don't understand. Does anybody have experiences in installing an English Windows version to a Japanese Qosmio G20? The Japanese version seem

  • Unable to save a form with missing required fields

    I have a form, with required fields, as part of the new hire process. I would like to make sure the user fills in the required fields before closing/saving the form. I have a custom script that highlights the missing required fields when the complete