DG4ODBC: STRING DATA, RIGHT TRUNCATION ERROR WHILE ACCESSING VARCHAR(MAX) COLUMN

Problem Summary
DG4ODBC: STRING DATA, RIGHT TRUNCATION ERROR WHILE ACCESSING VARCHAR(MAX) COLUMN
Driver
Microsoft® ODBC Driver 11 for SQL Server® - RedHat Linux
Problem Description
When selecting a MS SQL VARCHAR (max) column over a ODBC Gateway database connection I am getting this error from Oracle:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Microsoft][ODBC Driver 11 for SQL Server]String data, right truncation {01004}
[Microsoft][ODBC Driver 11 for SQL Server]String data, right truncation {01004}
[Microsoft][ODBC Driver 11 for SQL Server]String data, right truncation {01004}
[Microsoft][ODBC Driver 11 for SQL Server]String data, right truncation {01004}
[Microsoft][ODBC Driver 11 for SQL Server]String data, right truncation {01004}
ORA-02063: preceding 2 lines from <LINK_NAME>
The ODBC driver should map the varchar(max) column to SQL_LONGVARCHAR which would be appropriate for Oracle but the column is getting truncated
Issue
By default the SQL Server ODBC driver exposes the varchar(max) data type as a SQL_VARCHAR. When reporting the maximum size of a varchar(max) column, the driver returns 0, which is the Microsoft convention for "unlimited".
  [ODBC][25518][1399527750.588980][SQLDescribeCol.c][497]
  Exit:[SQL_SUCCESS]                
  Column Name = [raw_response]                
  Data Type = 0x7fffe3cbe1a4 -> 12                
  Column Size = 0x7fffe3cbe158 -> 0                
  Decimal Digits = 0x7fffe3cbe1ac -> 0                
  Nullable = 0x7fffe3cbe1b0 -> 1
DG4ODBC is unable to interpret a zero length as an "unlimited" size and returns an error when retrieving varchar(max) data.
FreeTDS and DataDirect ODBC drivers  return SQL_LONGVARCHAR instead of SQL_VARCHAR with 0 precision. So there is no problem reported for these drivers.
Is there a fix for this or is the Microsoft ODBC driver team working on a fix for the driver regarding varchar(max)?
Regards,
James

Hi James,
Thank you for your question. I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
If you have any feedback on our support, please click
here.
Regards, 
Elvis Long
TechNet Community Support

Similar Messages

  • String data right truncation error

    Hi, what does this message mean?
    Thread id: 14 : Fail to load bulk into DB ERROR in TTCommand.cpp, line 329: Error in TTCmd::Execute() while executing statement
    [TimesTen][TimesTen 7.0.5.6.0 ODBC Driver]String data right truncation
    *** ODBC Error/Warning = 22001, TimesTen Error/Warning = 0
    *** Command execution of statement <insert into TA.TEST values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)> failed.*** Error in TTCmd::ExecuteBatch() : batch of <105> operations failed; only <1> operations succeeded
    Thanks in advance,
    Andrey

    It means what it says. You are trying to insert a string into a CHAR/VARCHAR/NVARCHAR/BINARY/VARBINARY field and the length of the data you are trying to insert is longer than the defined maximum length of a column.
    For example, given a table such as:
    CREATE TABLE T1
    COL1 VARCHAR2(4)
    and the prepared statement
    INSERT INTO T1 VALUES ( ? );
    If I pass 'ABCD' for the parameter then all works fine but if I pass 'ABCDE' for the parameter I get
    22001: String data right truncation
    You need to ensure that no data you pass in exceeds the expected column width.
    Chris

  • ODBC functions SQLExecDirectW and SQLExecute functions return error:"DIAG [22001] [Microsoft][SQL Server Native Client 10.0]String data, right truncation (0) "

    Problem Description:
    ODBC functions SQLExecDirectW and SQLExecute functions return error:”DIAG [22001] [Microsoft][SQL Server Native Client 10.0]String data, right
    truncation (0) “. When we enable tracing in the ODBC administrator, in the SQL.log we see that values for the arguments: ColumnSize, BufferLength, and StrLen_or_IndPtr of ODBC function SQLBindParameter are not being displayed.
    Environment Used:
    OS: Microsoft Windows Server 2003 R2 Standard x64 Edition.
    Complier: Microsoft Visual Studio 2008 SP1 for x64.
    Database: Microsoft SQL Server 2008
    MDAC: Microsoft Data Access Components SDK 2.8
    Note: This problem is seen only in our 64bit application. However, in 32bit
    SQLExecDirectW and SQLExecute functions return successfully.
    As we could not find the values of 6<sup>th</sup>, 9<sup>th</sup> and 10<sup>th</sup> arguments(ColumnSize,
    BufferLength, and StrLen_or_IndPtr) passed to
    SQLBindParameter in the ODBC traces for 64bit, we are not sure whether the values for the above mentioned arguments are received correctly by SQLBindParameter or not. This information would help us to debug further. So, could you please let us know why
    these values are not displayed.
    1)Here is the extract of the SQL.log file for 32bit where the values for SQLULEN , SQLLEN and SQLLEN* are displayed properly:
    PR0CNFG 1028-15f0 ENTER SQLBindParameter
    HSTMT 0x006FBDD8
    UWORD 1
    SWORD 1 <SQL_PARAM_INPUT>
    SWORD -8 <SQL_C_WCHAR>
    SWORD -9 <SQL_WVARCHAR>
    SQLULEN 23
    SWORD 0
    PTR 0x0595EBBA
    SQLLEN 46
    SQLLEN * 0x05A5FB00
    2)Here is the extract of the SQL.log file for 64bit where the values for SQLULEN , SQLLEN are not displayed properly and
    SQLExecDirectW function return error:”DIAG
    [22001] [Microsoft][SQL Server Native Client 10.0]String data, right truncation (0) “. :
    PR0CNFG a78-fe4 ENTER SQLBindParameter
    HSTMT 000000000431D2F0
    UWORD 1
    SWORD 1 <SQL_PARAM_INPUT>
    SWORD -8 <SQL_C_WCHAR>
    SWORD -9 <SQL_WVARCHAR>
    SQLULEN SQLULEN SWORD 0
    PTR 0x0000000005364EFA
    SQLLEN SQLLEN
    SQLLEN * SQLLEN *
    PR0CNFG a78-fe4 EXIT SQLBindParameter with return code 0 (SQL_SUCCESS)
    HSTMT 000000000431D2F0
    UWORD 1
    SWORD 1 <SQL_PARAM_INPUT>
    SWORD -8 <SQL_C_WCHAR>
    SWORD -9 <SQL_WVARCHAR>
    SQLULEN SQLULEN SWORD 0
    PTR 0x0000000005364EFA
    SQLLEN SQLLEN SQLLEN *

    Hi Nalsr,
    From my research, I found:
    "[Microsoft][ODBC SQL Server Driver]String
    data right truncation" error may be returned from a call to
    SQLBindParameter if the size of the string parameter being used is greater than the size of the column being compared to. In other words if the
    string size of the <expression> to the left of the <comparison_operator> is less than the
    string size of the <expression> to the
    right, ODBC may return this error.
    The resolution is to make the string size of the <expression> to the
    right of the <comparison_operator> less than or equal to the
    string size of the <expression> on the left.
    It is difficult to track down this type of problem when third party development applications are being used. ODBC Trace can be used to help determine if this problem is occuring.
    Here is an example where the customer has submitted a query "select count(*) from type1 where type1 = ?", type1 is varchar(5) and the
    data type being passed by the application is char[9].
    Here is the relevant portion of the trace. The following information from the "exit" of SQLDescribeParam
    SWORD * 0x0095e898 (12)
    UDWORD * 0x0095e880 (5)
    Maps to the following with the actual value in parenthesis - SQL_VARCHAR Size 5:
    SQLSMALLINT *DataTypePtr
    SQLUINTEGER *ParameterSizePtr
    The "exit" value from SQLBindParameter provides the following
    information:
    SWORD 1 <SQL_PARAM_INPUT>
    SWORD 1 <SQL_C_CHAR>
    SQL Data Type SWORD 12 <SQL_VARCHAR>
    Parameter Size UDWORD 5
    SWORD 0
    Value PTR 0x0181c188
    Value Buffer Size SDWORD 5
    String Length SDWORD * 0x0181c103 (9)
    The string length parameter is the length of the
    string being bound to the parameter, in this instance there is a size mismatch which results in the SQLError and the SQLErrorW with the message "[Microsoft][ODBC SQL Server
    Driver]String data
    right truncation" .
    Hope this could be helpful.
    Best regards,
    Halin Huang

  • Getting SQLSTATE:22001(Message : [Microsoft][SQL Server Native Client 11.0]String data, right truncation) in SQL Server 2012 but in SQL server 2008 R2.

    I have an application which connects to SQL through ODBC 11.
    ODBC statement is :
    SELECT PID
    FROM PENTITY PENTITY01 WHERE ((NUM1 NOT BETWEEN ? + 10.7895 AND ? + 200.6734 AND NUM2 NOT IN (5996/ 8, ? - 89.3892, ? + 80.7543))
    and the SQLBindparameter statement is :
    static UCHAR num1[12]=12.589
    rc = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, sqlType, precision, scale,
    &num1, sizeof(num1), NULL);
    With this SQLBindparameter statement I am getting error, It is working without any error if I change the value to 12.
    The same code is working when connecting to SQL server 2008.
    Thanks in advance.

    Hi Nalsr,
    From my research, I found:
    "[Microsoft][ODBC SQL Server Driver]String
    data right truncation" error may be returned from a call to
    SQLBindParameter if the size of the string parameter being used is greater than the size of the column being compared to. In other words if the
    string size of the <expression> to the left of the <comparison_operator> is less than the
    string size of the <expression> to the
    right, ODBC may return this error.
    The resolution is to make the string size of the <expression> to the
    right of the <comparison_operator> less than or equal to the
    string size of the <expression> on the left.
    It is difficult to track down this type of problem when third party development applications are being used. ODBC Trace can be used to help determine if this problem is occuring.
    Here is an example where the customer has submitted a query "select count(*) from type1 where type1 = ?", type1 is varchar(5) and the
    data type being passed by the application is char[9].
    Here is the relevant portion of the trace. The following information from the "exit" of SQLDescribeParam
    SWORD * 0x0095e898 (12)
    UDWORD * 0x0095e880 (5)
    Maps to the following with the actual value in parenthesis - SQL_VARCHAR Size 5:
    SQLSMALLINT *DataTypePtr
    SQLUINTEGER *ParameterSizePtr
    The "exit" value from SQLBindParameter provides the following
    information:
    SWORD 1 <SQL_PARAM_INPUT>
    SWORD 1 <SQL_C_CHAR>
    SQL Data Type SWORD 12 <SQL_VARCHAR>
    Parameter Size UDWORD 5
    SWORD 0
    Value PTR 0x0181c188
    Value Buffer Size SDWORD 5
    String Length SDWORD * 0x0181c103 (9)
    The string length parameter is the length of the
    string being bound to the parameter, in this instance there is a size mismatch which results in the SQLError and the SQLErrorW with the message "[Microsoft][ODBC SQL Server
    Driver]String data
    right truncation" .
    Hope this could be helpful.
    Best regards,
    Halin Huang

  • Msg 0, Sev 0, State 1: Unknown token received from SQL Server [SQLSTATE HY000] String data, right truncation [SQLSTATE 01004] [SQLSTATE 08S01] error

    I'm looking for some general guidance on this complete error:
    Msg 0, Sev 0, State 1: Unknown token received from SQL Server [SQLSTATE HY000]
    String data, right truncation [SQLSTATE 01004]
    Msg 16389, Sev 16, State 1: The connection is no longer usable because the server response for a previously executed statement was incorrectly formatted. [SQLSTATE 08S01]
    This error is caused by a SQL Agent Job, but it does not always occur. I understand this could be an issue with SQL dropping the connection, but what is the best way to troubleshoot this?
    Thanks,
    Phil

    Hi philliptackett77,
    It would be more helpful for troubleshooting the issue if you post the SQL Server error log and SQL Server version. Additionally, please state what purpose of using the agent job.
    Based on my research, [SQLSTATE 08S01] error means communication link failure. If the executed statement returns invalid value in the job, the connection between server and client will fail. This error could be caused by the error of [SQLSTATE HY000] and
    [SQLSTATE 01004]. I’d like to share my knowledge about these errors as below.
    Quote: String data, right truncation [SQLSTATE 01004]
    This error could occur when passing data whose length is larger than the received object,and the passed value is truncated, and returns invalid value. So please check if the data type of the objects are identical and the length of passed value is not larger
    than the received object.
    Quote: Msg 0, Sev 0, State 1: Unknown token received from SQL Server [SQLSTATE HY000]
    The error could occur in the two cases below.
    1. If you use SQL Server version 6.50, and execute the cursor in the job step, set the statement options to use a server-side cursor and prepare a select statement on a SQL Server system table. The first execution of the select creates the cursor successfully.
    After you close this cursor, if you execute the prepared statement again, the error could occur.
    I recommend you to apply the latest service pack firstly. If the error still occurs, you could change your code by using a forward-only cursor instead of a static, keyset, or dynamic cursor on the system tables. If a forward-only cursor is unacceptable,
    prepare the select statement again on the system table and execute it to create a server-side cursor. For more information about the process, please refer to the article:
    http://support.microsoft.com/kb/151693/en-us
    2. The TDS stream from the server is invalid when transfer data between a database server and a client. This error is typically caused by a problem on the server. For more information about errors above, please refer to the article:
    http://technet.microsoft.com/en-us/library/aa937531(v=sql.80).aspx
    Regards,
    Michelle Li

  • WARNING OGG-00869  Oracle GoldenGate Delivery, repdb2.prm:  [SQL error 0 (0x0)][Oracle][ODBC PostgreSQL Wire Protocol driver]String data, right truncated.

         When I migrate CLOB datas from Oracle 10g to PostgreSQL 9.0,and the target data type is text,the replicat process abend,and it reports as following:
    WARNING OGG-03056  Oracle GoldenGate Delivery, repdb2.prm:  Source table SDCMNET.T_INFO_SUPERIOR_PROGRAM column PRO_CONTENT_CLOB data size exceeds the maximum target table sdcmnet.t_info_superior_program column pro_content_clob size. Automatic truncation is enabled for all tables/columns without further warnings.
    WARNING OGG-00869  Oracle GoldenGate Delivery, repdb2.prm:  [SQL error 0 (0x0)][Oracle][ODBC PostgreSQL Wire Protocol driver]String data, right truncated.
    WARNING OGG-01004  Oracle GoldenGate Delivery, repdb2.prm:  Aborted grouped transaction on 'sdcmnet.t_info_superior_program', Database error 0 ([SQL error 0 (0x0)][Oracle][ODBC PostgreSQL Wire Protocol driver]String data, right truncated.
         But,according to the SEQNO and RBA,I find the records have been migrated,and the length of records is equal to what is in oracle.Then I try to use the odbc driver of postgresql 9.3 to replace,although I can login the database ,but it warns again.
         Can anyone help me?

    This forum is for Oracle Maven Repository.  You might have more luck posting your question in an forum for GoldenGate - you are more likely to find someone who knows about that product in its own forums.

  • ORA-28500 + "String data, right truncation" when selecting nvarchar(max)

    Hi,
    I was able to set up a db link from Oracle 11.2.0.1 to SQL Server 2005 using DG4ODBC.
    When trying to select a column with nvarchar(max) datatype from the db link I get the following error:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Microsoft][SQL Native Client]String data, right truncation {01004}[Microsoft][SQL Native Client]String data, right truncation {01004}[Microsoft][SQL Native Client]String data, right truncation {01004}[Microsoft][SQL Native Client]String data, right truncation {01004}[Microsoft][SQL Native Client]String data, right truncation {01004}
    ORA-02063: preceding 2 lines from SQLSERVER_DBLINKThe actual data in the column doesn't exceed 31 chars but the query still fails.
    Any suggestions?
    Thanks.

    The character set is AL32UTF8
    Here is the relevant data from the trace file:
    Entered hgopars, cursor id 1 at 2010/12/23-12:08:59
    type:0
    SQL text from hgopars, id=1, len=47 ...
         00: 53454C45 43542041 312E2243 6F6D6D65  [SELECT A1."Comme]
         10: 6E742220 46524F4D 20224442 4F222E22  [nt" FROM "DBO"."]
         20: 565F4442 56455253 494F4E22 204131    [V_DBVERSION" A1]
    Exiting hgopars, rc=0 at 2010/12/23-12:08:59
    hostmstr: 2011148288:      HOA After hoxpars
    hostmstr: 2011148288:      HOA Before hoxopen
    Entered hgoopen, cursor id 1 at 2010/12/23-12:08:59
    hgoopen, line 87: NO hoada to print
    Deferred open until first fetch.
    Exiting hgoopen, rc=0 at 2010/12/23-12:08:59
    hostmstr: 2011148288:      HOA After hoxopen
    hostmstr: 2011148288:      HOA Before hoxdscr
    Entered hgodscr, cursor id 1 at 2010/12/23-12:08:59
    Allocate hoada @ 038B493C
    Entered hgopcda at 2010/12/23-12:08:59
    Column:1(Comment): dtype:-9 (WVARCHAR), prc/scl:0/0, nullbl:1, octet:0, sign:1, radix:0
    Exiting hgopcda, rc=0 at 2010/12/23-12:08:59
    hgodscr, line 910: Printing hoada @ 038B493C
    MAX:1, ACTUAL:1, BRC:100, WHT=5 (SELECT_LIST)
    hoadaMOD bit-values found (0x40:TREAT_AS_NCHAR)
    DTY         NULL-OK  LEN  MAXBUFLEN   PR/SC  CST IND MOD NAME
    12 VARCHAR Y          0          0 128/  0 1000   0  40 Comment
    Exiting hgodscr, rc=0 at 2010/12/23-12:08:59
    hostmstr: 2011148288:      HOA After hoxdscr
    hostmstr: 2011148288: RPC After SQL Bundling
    hostmstr: 2011148288: RPC Before SQL Bundling
    hostmstr: 2011148288:      HOA Before hoxclse
    Entered hgoclse, cursor id 1 at 2010/12/23-12:08:59
    Exiting hgoclse, rc=0 at 2010/12/23-12:08:59
    hostmstr: 2011148288:      HOA After hoxclse
    hostmstr: 2011148288:      HOA Before hoadafr
    Entered hgodafr, cursor id 1 at 2010/12/23-12:08:59
    Free hoada @ 038B493C
    Exiting hgodafr, rc=0 at 2010/12/23-12:08:59
    hostmstr: 2011148288:      HOA After hoadafr
    hostmstr: 2011148288:      HOA Before hoxpars
    Entered hgopars, cursor id 1 at 2010/12/23-12:08:59
    type:0
    SQL text from hgopars, id=1, len=47 ...
         00: 53454C45 43542041 312E2243 6F6D6D65  [SELECT A1."Comme]
         10: 6E742220 46524F4D 20224442 4F222E22  [nt" FROM "DBO"."]
         20: 565F4442 56455253 494F4E22 204131    [V_DBVERSION" A1]
    Exiting hgopars, rc=0 at 2010/12/23-12:08:59
    hostmstr: 2011148288:      HOA After hoxpars
    hostmstr: 2011148288:      HOA Before hoxopen
    Entered hgoopen, cursor id 1 at 2010/12/23-12:08:59
    hgoopen, line 87: NO hoada to print
    Deferred open until first fetch.
    Exiting hgoopen, rc=0 at 2010/12/23-12:08:59
    hostmstr: 2011148288:      HOA After hoxopen
    hostmstr: 2011148288:      HOA Before hoxdscr
    Entered hgodscr, cursor id 1 at 2010/12/23-12:08:59
    Allocate hoada @ 038B6C98
    Entered hgopcda at 2010/12/23-12:08:59
    Column:1(Comment): dtype:-9 (WVARCHAR), prc/scl:0/0, nullbl:1, octet:0, sign:1, radix:0
    Exiting hgopcda, rc=0 at 2010/12/23-12:08:59
    hgodscr, line 910: Printing hoada @ 038B6C98
    MAX:1, ACTUAL:1, BRC:100, WHT=5 (SELECT_LIST)
    hoadaMOD bit-values found (0x40:TREAT_AS_NCHAR)
    DTY         NULL-OK  LEN  MAXBUFLEN   PR/SC  CST IND MOD NAME
    12 VARCHAR Y          0          0 128/  0 1000   0  40 Comment
    Exiting hgodscr, rc=0 at 2010/12/23-12:08:59
    hostmstr: 2011148288:      HOA After hoxdscr
    hostmstr: 2011148288: RPC After SQL Bundling
    hostmstr: 2011148288: RPC Before Fetch Row
    hostmstr: 2011148288:      HOA Before hoaftch
    Entered hgoftch, cursor id 1 at 2010/12/23-12:08:59
    hgoftch, line 130: Printing hoada @ 038B6C98
    MAX:1, ACTUAL:1, BRC:100, WHT=5 (SELECT_LIST)
    hoadaMOD bit-values found (0x40:TREAT_AS_NCHAR)
    DTY         NULL-OK  LEN  MAXBUFLEN   PR/SC  CST IND MOD NAME
    12 VARCHAR Y          0          0 128/  0 1000   0  40 Comment
    Performing delayed open.
    SQLBindCol: column 1, cdatatype: -8, bflsz: 2
    Entered hgopoer at 2010/12/23-12:08:59
    hgopoer, line 233: got native error 0 and sqlstate 01004; message follows...
    [Microsoft][SQL Native Client]String data, right truncation {01004}[Microsoft][SQL Native Client]String data, right truncation {01004}[Microsoft][SQL Native Client]String data, right truncation {01004}[Microsoft][SQL Native Client]String data, right truncation {01004}[Microsoft][SQL Native Client]String data, right truncation {01004}
    Exiting hgopoer, rc=0 at 2010/12/23-12:08:59
    hgoftch, line 740: calling SQLFetch got sqlstate 01004
    Entered hgopoer at 2010/12/23-12:08:59
    hgopoer, line 233: got native error 0 and sqlstate 01004; message follows...
    [Microsoft][SQL Native Client]String data, right truncation {01004}[Microsoft][SQL Native Client]String data, right truncation {01004}[Microsoft][SQL Native Client]String data, right truncation {01004}[Microsoft][SQL Native Client]String data, right truncation {01004}[Microsoft][SQL Native Client]String data, right truncation {01004}
    Exiting hgopoer, rc=0 at 2010/12/23-12:08:59
    hgoftch, line 971: calling SQLGetData got sqlstate 01004
    100 rows fetched
    Exiting hgoftch, rc=28500 at 2010/12/23-12:08:59 with error ptr FILE:hgoftch.c LINE:971 ID:Row error while doing array fetch
    hostmstr: 2011148288:      HOA After hoaftch
    hostmstr: 2011148288: RPC After Fetch RowThanks

  • [Oracle][ODBC SQL Server Driver]String data, right truncation {01004}

    While importing data from SQL Server 2005 to Oracle gateway 11g Release2, i am getting following error:
    insert into CSDescr select * from CSDescr@sqlserver
    ERROR at line 1:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    +[Oracle][ODBC SQL Server Driver]String data, right truncation {01004}+
    ORA-02063: preceding 2 lines from SQLSERVER
    Oracle database characterset is AL32UTF8
    SQLServer database characterset is SQL_Latin1_General_CP1_CI_AS
    Following is the configuration in the parameter file for gateway:
    HS_KEEP_REMOTE_COLUMN_SIZE=LOCAL
    HS_NLS_LENGTH_SEMANTICS=CHAR
    I think setting the HS_LANGUAGE parameter shall fix the error but I  want to know what should be the value of this parameter?

    HS_LANGUAGE needs to be set to a character set that is used by the foreign database
    So try: HS_LANGUAGE=american_america.WE8MSWIN1252
    Also specify HS_NLS_NCHAR=UCS2 as the nvarchars of a SQl Server are stored in UCS2 character set

  • Datetime field overflow / String data right truncation

    Hi All,
    Getting the follwing erros while working with timestamp for selecting from or inserting data into DB2 through WebSphere 6.1.
    I am passing values like this: 2006-05-02-21.57.26.744341.
    The queries run fine while executing through some SQL Frontend editor.
    [IBM][CLI Driver] CLI0114E Datetime field overflow. SQLSTATE=22008
    [IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=22001
    Please let me know the problem.

    If you are trying to convert to a java.sql.Timestamp as part off the process of inserting into DB2 then Timestamp is derived from java.util.Date which holds the time in milli-seconds but you are providing a microseconds field.
    Could this be the problem?

  • String data right truncation

    I have a PreparedStatement to insert into a 104 column table. When I run the procedure it throwing an exception
    [IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=22001
    COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=22001
    How can I find out which column is doing this?
    Is there any method or a call I can use to pin point the error?
    thanks,

    And exactly how many fields do you have that can cause the problem?
    The problem is because you are passing more text than can fit into a field. So how many fields do you have like that?

  • [JDBC Progress Driver]:String data, right truncated.

    Hi everybody,
    I have a strange error that i just cannot figure out.
    I have a entitybean with an EJBStore method. In that method I create a PreparedStatement like this
    String update = "update myTable set commentField = ? where objectnumber = ?";
    PreparedStatement pstmt = con.prepareStatement(update);
    pstmt.setString(1, commentString);
    pstmt.setString(2, objectnumber); The database field "commentField" has a max of 250 characters as defined in the database. The string "commentString" is a normal string.
    The problem is, if any character higher than ALT-127 is stored, it seems that 2 bytes are used when validating field length. This means that I can store 250 of "A"'s (ALT-065) but just 125 "�"'s (ALT-128).
    When I try to update the field with 126+ "�"'s i get the folowing message:
    javax.ejb.EJBException: [JDBC Progress Driver]:String data, right truncated.  Error in parameter 1.This errormessage is exactly the same when I try to update the same field with 251+ "A"'s
    The strangest is: manually, with a SQL-tool provided by Progress I can easily add 250 "�"'s in the database. So I think it might be the JDBC driver.
    This maybe has something to do with encodings, but when I use "String.getbytes()" with different encodings en count the number of bytes, these are always correct (byte[].length <= 250) and the same errormessage appears.
    Could someone shed some ligth on my problem? I'm completely lost.
    Thank you for your time and attention,
    Leon Noordermeer
    [email protected]
    Some extra info:
    JDK1.2.1
    Progress 91A
    JDBC driver suplied with Progress 91A
    Apptivity 3.2

    Hello!
    Did anyone get jdbc connection with Progress dabase successfully?
    Did any one know this error message when I connect from client to server?
    java.sql.SQLException: [JDBC Progress Driver]:Exceeding permissible number of connections.
    I would greatly appreciate if anyone can let me know.

  • Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right trun

    I am getting the following error like "07/01 17:33:33 (3380 0EC4): Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right truncated."
    What does this error means.The set of query I am running for insertion is same for 32bit(Windows 2003 Server) and 64bit (Windows 2008 Server R2).
    In case of the former this works perfectly without any error but in case of 64bit I am getting the above issue.Any suggestion would be of great help and what is the workaround for this.
    Thanks in advance.
    -R

    Sorry for incomplete information. Basically there is a insertion and then there is retrieval of information from the same data table.
    When I am inserting data of blob type I am getting data and grabage value also.
    From the backend when I am using plsql and querying on that paritcular table from the 2nd row onwards I am getting garbage value apended with the string.How I see the garbage is when I click on the blob data under the plsql respective table it takes me to string by default for all the columns containing blob and from 2nd column onwards I get the garbage appended with the string.
    This garbage value is not present in the 1st row at all but it from the 2nd row it comes.
    desc of the particular table I am talking about is
    SQL> desc Table_1084;
    Name Null? Type
    BBID NOT NULL NUMBER
    KEYORDER NOT NULL NUMBER
    KEYLENGTH NOT NULL NUMBER
    DTTM_DOM NOT NULL NUMBER(2)
    KEYVALUE BLOB
    2ndly I tried to remove the garbage using memset.This time there is no garbage but from the 2nd row onwards when I click on the blob from the plsql backend
    I did memset for deleting the garbage.But then after 2nd column onwards when I click on the blob it takes me hex by default not to text.When I come to text I don't see any garbage.
    In both the cases I get the above error when I try to retrieve the above information from the DB.
    The same set of query runs well when I use Windows 32bit but I am getting issue when I am using Windows 2008 Server 64bit.
    Below I have given the code snipet any thoughts or inputs would be very much appreciated.
    SQLLEN lsqlkeyElementIDLengths = *(this->keyElementIDLengths);
    SQLBindParameter(this->statement,1, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementBlackBoxIDs, 0, &lsqlkeyElementIDLengths);
    SQLLEN lsqlkeyElementOrderLengths = *(this->keyElementOrderLengths);
    SQLBindParameter(this->statement,2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementOrders, 0, &lsqlkeyElementOrderLengths);
    SQLLEN lsqlkeyElementLengthLengths = *(this->keyElementLengthLengths);
    SQLBindParameter(this->statement,3, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementLengths, 0, &lsqlkeyElementLengthLengths);
    SQLLEN lsqlkeyElementValueLengths = *(this->keyElementValueLengths);
    SQLBindParameter(this->statement,4, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY,
    elementSize, 0, this->keyElementValues,
    elementSize, &lsqlkeyElementValueLengths);
    SQLExecDirect(this->statement, (unsigned char*) insertcommand, SQL_NTS);
    Here the this->keyElementValues is of void pointer.
    When I query on the back ground I get the below garbage value
    ntdll.dll!KiFastSystemCallRet 0x7c8285ec
    kernel32.dll + 0x24ed (0x77e424ed)
    termite.exe!CTermiteDlg::TestRegisterMemoryProc 0x004050ed c:\cm\build\public\tkbkwincln.10-01-06\talkback\src\client\termite\win32\termdlg.cpp, line 460Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾
    Let me know if I can provide more information.
    Thanks,
    -R

  • Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right trunca

    Dear All,
    I am getting the following error like "07/01 17:33:33 (3380 0EC4): Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right truncated."
    What does this error means.The set of query I am running for insertion is same for 32bit(Windows 2003 Server) and 64bit (Windows 2008 Server R2).
    In case of the former this works perfectly without any error but in case of 64bit I am getting the above issue.Any suggestion would be of great help and what is the workaround for this.
    When I am inserting data of blob type I am getting data and grabage value also.
    From the backend when I am using plsql and querying on that paritcular table from the 2nd row onwards I am getting garbage value apended with the string.How I see the garbage is when I click on the blob data under the plsql respective table it takes me to string by default for all the columns containing blob and from 2nd column onwards I get the garbage appended with the string.
    This garbage value is not present in the 1st row at all but it from the 2nd row it comes.
    desc of the particular table I am talking about is
    SQL> desc Table_1084;
    Name Null? Type
    BBID NOT NULL NUMBER
    KEYORDER NOT NULL NUMBER
    KEYLENGTH NOT NULL NUMBER
    DTTM_DOM NOT NULL NUMBER(2)
    KEYVALUE BLOB
    2ndly I tried to remove the garbage using memset.This time there is no garbage but from the 2nd row onwards when I click on the blob from the plsql backend
    I did memset for deleting the garbage.But then after 2nd column onwards when I click on the blob it takes me hex by default not to text.When I come to text I don't see any garbage.
    In both the cases I get the above error when I try to retrieve the above information from the DB.
    The same set of query runs well when I use Windows 32bit but I am getting issue when I am using Windows 2008 Server 64bit.
    Below I have given the code snipet any thoughts or inputs would be very much appreciated.
    SQLLEN lsqlkeyElementIDLengths = *(this->keyElementIDLengths);
    SQLBindParameter(this->statement,1, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementBlackBoxIDs, 0, &lsqlkeyElementIDLengths);
    SQLLEN lsqlkeyElementOrderLengths = *(this->keyElementOrderLengths);
    SQLBindParameter(this->statement,2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementOrders, 0, &lsqlkeyElementOrderLengths);
    SQLLEN lsqlkeyElementLengthLengths = *(this->keyElementLengthLengths);
    SQLBindParameter(this->statement,3, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementLengths, 0, &lsqlkeyElementLengthLengths);
    SQLLEN lsqlkeyElementValueLengths = *(this->keyElementValueLengths);
    SQLBindParameter(this->statement,4, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY,
    elementSize, 0, this->keyElementValues,
    elementSize, &lsqlkeyElementValueLengths);
    SQLExecDirect(this->statement, (unsigned char*) insertcommand, SQL_NTS);
    Here the this->keyElementValues is of void pointer.
    When I query on the back ground I get the below garbage value
    ntdll.dll!KiFastSystemCallRet 0x7c8285ec
    kernel32.dll + 0x24ed (0x77e424ed)
    termite.exe!CTermiteDlg::TestRegisterMemoryProc 0x004050ed c:\cm\build\public\tkbkwincln.10-01-06\talkback\src\client\termite\win32\termdlg.cpp, line 460Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾
    Let me know if I can provide more information.
    Thanks,
    -R

    Dear All,
    I am getting the following error like "07/01 17:33:33 (3380 0EC4): Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right truncated."
    What does this error means.The set of query I am running for insertion is same for 32bit(Windows 2003 Server) and 64bit (Windows 2008 Server R2).
    In case of the former this works perfectly without any error but in case of 64bit I am getting the above issue.Any suggestion would be of great help and what is the workaround for this.
    When I am inserting data of blob type I am getting data and grabage value also.
    From the backend when I am using plsql and querying on that paritcular table from the 2nd row onwards I am getting garbage value apended with the string.How I see the garbage is when I click on the blob data under the plsql respective table it takes me to string by default for all the columns containing blob and from 2nd column onwards I get the garbage appended with the string.
    This garbage value is not present in the 1st row at all but it from the 2nd row it comes.
    desc of the particular table I am talking about is
    SQL> desc Table_1084;
    Name Null? Type
    BBID NOT NULL NUMBER
    KEYORDER NOT NULL NUMBER
    KEYLENGTH NOT NULL NUMBER
    DTTM_DOM NOT NULL NUMBER(2)
    KEYVALUE BLOB
    2ndly I tried to remove the garbage using memset.This time there is no garbage but from the 2nd row onwards when I click on the blob from the plsql backend
    I did memset for deleting the garbage.But then after 2nd column onwards when I click on the blob it takes me hex by default not to text.When I come to text I don't see any garbage.
    In both the cases I get the above error when I try to retrieve the above information from the DB.
    The same set of query runs well when I use Windows 32bit but I am getting issue when I am using Windows 2008 Server 64bit.
    Below I have given the code snipet any thoughts or inputs would be very much appreciated.
    SQLLEN lsqlkeyElementIDLengths = *(this->keyElementIDLengths);
    SQLBindParameter(this->statement,1, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementBlackBoxIDs, 0, &lsqlkeyElementIDLengths);
    SQLLEN lsqlkeyElementOrderLengths = *(this->keyElementOrderLengths);
    SQLBindParameter(this->statement,2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementOrders, 0, &lsqlkeyElementOrderLengths);
    SQLLEN lsqlkeyElementLengthLengths = *(this->keyElementLengthLengths);
    SQLBindParameter(this->statement,3, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementLengths, 0, &lsqlkeyElementLengthLengths);
    SQLLEN lsqlkeyElementValueLengths = *(this->keyElementValueLengths);
    SQLBindParameter(this->statement,4, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY,
    elementSize, 0, this->keyElementValues,
    elementSize, &lsqlkeyElementValueLengths);
    SQLExecDirect(this->statement, (unsigned char*) insertcommand, SQL_NTS);
    Here the this->keyElementValues is of void pointer.
    When I query on the back ground I get the below garbage value
    ntdll.dll!KiFastSystemCallRet 0x7c8285ec
    kernel32.dll + 0x24ed (0x77e424ed)
    termite.exe!CTermiteDlg::TestRegisterMemoryProc 0x004050ed c:\cm\build\public\tkbkwincln.10-01-06\talkback\src\client\termite\win32\termdlg.cpp, line 460Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾
    Let me know if I can provide more information.
    Thanks,
    -R

  • Getting Error while accessing the data using odata service

    Hi All,
    Iam new to SAP FIORI. 
    Iam getting the below error while accessing the data using odata service.
    "Failed to load resource: the server responded with a status of 404 (Not found)"
    "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin "
    i have tried all the solutions like changing the url pattern "proxy/htttp".
    and disabled - security in chrome (Chrome is Updated version).
    i tried with IE still got the same problem.
    And installed all the required software in eclipse
    While installing GWPA plugin i got the following error.
    let me know if any one have idea.
    Thanks in advance.

    > Do you want to add and/or update the data in the already existing tables or do you want to replace the content completely?
    >
    > so in that way :
    > bot the options are fine what ever take less time.
    Sorry mate, but YOU have to know what you want here.
    I gave you an easy to follow set of steps.
    As you don't seam to mind the outcome, just might just use them...
    > I wanted to know weathe i can use the  loadercli for thie export import or not? if yes then is there any new steps to do before i do the export import?
    We had this discussion before...
    >
    > For that the easiest option would be just to drop the tables of SAPR3 and run the import again.
    >
    > For ease of use you could also just do:
    > - logon as superdba
    > - drop user SAPR3
    > - create user SAPR3 password SOMEPW not exclusive dba
    >
    > After these steps you can easily pump the data into the database again.
    >
    > So here in th above given steps , i am creating a new SAPR3 user and why it is not exclusive dba ?
    >  i already have that user SAPR3 can i use the same.
    Yes, you do have the SAPR3 user.
    But you don't seem to like to read documentation or learn about how the tools work or anything like that.
    Therefore I gave you s simple way to reach your goal.
    Of course it's possible to reuse the user.
    But then you would have to deal with already existing tables, already existing data etc.
    You don't seem to be able to do that. So, the easy steps might be better suited for your needs.
    regards,
    Lars

  • Buffer Table not up to date error while accessing Catalogs

    Hello,
    I am getting Buffer table not up-to-date error while accessing ARIBA Procurement Catalogs.
    Initially, my Test system was pointing to Production Catalogs but now, when I changed the settings in "Define External Web Services" and pointed it to DEV Catalogs, it is failing with error: "Buffer Table not up-to-Date"
    Refreshed the Buffer already but still error not fixed.
    We already have the similar settings in other systems and there the connections are working fine
    Please advise
    Regards
    Manish Agrawal

    Hi Manish,
    Could you please check the below notes and implement the same since I had the same issue upon punching out from the catalog to SRM system.
    2041631 - Simplified Shopping Cart:Dump on Check Out From Catalog
    2086844 - Dump "Buffer table not up-to-date" on Check Out from Catalog
    In addition to the above, please maintain the portal information in the path as shown in the below screen shot
    Kindly check and let me know on how it goes.
    Best Regards,
    Bharathi

Maybe you are looking for