Getting ORA-01401for NVARCHAR2 greater than 1000 chars.

I have a table with column PATTERN NVARCHAR2(1024). When I try to insert 1024 chars I get an error -
INSERT INTO test VALUES('AAA..1024times')
ERROR at line 1:
ORA-01401: inserted value too large for column
but
INSERT INTO test VALUES(N'AAA..1024times') works. I can insert a string upto 1000 chars without using N'' . I would like to know why this happens and when to use N'' and when not. Is it safe to use N'' even if column is varchar2 and not nvarchar2 ?
I have following database settings-
PARAMETER VALUE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET AL32UTF8
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 10.1.0.2.0

Try this (not tested):
import oracle.sql.CharacterSet;
CharacterSet csDB=CharacterSet.make(CharacterSet.ZHS32GB18030);
int byteLenDB = csDB.convert("your string").length;
Note, ZHS32GB18030 is currently supported as the client character set only. You should better not define a database with this character set. (See: Database Globalization Support Guide, Table A-9). It looks like we have to clarify this, because DBCA lists ZHS32GB18030 and CREATE DATABASE accepts it.
The DB character set does not seem to be available through any public API (though it is retrieved and stored internally). You have to query the database.
-- Sergiusz

Similar Messages

  • Save More than 1000 chars in a field of (Z) Database Table?

    Hi Friends,
    I created a database table with few fields. In the table, one field is REMARKS which should save more than 1000 characters for every record. For that field,  I created domain & data element of char with 2000 length. But system gives an error representing that "Should not be more than 255 chars ".
    Even, select statement is also retrieving 132 chars only, if remarks are less than 255 and greater than 150 chars.
    Could you please provide me solution?
    Thanks
    Sarayu

    Hi,
    The Most simple solution for it can be that Divide the field REMARKS of size 1000 in multiples of 200 characters like REMARK1, REMARK2....REMARKn.
    Now you can create two FMs :
    zset_data:  To Store 1000 char long data in Table
    Here you will divide the data of Variable (type char1024) in multiples of 200 and will store in REMARK1, REMARK2.....
    zget_data: To Get 1000 char long data back from Table
    Here you will concatenate REMARK1, REMARK2..... and will store in Variable of Type char1024.
    This is the best solution if Table is not going to be maintained by Table Maintenance Generator.
    Thanks
    Ajay

  • Graphs in the dashboard not showing values which greater than 1000 !!!

    Hello Champs,
    I have build a dashbaord using SAP BO Dashboards 4.1 SP 1.
    Architrecture is as below:
    Bex Query --> SAP Netweaver Connection --> Dashbaord --> Published on BI Portal.
    So here there is no BOE in picture.
    The problem I am facing is that, in my graphs any value which greater than or equal to 1000 is not showing up....!!!
    Strange indeed.
    In the picture one can see that at the runtime, the Tablular view is showing data, but the Graph on the left isnt, as all the values are greater than 1000. Any values lower than 1000 is appearing,
    So, does anyone have faced any such problem in such a scenario.
    Is there any setting which has to be done to publish the Dashboard on BI Portal, which I may have missed.
    Any helpfull suggestion is much apppreciated.
    Thanks.
    Pradeep Gupta.

    Hi,
    Are you calculating the value in thousands? Whats the value? Currency etc. Did you check in the text tab on what value it is?
    Arun

  • @ FM to send email with width greater than 128 chars

    Hi
    Is there a FM which would send an e-mail with width greater than 128 chars.
    Z-Send_email_attachemnt would limit the witdth to 128 char due to table EMAIL_TEXT LIKE table BTCXPGLOG.
    BTCXPGLOG- field- Message(128)
    Thanks.

    Hi,
    look in SE38 with BCS_EXAMPLE_*
    I can use 255 char.
    Regards, Dieter

  • Email attachment rows greater than 255 char get truncated

    Hi
    I am trying to code in 4.6C to email excel attachment with rows greater than 255, and the rows are being truncated using function module SO_NEW_DOCUMENT_ATT_SEND_API1.
    I have searched the forum and can not find an actual solution to this on a 4.6c system.
    Firstly is it possible to send an excel attachment with rows that have rows greater than 255, and secondly if yes have anyone seen any sample code which does this?
    Many thanks
    Daniel

    Hai! Check this coding out
    Here the internal table l_tab_attach is temporary table which has a line size more than 255 chars.
    Data: begin of l_tab_attach occurs 0,
            line(300),  "give what ever char length u want as a output
            end of l_tab_attach
    *concatenate all the header column and the its corresponding entries ie rows in this table l_tab_attach.
    peform send_email table t_message
                                        l_tab_attach
    'FORM send_file_as_email_attachment TABLES pit_message
                                              pit_attach
                                        USING p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     CHANGING p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc,
            w_new_obj_id TYPE sofolenti1-object_id,
            t_objhead TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE.
      ld_mtitle              = eml_subj.
      ld_format              = 'XLS'.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = att_nam.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE l_tab_attach INDEX w_cnt.
      w_doc_data-doc_size =
         <b>( w_cnt - 1 ) * 255 + STRLEN( L_TAB_ATTACH-LINE ).</b>"this is important for lenght exceeding more that 255 char
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = pit_attach[].
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE l_tab_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
      REFRESH t_receivers.
      LOOP AT mailto.
    Add the recipients email address
        CLEAR t_receivers.
        t_receivers-receiver = mailto+3(48).
        t_receivers-rec_type = 'U'.
        t_receivers-com_type = 'INT'.
        t_receivers-notif_del = 'X'.
        t_receivers-notif_ndel = 'X'.
        APPEND t_receivers.
      ENDLOOP.
      CLEAR t_objhead.
      REFRESH t_objhead.
      t_objhead = att_nam.
      APPEND t_objhead.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          document_data              = w_doc_data
          put_in_outbox              = 'X'
          sender_address             = ld_sender_address
          sender_address_type        = ld_sender_address_type
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = w_sent_all
        TABLES
          packing_list               = t_packing_list
          contents_bin               = t_attachment
          contents_txt               = l_tab_message
          receivers                  = t_receivers
          object_header              = t_objhead
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.                    " SEND_FILE_AS_EMAIL_ATTACHMENT
    <b>Dont forget to give points if useful</b>

  • Getting job_queue_processes' must be greater than or equal to 1.  Fix ...

    Hi All,
    I'm running the emca -config dbcontrol db command and getting the follow msg:
    SEVERE: 'job_queue_processes' must be greater than or equal to 1. Fix the error(s) and run EM Configuration Assistant again in standalone mode.
    I'm working on sun machine 5.10 and Oracle 10g.
    Any ideo how can I fix tis problem?
    Thanks in advance,
    Serge

    Please see the following thread;
    Re: Enterprise Manager Repository reconfigue
    Ogan

  • Sending Emails with Attachments greater than 255 chars in 4.6C

    Hi,
    I have a requirement in which i have to send mails with attachments greater than 255 characters. The attachment would be a tab-delimited .TXT file. Since i am working on 4.6C, i don't have the luxury of using the FM 'SCMS_STRING_TO_FTEXT'.
    It's very urgent. So any help in this regards would be greatly appreciated.
    Thank you.
    Balaji

    Hi,
    Internal table to be passed to SOLIST1 type int, table and then compress this table using fm "table_compress" with the compressed table then call fm "table_decompress" and pass this to function module SO_NEW_DOCUMENT_ATT_SEND_API1.
    Keep in mind the following variable
    i_packing_list-transf_bin = 'X'.
    aRs

  • Cant  we create a custom PA infotype whose size is more than 1000 chars?

    can we create a custom PA infotype whose size is more than 1000 characters
    i have tried this way i have given 4 fields in PM01 transaction with the data element 255 so the total size is 1020 it is throwing an error. pls help......

    Hi,
    as described in the following documentaion the length of the data could be 1500 bytes.
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/4f/d526be575e11d189270000e8322f96/content.htm
    Regards
    Bernd

  • Can I get MFC to display more than 1000 results??

    MFC apparantely will only return up to 1000 results when doing searches.
    Is there a way to get to return large data sets?
    -Matt

    No plans to port it on to Linux, but how does AsyncOS sound? :-)
    I am the Product Manager for the IronPort M-Series, and am also responsible for the reporting and message tracking features (including MFC). IronPort's vision is for the M-Series to be the central platform for reporting, tracking, and management capabilities. Centralized reporting and tracking are expected to be available in the Q4 2007 timeframe.
    Feel free to contact me directly if you have any questions.
    Cheers,
    Abhay
    Abhay Rajaram
    Senior Product Manager
    [email protected]

  • How to get graphs with steps greater than 10

    is this the limit in numbers for graphing y vs x axis data?
    I finally figured out how to make 2d line graphs for basic analysis and graphing, (such as temperature vs volume). when I go to edit my data in the chart editor, i can only make steps as much as 10. so if i have 400 degrees, that means my graph will be every 40 on one of the axis... is there a way to increase the steps so that I can have smaller intervals than 1/10th?

    I just wanted to check because the workaround for Y axis requires a bit of work and patience.
    I built four charts from
    column A + column B ( of course you may also select the values to chart)
    column A + column C (no X-axis, no labels on X-axis, lines = none, points = none )
    column A + column D (no X-axis, no labels on X-axis, lines = none, points = none )
    column A + column E (no X-axis, no labels on X-axis, lines = none, points = none )
    Define the min and max values to get ten equal intervals in the four charts.
    Define the background to none
    Superpose the charts with the one built from column A & B at top.
    Insert a white rectangle between the upper chart (here Graphique 1) and the three others to hide the extraneous horizontal lines (-30, -20, -10).
    This way we have more steps.
    Yvan KOENIG (VALLAURIS, France) dimanche 5 septembre 2010 19:44:37

  • ORA-33156:Positions greater than 2**63 in a dimension map cant be referencd

    AWM 11.2.0.1.0A
    I am trying to view the data from a cube from AWM. (my cube --> cube view --> data).
    The above error occurs which I have mentioned in the subject column.
    The cube is a sales cube with dimensions (Date, item, channel, transaction type, customer, salesperson, sales location).
    Each of these dimensions have multiple hierarchies.

    I remember seeing this error before when cube has many dimensions and if it is not created as "SPARSE" we get below error. Is your cube compressed / uncompressed? . If possible make your cube as sparse then it reduces number of cells need to be referenced.

  • How can a function returning character length greater than 4000 be selected in SQL

    Hi,
    I want to know if there is a way to write a select query on a function call which returns a varchar of more than 4000 characters.
    CREATE OR REPLACE FUNCTION FUNC1
    RETURN VARCHAR2
    IS
    str VARCHAR2(32767);
    BEGIN
         str := <some string greater than 4000 char>;
          RETURN str;
    END;
    SELECT FUNC1 from dual; ---- This gives an PL/SQL numeric or value error. Character string buffer too small.
    Is there any way to resolve this?
    Thanks

    32767 is not default. The default is still 4000 for VARCHAR2. You need to set the initialization parameter MAX_STRING_SIZE= EXTENDED for 32767.
    Text from Oracle documentation
    Extended Data Types
    Beginning with Oracle Database 12c, you can specify a maximum size of 32767 bytes for the VARCHAR2, NVARCHAR2, and RAW data types. You can control whether your database supports this new maximum size by setting the initialization parameter MAX_STRING_SIZE as follows:
    If MAX_STRING_SIZE = STANDARD, then the size limits for releases prior to Oracle Database 12c apply: 4000 bytes for the VARCHAR2 and NVARCHAR2 data types, and 2000 bytes for the RAW data type. This is the default.
    If MAX_STRING_SIZE = EXTENDED, then the size limit is 32767 bytes for the VARCHAR2, NVARCHAR2, and RAW data types.

  • Problem with Filtering Data by Using "Greater Than" in APD

    Dear Experts,
      First of all, I am a novice of SAP Data Mining. I try to filter data in APD by using the 'Restrict Amont of Data (the Filter Icon).' My problem is really simple. I don't know how to filter data which have value greater than a constant.
    For example, I try to keep only records which have a quantity greater than 1000.
      At the selection option in the single value tab, I found only the '=' option. The options like '>', '<', '>=', etc are not found. Could anyone suggest me please?

    I do appreciate your prompt response.
    Seemingly, using the interval is our best solution, though it is not best for our customers.
    Having already gone through the note you gave me, in fact, it is really pertinent. Unfortunately, our support package is now 13, and it is extremely difficult to retest our system if we decide to apply the support package 16.
    Are there any other solution?
    By the way, you deserve my point.

  • Greater than is giving me equal to's

    So I'm writing a procedure in PL/SQL that has the logic below:
    SELECT
    FROM
    WHERE
        CASE
            WHEN travel_time IS NULL THEN NULL
            WHEN travel_time = 0       THEN NULL
            ELSE miles/(travel_time/60)
        END >
        CASE
            WHEN (SUBSTR(id, 2, 3) BETWEEN '099' AND '200')
                THEN 60
            ELSE 45
        END;In the result set, I'm getting records where the result of the first and second case statement are both 60.
    So basically, if the result of the first case statement is GREATER THAN the result of the second case statement, the record is supposed to show up, but I'm getting records that are GREATER THAN OR EQUAL TO. I'm sure I could just change the second case statement to give 61 rather than 60, and I'm sure it would work. But shouldn't this logic work without having to do that?
    Thanks!
    Edited by: jjmiller on Mar 26, 2010 7:24 AM

    As Frank said, a small test case (with CREATE TABLE and INSERTs) would help.
    Works for me.
    SQL> select * from v$version ;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE     10.2.0.4.0     Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL> create table travel(id varchar2(3), miles number, travel_time number) ;
    Table created.
    SQL> insert into travel values (1, 10, 10) ;
    1 row created.
    SQL> insert into travel values (2, 60, 10) ;
    1 row created.
    SQL> insert into travel values (3, 46, 10) ;
    1 row created.
    SQL> insert into travel values (4, 60, null) ;
    1 row created.
    SQL> commit ;
    Commit complete.
    SQL> select * from travel ;
    ID       MILES TRAVEL_TIME
    1         10            10
    2         60            10
    3         46            10
    4         60
    SQL> select id, miles, travel_time, case when travel_time is null then null when travel_time = 0 then null else miles/(travel_time/60) end cmp1, case when id between '1' and '4' then 60 else 45 end cmp2 from travel ;
    ID       MILES TRAVEL_TIME       CMP1       CMP2
    1           10          10         60         60
    2           60          10        360         60
    3           46          10        276         60
    4          600                                60
    SQL> select * from travel where case when travel_time is null then null when travel_time = 0 then null else miles/(travel_time/60) end > case when id between '1' and '4' then 60 else 45 end ;
    ID       MILES TRAVEL_TIME
    2           60          10
    3           46          10

  • How to filter results of the timedifference where great than a value

    To all,
    How do I filter the results of this so I only get that which is greater than 2 seconds?
    Here is the query:
    SELECT
    A.REQUEST_UU_ID, TO_CHAR(B.CREATE_BY_TS - A.CREATE_BY_TS) AS ElapsedTime
    FROM
    TELLER_MESSAGE A INNER JOIN TELLER_MESSAGE B ON B.REQUEST_UU_ID = A.REQUEST_UU_ID
    WHERE
    A.MESSAGE_TYPE_CD LIKE '%REQ%' AND
    B.MESSAGE_TYPE_CD LIKE '%REP%'
    ORDER BY A.REQUEST_UU_ID
    Here are the results which I want to filter to get only the one row with 3 second time difference.
    99ac8695-18fb-a59d-1d6b-3d2a577fff22     +000000000 00:00:03.000000 <<<this is the one I want
    99ac8696-18fb-a59d-1d6b-3d2a577fff22     +000000000 00:00:02.000000
    99ac8896-18fb-a59d-1d6b-3d2a577fff22     +000000000 00:00:02.000000
    I tried it without the TO_CHAR casting but that gave an error.
    Thanks,
    Eric

    Hi, Eric,
    Add this to your WHERE clause:
    AND     b.create_by_ts > a.create_by_ts + INTERVAL '2' SECONDOr you could add this to the join condition.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

Maybe you are looking for

  • Old iPod isn't recognized by Windows Vista

    Hey Everyone, My girlfriend has a second generation iPod, which is around 5 years old. She didn't use iTunes before getting a new laptop(which runs Vista), but has now decided to try it out. When I plug in the iPod a message comes up saying "USB Devi

  • Inactive authorization objects after patch upgrade

    Hello all, I've upgraded the version of all the patches of my 4.6C system, but I've a problem. Now, I can see by PFCG t-code that a group of roles have objects of authorization inactive and I cannot remove and add again in the role. A strange thing b

  • Can only sync purchased songs to iPhone 5 running iOS 7

    I have an iPhone 5, on which I installed the iOS 7 GM a few days ago. Everything was fine, until this evening, when I went to play some music, and it disappeared. I noticed that most of my music would just disappear when I tried to play it: if you pl

  • ACS User database Backup

    Is it possible to have the ACS user database in an excel sheet

  • IMovie Viewer issues Post Snow Leopard install

    Hi, I just fired up iMovie (09) after upgrading OS to Snow Leopard (newer iMac bought 4 months ago). I no longer see the project video in the viewer. The "raw" movies in Event Library play fine, but when trying to play the movie in the project librar