Cannot insert varchar2 4000 bytes correctly in asp

I tried to insert 4000 bytes into a filed of varchar2 type
in an ASP page using bind variables.
After inserting, I cannot fetch the column correctly. Result was only 2000 bytes.
In sqlplus I verified that the inserted data was 4000 bytes but a wrong character at 2001 th byte.
I use oracle 8.1.6.
This problem is not occurring in JSP.
Thanks...

Have you solved your problem yet?
I think you are experiencing the auto-magical characterset conversions in Windows applications.
SQL*Plus is still using those non-Unicode Win APIs; on the contrary, your C# application is very probably using the Unicode Win APIs. That means, no matter how you input (Big5 ones, unicode ones, cut-and-paste, .... ), SQL*Plus receives the characters in Big5 form and your C# application receives them in Unicode form. Windows does all the conversions transparently.
In the SQL*Plus case, the HKSCS characters are in their Big5 UDA/VDA codes. Since both your server and client have NLS_LANG set as ZHT16MSWIN950, these HKSCS Big5 codes are stored in your database intact w/o any conversion. When these characters are displayed, no matter in SQL*Plus or your C# application, they are retrieved in Big5 form and passed to Windows for display. Hence, there is no problem.
However, when you input these HKSCS characters through your C# application, they are received in Unicode form. I believe that your application is storing these Unicode characters in DB directly and, therefore, they must be converted to "MSWIN950" form by some Oracle components who lacks the full conversion table of Windows. Naturally, HKSCS characters become "??".
I am not familiar with C# and Windows APIs so I dunno the exact way to solve the problem. Still, the rule-of-thumb is to let Windows does the character set conversions and ensure that the converted data are stored in Oracle w/o further conversions. I think your C# applications should convert the text data from Unicode to Big5 (under Windows) and then save the Big5 data to the “ZHT16MSWIN950” database in Big5 context. This will probably solve your problem.

Similar Messages

  • Diff between VARCHAR2(4000)  & VARCHAR2(4000 BYTE)

    Hi
    Pls do explain the diff
    a. VARCHAR2(4000) & VARCHAR2(4000 BYTE)
    b. NUMBER & NUMBER BYTE
    Regards
    Yram

    X CHAR means that column should contain X characters regardless of how many bytes they takes. For example latvian specific character ā takes more than 1 byte in some unicode caharctersets, but latin character a only one byte. So in 1 CHAR you will be able to store both ā and a but in 1 BYTE only a.
    One has to remember that 4000 byte maximum limit for varchar column is effective REGARDLESS of 4000 CHAR and you wouldn't be able to store 4000 multi byte characters there. As soon as length in bytes of your string will be greater than 4000 Oracle will throw an error. If I remember correctly, in some earlier 9i version(s) there was a bug that Oracle silently cut the tail after 4000 bytes without an error.
    Gints Plivna
    http://www.gplivna.eu

  • Need help in parsing a VARCHAR2(4000 BYTES) field

    Hi Guys,
    Let me give the DB information first:
    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
    My problem is: The frontend of the application sends a large string into the VARCHAR2 (4000 BYTES) field. The string it sends is somewhat like this -
    <strong>Crit:</strong> Some text. <br><strong>Distinguished</strong> (points 3):Some comment text1. <blockquote> </blockquote><strong>Crit:</strong> Some other text.<br><strong>Distinguished</strong> (points 3):Some comment text2. <blockquote> </blockquote><strong>Crit:</strong> Some more text. <br><strong>Distinguished</strong> (points 3):Some comment text3. <blockquote> </blockquote><strong>Overall comments:</strong><br> Final text!!I want to parse the text and put into separate columns. Number of Crit: can be more than 3; its 3 up there. But the basic structure is same. What is the best possible way of parsing this in PL/SQL code? I want something like
    Table 1
    Crit                       Points           Comment
    Some text                3        Some comment text1.
    Some other text        3        Some comment text2.
    Some more text        3        Some comment text3.
    Table 2
    Overall comments
    Final text!!Please let me know, if you need further information.
    Thanks.
    Edited by: 794684 on Sep 14, 2010 4:15 AM
    Edited by: 794684 on Sep 14, 2010 4:38 AM
    Edited by: 794684 on Sep 14, 2010 4:53 AM
    Edited by: 794684 on Sep 14, 2010 6:42 AM

    Welcome to the forum.
    Looks like noformat tags are not working.Please use the {noformat}{noformat} tag if you want to post formatted examples/code.
    For example, when you type:
    {noformat}select *
    from dual;
    {noformat}
    it will appear as:select *
    from dual;
    when you post it on this forum...
    The FAQ will explain the other options you have: http://forums.oracle.com/forums/help.jspa                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • External table varchar2(4000 byte) field storing 255 bytes only

    Hi all,
    wondering if someone can tell me what im missing here.
    I have an external table with a column defined as varchar2(4000 byte). the file has a row in it with 255 characters (all number 2's for simplicity). when i query the table all is well. if i add 1 more 2 to the string (256 chars) it fails. im sure its something stupidly simple but what am i missing? shouldnt it query fine until 4000 chars?
    thanks,
    Dave

    I ran your testcase, thanks for that.
    Make sure to read the SQL and PL/SQL FAQ as well (the first sticky thread on this forum), it explains how to post formatted code and lots of other stuff.
    Anyway, .log file gave me:
    LOG file opened at 07/18/11 20:05:33
    Field Definitions for table DAVEP2
      Record format DELIMITED, delimited by 0A
      Data in file has same endianness as the platform
      Rows with all null fields are accepted
      Fields in Data Source:
        MY_STRING                       CHAR (255)
          Terminated by ","
          Enclosed by """ and """
          Trim whitespace same as SQL LoaderSo, what happens if you create the table as follows:
    CREATE TABLE davep2 (
       my_string         VARCHAR2(4000 BYTE)         NULL
    ORGANIZATION EXTERNAL
       (  TYPE ORACLE_LOADER
          DEFAULT DIRECTORY FILE_TEST
          ACCESS PARAMETERS
            ( RECORDS DELIMITED BY  0x'0A'  BADFILE FILE_TEST:'davep2.bad'
      LOGFILE FILE_TEST:'davep2.log'
      FIELDS TERMINATED BY ',' optionally enclosed by '"' and '"'
      missing field values are null
               my_string char(4000)
          LOCATION (FILE_TEST:'DaveP.csv')) REJECT LIMIT 0 NOPARALLEL

  • Difference between varchar2(4000 byte) & varchar2(4000 char

    Hi,
    My existing database NLS parameters as follows
    CHARACTER SET US7ASCII
    NATIONAL CHARACTER SET AL16UTF16
    created a test database to support globalization, I changed as follows
    CHARACTER SET UTF8
    NATIONAL CHARACTER SET UTF8
    some of the table column datatypes are varchar2(4000)
    I would like to know what is difference between VARCHAR2(4000 BYTE) and VARCHAR2(4000 CHAR).
    Thanks

    Indeed, VARCHAR2(x BYTE) means that the column will hold as much characters as will fit into x bytes. Depending on the character set and particular characters this may be x or less characters.
    For example, a VARCHAR2(20 BYTE) column in an AL32UTF8 database can hold 20 characters from the ASCII range, 10 Latin letters with umlaut, 10 Cyryllic, 10 Hebrew, or 10 Arabic letters (2 bytes per character), or 6 Chinese, Japanese, Korean, or Devanagari (Indic) characters. Or a mixture of these characters of any total length up to 20 bytes.
    VARCHAR2(x CHAR) means that the column will hold x characters but not more than can fit into 4000 bytes. Internally, Oracle will set the byte length of the column (DBA_TAB_COLUMNS.DATA_LENGTH) to MIN(x * mchw, 4000), where mchw is the maximum byte width of a character in the database character set. This is 1 for US7ASCII or WE8MSWIN1252, 2 for JA16SJIS, 3 for UTF8, and 4 for AL32UTF8.
    For example, a VARCHAR2(3000 CHAR) column in an AL32UTF8 database will be internally defined as having the width of 4000 bytes. It will hold up to 3000 characters from the ASCII range (the character limit), but only 1333 Chinese characters (the byte limit, 1333 * 3 bytes = 3999 bytes). A VARCHAR2(100 CHAR) column in an AL32UTF8 database will be internally defined as having the width of 400 bytes. It will hold up to any 100 Unicode characters.
    The above implies that the CHAR limit works optimally if it is lower than 4000/mchw. With such restriction, the CHAR limit guarantees that the defined number of characters will fit into the column. Because the widest character in any Oracle character set has 4 bytes, if x <= 1000, VARCHAR2(x CHAR) is guaranteed to hold up to x characters in any database character set.
    The declaration VARCHAR2(x):
    - for objects defined in SYS schema means VARCHAR2(x BYTE),
    - for objects defined in other schemas it means VARCHAR2(x BYTE) or VARCHAR2(x CHAR), depending on the value of the NLS_LENGTH_SEMANTICS parameter of the session using the declaration (see the NLS_SESSION_PARAMETERS view).
    After an object is defined, its BYTE vs CHAR semantics is stored in the data dictionary and it does not depend on the NLS_LENGTH_SEMANTICS any longer. Even Export/Import will not change this.
    Character length semantics rules are valid for table columns and for PL/SQL variables.
    -- Sergiusz

  • Error inserting XML records 4000 bytes through Pro*C

    Hi,
    I am seeing the following error while trying to insert XML records > 4000 bytes (Records < 4000 bytes get inserted without any issues). Any help in resolving the issue would be highly appreciated.
    ORA return text: ORA-01461: can bind a LONG value only for insert into a LONG column.
    I am also able to insert records > 4000 bytes using the following query, But, I want to insert the records through a C application (using Pro*C) that is not running on the database server.
    INSERT INTO MY_XML_TABLE
    VALUES (XMLType(bfilename('XML_DIR', 'MY_FILE.XML'),
    nls_charset_id('AL32UTF8')));
    Oracle Version
    ===============
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for Solaris: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    Pro*C/C++ version:
    ====================
    Pro*C/C++ RELEASE 11.2.0.0.0 - PRODUCTION
    Schema registration:
    ====================
    begin
    DBMS_XMLSCHEMA.registerSchema (
    SCHEMAURL => 'MY_XML_SCHEMA.xsd',
    SCHEMADOC => bfilename ('ENG_REPORTS', 'MY_XML_SCHEMA.xsd'),
    GENTYPES => FALSE,
    OPTIONS => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
    CSID =>nls_charset_id ('AL32UTF8'));
    end;
    Table creation
    ===============
    CREATE TABLE MY_XML_TABLE (
    MY_XML_RECORD XmlType )
    XMLTYPE MY_XML_RECORD STORE AS BINARY XML
    XMLSCHEMA "MY_XML_SCHEMA.xsd" ELEMENT "MYXMLTAG" ;
    Record Insertion (Pro*C generated code):
    =========================================
    /* EXEC SQL FOR :l_sizeof_array_togo
    insert INTO MY_XML_TABLE
    (MY_XML_RECORD )
    VALUES( XMLTYPE(:l_XML_ptr INDICATOR :l_XML_indicators )); */
    struct sqlexd sqlstm;
    sqlstm.sqlvsn = 12;
    sqlstm.arrsiz = 1;
    sqlstm.sqladtp = &sqladt;
    sqlstm.sqltdsp = &sqltds;
    sqlstm.stmt = "insert into MY_XML_TABLE (MY_XML_RECORD) values (XMLTYPE(:s1\
    :s2 ))";
    sqlstm.iters = (unsigned int )l_sizeof_array_togo;
    sqlstm.offset = (unsigned int )20;
    sqlstm.cud = sqlcud0;
    sqlstm.sqlest = (unsigned char *)&sqlca;
    sqlstm.sqlety = (unsigned short)4352;
    sqlstm.occurs = (unsigned int )0;
    sqlstm.sqhstv[0] = (unsigned char *)&l_XML_ptr->xml_record;
    sqlstm.sqhstl[0] = (unsigned long )8002;
    sqlstm.sqhsts[0] = ( int )sizeof(struct xml_rec_definition);
    sqlstm.sqindv[0] = ( short *)&l_XML_indicators->XML_record_ind;
    sqlstm.sqinds[0] = ( int )sizeof(struct XML_indicator);
    sqlstm.sqharm[0] = (unsigned long )0;
    sqlstm.sqadto[0] = (unsigned short )0;
    sqlstm.sqtdso[0] = (unsigned short )0;
    sqlstm.sqphsv = sqlstm.sqhstv;
    sqlstm.sqphsl = sqlstm.sqhstl;
    sqlstm.sqphss = sqlstm.sqhsts;
    sqlstm.sqpind = sqlstm.sqindv;
    sqlstm.sqpins = sqlstm.sqinds;
    sqlstm.sqparm = sqlstm.sqharm;
    sqlstm.sqparc = sqlstm.sqharc;
    sqlstm.sqpadto = sqlstm.sqadto;
    sqlstm.sqptdso = sqlstm.sqtdso;
    sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);
    }

    After selecting data from xmltab table I just received first line of xmldata file. i.e
    <?xml version="1.0" encoding="WINDOWS-12 52"?> <BAROutboundXM L xmlns="http://BARO
    That must be a display issue.
    What client tool are you using, and what version?
    If SQL*Plus, you won't see the whole content unless you set some options :
    {code}
    SET LONG <value>
    SET LONGCHUNKSIZE <value>
    {code}
    Could you try the following?
    {code}
    SET LONG 10000
    SELECT t.object_value.getclobval() FROM xmltab t;
    -- to force pretty-printing :
    SELECT extract(t.object_value, '/*').getclobval() FROM xmltab t;
    {code}
    Edited by: odie_63 on 16 févr. 2011 08:58

  • ORA-01461 Error when mapping table with multiple varchar2(4000) fields

    (Note: I think this was an earlier problem, supposed fixed in 11.0, but we are experiencing in 11.7)
    If I map an Oracle 9i table with multiple varchar2(4000) columns, targeting another Oracle 9i database, I get the ORA-01461 error (Can't bind a LONG value only for insert into a LONG).
    I have tried changing the target columns to varchar2(1000), as suggested as a workaround in earlier versions, all to no avail.
    I can have just one varchar2(4000) map correctly and execute flawlessly - the problem occurs when I add a second one.
    I have tried making the target column a LONG, but that does not solve the problem.
    Then, I made the target database SQL Server, and it had no problem at all, so the issue seems to be Oracle-related.

    Hi Jon,
    Thanks for the feedback. I'm unable to reproduce the problem you describe at the moment - if I try to migrate a TEXT(5), OMWB creates a VARCHAR(5) and the data migrates correctly!! However, I note from you description that even though the problematic source column datatype is TEXT(5), you mention that there are actually 20 lines of text in this field (and not 5 variable length characters as the definition might suggest).
    Having read through some of the MySQL reference guide I note that, in certain circumstances, MySQL actually changes the column datatype specified either at table creation time or when interfacing with other databases ( ref 14.2.5.1 Silent Column Specification Changes and 12.7 Using Column Types from Other Database Engines in the MySQL reference guide). Since your TEXT(5) actually contains 20 lines of text, MySQL (database or JDBC driver .... or both) may be trying to automatically map the specified datatype of the column to a datatype more appropriate to storing 20 lines of text.... that is, to a LONG value in this case. Then, when Oracle is presented with this LONG value to store in a VARCHAR(5) field, it throws the ORA-01461 error. I need to investigate this further, but this may be the case - its the first time I've see this problem encountered.
    To workaround this, you could change the datatype of the column to a LONG from within the Oracle Model before migrating. Any application code that accesses this column and expects a TEXT(5) value may need to be adjusted to cope with a LONG value. Is this a viable workaround for you?
    I will investigate further and notiofy you of any details I uncover. We will need to track this issue for possible inclusion in future development plans.
    I hope this helps,
    Regards,
    Tom.

  • Insert text on Column exceeding 4000 bytes

    Hi ,
    I create a table with two columns
    Create table A (B NUMBER ,C VARCHAR2(4000));
    I cant insert a text into coulmn C as it exceed its maximum allwable size.
    Please help .
    Thanks.

    VARCHAR2 in Oracle are limited to 4000 bytes. Anything longer you need to store as CLOB. Unfortunately, you can't alter column from VARCHAR2 to CLOB. You would have to do someting like:
    SQL> alter table a rename column c to d
      2  /
    Table altered.
    SQL> alter table a add c clob
      2  /
    Table altered.
    SQL> update a set c = d;
    0 rows updated.
    SQL> alter table a drop column d;
    Table altered.
    SQL> desc a
    Name                                                                     Null?    Type
    B                                                                                 NUMBER
    C                                                                                 CLOB
    SQL> So now column C is CLOB, it retains all values of old VARCHAR2 column C and you can insert values > 4000:
    SQL> insert into a values(1,to_clob(lpad('A',4000,'A')) || lpad('B',4000,'B'));
    1 row created.
    SQL> select length(c) from a
      2  /
    LENGTH(C)
          8000
    SQL> SY.

  • How to insert more than 4000 bytes in BLOB column

    Hi all,
    My oracle version is Oracle Database 11g Enterprise Edition Release 11.2.0.3.0.
    I have checked in google and in this forum also, but did not find the answer.
    When inserting into less than 4000 bytes, it is inserting without any issues. If i am inserting more than that, it is throwing
    error like this ORA-01460: unimplemented or unreasonable conversion requested.
    Can anybody guide me how to do this or link.
    Thanks in advance.
    Thanks,
    Pal

    user546710 wrote:
    Hi,
    Thank you very much for your reply.
    Before, I have not worked with BLOB column, so I don't know much about its using. Currently, I am using direct
    insert statement only. Its a normal stored procedure written in a package. I am calling this SP with other columns and
    with this BLOB column. I am able to insert into table, if the inserted file is less than 4000 bytes. If it is more than that,
    I am getting that problem.
    Thanks,
    VenuSQL variables can only hold 4000 bytes.
    PL/SQL can hold up to 32767
    I am getting that problem. 100% lacking in actionable detail
    post code & COMPLETE error message & code

  • Cannot INSERT records into Partitioned Spatial Table and Index

    I am trying to tune our Spatial Storage by creating partitioning our spatial_entity table and index. I used the World Geographic Reference System (GEOREF) creating a partition for each 15 x 15 degree grid square assigning a partition key of decimal longitude, decimal_latitude. The build went OK, however when trying to insert a data record I receive an ORA-14400: Inserted partition key does not map to any partition.
    I validated the CREATE(s), and all appears correct, but obviously something is not correct, which is prompting for expert help in this forum.
    I would be very grateful for your help.
    Below are the code snippets for the table and index, and an insert statement.
    CREATE TABLE spatial_entity
         geoloc_type VARCHAR2 (60 BYTE) NOT NULL
    ,entity_id NUMBER NOT NULL
    ,metadata_xml_uuid VARCHAR2 (40 BYTE) NOT NULL
    ,geoloc MDSYS.sdo_geometry NOT NULL
    ,nee_method CHAR (1 BYTE) NOT NULL
    ,nee_status CHAR (1 BYTE) NOT NULL
    ,decimal_latitude NUMBER (15, 6) NOT NULL
    ,decimal_longitude NUMBER (15, 6) NOT NULL
    PARTITION BY RANGE (decimal_longitude, decimal_latitude)
         PARTITION p_lt_0_90s
              VALUES LESS THAN (1, -90)
         ,PARTITION p_lt_0_75s
              VALUES LESS THAN (1, -75)
         ,PARTITION p_lt_0_60s
              VALUES LESS THAN (1, -60)
         ,PARTITION p_lt_0_45s
              VALUES LESS THAN (1, -45)
         ,PARTITION p_lt_0_30s
              VALUES LESS THAN (1, -30)
         ,PARTITION p_lt_0_15s
              VALUES LESS THAN (1, -15)
         ,PARTITION p_lt_0_0
              VALUES LESS THAN (1, 0)
         ,PARTITION p_lt_0_15n
              VALUES LESS THAN (1, 15)
         ,PARTITION p_lt_0_30n
              VALUES LESS THAN (1, 30)
         ,PARTITION p_lt_0_45n
              VALUES LESS THAN (1, 45)
         ,PARTITION p_lt_0_60n
              VALUES LESS THAN (1, 60)
         ,PARTITION p_lt_0_75n
              VALUES LESS THAN (1, 75)
         ,PARTITION p_lt_0_90n
              VALUES LESS THAN (1, maxvalue)
    CREATE INDEX geo_spatial_ind ON spatial_entity (geoloc)
    INDEXTYPE IS mdsys.spatial_index
    PARAMETERS ('layer_gtype=MULTIPOINT TABLESPACE=GEO_SPATIAL_IND') LOCAL
    (PARTITION p_lt_0_90s,
    PARTITION p_lt_0_75s,
    PARTITION p_lt_0_60s,
    PARTITION p_lt_0_45s,
    PARTITION p_lt_0_30s,
    PARTITION p_lt_0_15s,
    PARTITION p_lt_0_0,
    PARTITION p_lt_0_15n,
    PARTITION p_lt_0_30n,
    PARTITION p_lt_0_45n,
    PARTITION p_lt_0_60n,
    PARTITION p_lt_0_75n,
    PARTITION p_lt_0_90n,
    INSERT INTO spatial_entity
         geoloc_type
         ,entity_id
         ,metadata_xml_uuid
         ,geoloc
         ,nee_method
         ,nee_status
         ,decimal_latitude
         ,decimal_longitude
    VALUES
                   'BATCH'
                   ,0
                   ,'6EC25B76-8482-4F95-E0440003BAD57EDF'
                   ,"MDSYS"."SDO_GEOMETRY"
                        2001
                        ,8307
                        ,"MDSYS"."SDO_POINT_TYPE" (32.915286, 44.337902, NULL)
                        ,NULL
                        ,NULL
                   ,'M'
                   ,'U'
                   ,32.915286
                   ,44.337902
    Thank you for you help.
    Dave

    Thank you for your quick reply. I did not post the entire CREATE script as it is quite long. The portion of the script that is applicable to the INSERT is:
    ,PARTITION p_lt_45e_90s
              VALUES LESS THAN (23, -90)
         ,PARTITION p_lt_45e_75s
              VALUES LESS THAN (23, -75)
         ,PARTITION p_lt_45e_60s
              VALUES LESS THAN (23, -60)
         ,PARTITION p_lt_45e_45s
              VALUES LESS THAN (23, -45)
         ,PARTITION p_lt_45e_30s
              VALUES LESS THAN (23, -30)
         ,PARTITION p_lt_45e_15s
              VALUES LESS THAN (23, -15)
         ,PARTITION p_lt_45e_0
              VALUES LESS THAN (23, 0)
         ,PARTITION p_lt_45e_15n
              VALUES LESS THAN (23, 15)
         ,PARTITION p_lt_45e_30n
              VALUES LESS THAN (23, 30)
         ,PARTITION p_lt_45e_45n
              VALUES LESS THAN (23, 45)
         ,PARTITION p_lt_45e_60n
              VALUES LESS THAN (23, 60)
         ,PARTITION p_lt_45e_75n
              VALUES LESS THAN (23, 75)
         ,PARTITION p_lt_45e_90n
              VALUES LESS THAN (23, maxvalue)
    Or, I do not fully understand. Are you indicating that I must explcitly state the longitude in each clause,
    e.g ,PARTITION p_lt_45e_45n
              VALUES LESS THAN (45, 45)
    ,PARTITION p_lt_45w_45n
              VALUES LESS THAN (-45, 45)
    If so, that answers the question of why it cannot find a partition, however an Oracle White Paper "Oracle Spatial Partitioning Best Practices" Sept 2004, discusses multi column partitioning such as represented by this problem, and gives an INSERT statement example of :
    CREATE TABLE multi_partn_table (in_date DATE,
    geom SDO_GEOMETRY, x_value NUMBER, y_value NUMBER)
    PARTITION BY RANGE (X_VALUE,Y_VALUE)
    PARTITION P_LT_90W_45S VALUES LESS THAN (1,-45),
    PARTITION P_LT_90W_0 VALUES LESS THAN (1,0),
    PARTITION P_LT_90W_45N VALUES LESS THAN (1,45),
    PARTITION P_LT_90W_90N VALUES LESS THAN (1,MAXVALUE
    and as I am writing this I am seeing that I failed to include the longitude and latitude in the SDO_GEOMETRY clause, so it does appear tht I need to explicitly state the longitude valuues.
    What is your judgement sir?
    Dave

  • Cannot insert Chinese character into nvarchar2 field

    I have tested in two environments:
    1. Database Character Set: ZHS16CGB231280
    National Character Set: AL16UTF8
    If the field type of datatable is varchar2 or nvarchar2, the provider can read and write Chinese correctly.
    2. Database Character Set:WE8MSWIN1252
    National Character Set: AL16UTF8
    The provider can not read and write Chinese correctly even the field type of datatable is nvarchar2
    I find that for the second one, both MS .NET Managed Provider for Oracle and Oracle Managed Data Provider cannot read and write NCHAR or NVARCHAR2 fields. The data inserted into these fields become question marks.
    Even if I changed the NLS_LANG registry to SIMPLIFIED CHINESE_CHINA.ZHS16CGB231280, the result is the same.
    For the second situation, only after I change the Database Character Set to ZHS16CGB231280 with ALTER DATABASE CHARACTER SET statement, can I insert Chinese correctly.
    Does any know why I cannot insert Chinese characters into Unicode fields when the Database Character Set is WE8MSWIN1252? Thanks.
    Regards,
    Jason

    Hi Jason,
    First of all, I am not familiar with MS .NET Managed Provider for Oracle or Oracle Managed Data Provider.
    How did you insert these Simplified Chinese characters into the NVARCHAR2 column ? Are they hardcoded as string literals as part of the SQL INSERT statement ? If so, this could be because, all SQL statements are converted into the database character set before they are parsed by the SQL engine; hence these Chinese characters would be lost if your db character set was WE8MSWIN1252 but not when it was ZHS16CGB231280.
    Two workarounds, both involved the removal of hardcoding chinese characters.
    1. Rewrite your string literal using the SQL function UNISTR().
    2. Use bind variables instead of text literals in the SQL.
    Thanks
    Nat

  • Size for XMLType only 4000 Bytes???

    Hello,
    it seems, that the XMLType can only store up to 4000 bytes of
    data.
    When I enter a document larger than 4000 bytes the end is
    truncated and the "extract"-method doesn't work anymore.
    I have to store sizes of about 30-50 Kilobytes.
    So, is there a way to set the size of the XMLType?
    Has anyone else this problem?
    TIA
    Alex

    Hello,
    First, I want to thank you for helping me.
    So, I've tried to create my table without the schema and the pb is still the same.
    The index I create is a context index.
    I create my table with the following query:
    create table artefact(numArt number, art XMLType)
    xmltype column art XMLSCHEMA "http://www.oracle.com/artefact.xsd" element "exportList";
    CREATE SEQUENCE numArt START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE CACHE 2;
    create index ind on artefact(art)
    indextype is ctxsys.context;
    My schema seems to be Ok because it is validate by XMLSpy and when I use "little" data, everything is OK.
    Here is the way I register my schema:
    begin
         dbms_xmlschema.deleteSchema('http://www.oracle.com/artefact.xsd',4);
    end;
    declare
    doc varchar2(10000) := '
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
         <xsd:element name="exportList" type="TypeExportList"/>
         <xsd:complexType name = "TypeExportList">
              <xsd:sequence>
                   <xsd:element name = "request" type="TypeRequest"/>
              </xsd:sequence>
         </xsd:complexType>
         <xsd:complexType name="TypeRequest">
              <xsd:sequence>
                   <xsd:element name="artifact" type="TypeArtefact"/>
                   <xsd:element name="target" type="TypeTarget"/>
                   <xsd:element name="keyword" type="TypeKeyWord"/>
              </xsd:sequence>
              <xsd:attribute name = "targetTool" type="xsd:string" use="required"/>
              <xsd:attribute name = "targetVersion" type = "xsd:string" use="optional"/>
              <xsd:attribute name = "sourceTool" type = "xsd:string" use="optional"/>
              <xsd:attribute name = "cmpa" type = "xsd:string" use="required"/>
              <xsd:attribute name = "command" type = "xsd:string" use="required"/>
              <xsd:attribute name="readOnly" type = "xsd:string" use="required"/>
         </xsd:complexType>
         <xsd:complexType name="TypeArtefact">
              <xsd:sequence>
                   <xsd:element name= "object" type = "TypeObject"/>
              </xsd:sequence>
                   <xsd:attribute name = "projectName" type="xsd:string" use="required"/>
         </xsd:complexType>
         <xsd:complexType name="TypeObject">
                   <xsd:attribute name = "objectName" type = "xsd:string" use="required"/>
                   <xsd:attribute name = "objectType" type = "xsd:string" use="required"/>
         </xsd:complexType>
         <xsd:complexType name="TypeTarget">
                   <xsd:attribute name = "targetIP" type="xsd:string" use="required"/>
         </xsd:complexType>
         <xsd:complexType name="TypeKeyWord">
                   <xsd:attribute name = "word" xdb:SQLName="word" xdb:SQLType="CLOB"/>
         </xsd:complexType>
    </xsd:schema>'
    begin
    dbms_xmlschema.registerSchema('http://www.oracle.com/artefact.xsd',doc);
    end;
    Then, I insert the value as a clob (because the XML docs makes more than 4000 characters).
    And then I search it with the query:
    select numArt from artefact a
    where contains(a.art,'test inpath(exportList/request/keyword/@word)')>0;
    And if the attribute word makes more than 4000 characters, the word test is not found...

  • Advice on creating VARCHAR2(4000) columns

    Hi there
    I've a question regarding table(s) design. Following is a table, which has about 10,000 rows.
    As you can see there are two VARCHAR2(2000) columns.
    All rows have these columns with data which are always "full" (avglength = 2000).
    CREATE TABLE L_PROC
    NUM NUMBER(9) NOT NULL,
    TEC VARCHAR2(10 BYTE) NOT NULL,
    ATE DATE NOT NULL,
    PRO NUMBER(4) NOT NULL,
    NPR NUMBER(7) NOT NULL,
    DOC NUMBER(2) DEFAULT 0 NOT NULL,
    COC NUMBER(2) DEFAULT 0 NOT NULL,
    FOC NUMBER(2) DEFAULT 0 NOT NULL,
    SIT CHAR(1 BYTE) NOT NULL,
    EST CHAR(1 BYTE) DEFAULT 'A' NOT NULL,
    DEN DATE NOT NULL,
    SOL NUMBER(9) NOT NULL,
    LOC VARCHAR2(80 BYTE),
    CEE NUMBER(3),
    CTE VARCHAR2(10 BYTE),
    DEC NUMBER(2) DEFAULT null,
    DIA VARCHAR2(2000 BYTE),
    RES      VARCHAR2(2000 BYTE),
    OUT VARCHAR2(80 BYTE),
    NTS VARCHAR2(80 BYTE),
    ETS VARCHAR2(40 BYTE),
    DAL TIMESTAMP(6) NOT NULL
    When record is created in table, DIA is always filled. Then RES will be updated later.
    Now end-users ask for modification which consists in alter these two column to VARCHAR2(4000).
    I'm thinking on create these two columns in a separated table (perhaps using blob or clob), but I'd like to have some advice on this.
    I'm a bit worried about chained rows.
    Can you help me on this ? What solution do you think is better ?
    Thank you in advance.
    Best Regards,
    Helena

    Replying to Maurice questions:
    do you mostly access your table via index or full table scan?
    mostly via index
    how many rows do you access when you execute a select against this table?
    using users criteria the first step is to perform a select count(*) using that criteria; table data is displayed to the user if the result of count(*) is <= 100 rows
    how often do you query the RES and DIA columns?
    never queried, but always displayed; that means never used in WHERE clauses
    how often are inserts and updates executed against this table?
    about 100/day inserts and the same number of updates (which are performed by another user later)
    which is you DB block size?
    16 KB
    which is the average sizes of the columns RES and DIA?
    1900 (will probably increase +1000 chars)
    do you have currently any kind of performance bottleneck (IO/CPU)?
    not yet...
    Helena

  • Is there any way to store data larger than 4000 bytes?

    Hi,
    Could someone here know which data type to store database column size larger than 4000 bytes.
    VARCHAR2 has the limit of 4000 bytes in database column. Is there ways to store data larger than 4000 bytes?
    Thank you very much!

    CLOB
    You use the CLOB datatype to store large blocks of character data in the database, in-line or out-of-line. Both fixed-width and variable-width character sets are supported. Every CLOB variable stores a locator, which points to a large block of character data. The size of a CLOB cannot exceed four gigabytes.
    CLOBs participate fully in transactions, are recoverable, and can be replicated. Changes made by package DBMS_LOB can be committed or rolled back. CLOB locators can span transactions (for reads only), but they cannot span sessions.
    Joel P�rez

  • Why not everytime declare varchar2(4000)?

    hello,
    I am using Oracle 11g.
    I just wanted to know is there anything wrong in every time declaring a field with var char(4000) in pl/sql?
    Thanks

    There is no difference for VARCHAR2 database columns. However some GUI tools may use that information to propose different length of text fields to input/display data. I didn't work with front-end tools since Forms 4.5, but at that time Oracle Designer was able to generate longer text fields for longer database columns (it doesn't mean that these dimensions were always correct).
    There is some difference for PL/SQL VARCHAR2 variables. Memory is allocated differently.
    Oracle Database PL/SQL Language Reference:
    Memory Allocation for Character Variables For a CHAR variable, or for a VARCHAR2 variable
    whose maximum size is less than 2,000 bytes, PL/SQL allocates enough memory for
    the maximum size at compile time. For a VARCHAR2 whose maximum size is 2,000
    bytes or more, PL/SQL allocates enough memory to store the actual value at run time.
    In this way, PL/SQL optimizes smaller VARCHAR2 variables for performance and
    larger ones for efficient memory use.
    For example, if you assign the same 500-byte value to VARCHAR2(1999 BYTE) and
    VARCHAR2(2000 BYTE) variables, PL/SQL allocates 1999 bytes for the former
    variable at compile time and 500 bytes for the latter variable at run time.

Maybe you are looking for

  • How to remove bought app from app store 'archive'

    since a while in the App store (both on iPhone or on the computer) it's possible to re-install old purchases of apps that you once downloaded and deleted. that's cool. more than two years ago i downloaded viber, deleted it, never re-installed or used

  • Camera Raw and CS4

    I have downloaded the latest camera raw files. Since I have CS4 I also had to download and install Application Manager, did that.  I am still unable to install the camera raw file, any suggestions on how to do this?

  • Using different URL with iweb

    I was wondering if I could use iweb to set up a web site, but I want the address to be just a basic ".com" address. (without the .mac// stuff) Can I do this with a .mac account, or do I need to use a different web hosting company?

  • How do you stop a mouse squeaking?

    I know, it sounds like a joke but my mouse squeaks. When I click, it often squeaks or groans. Still works, but the noise is irritating. Anyone got any solutions? It's the standard Apple one I got with my iMac G5 in 2005, Model M5769. Machine Name: iM

  • Adding xml to scrolling text window

    The problem is, I used this tutorial to make my scroll window. It seems to coding method isn't the best way to do it, as it makes it a pain in the *** to update. The guy didn't even put it in as an actionscript text, I would have to open up the text