Skip to Content

Updating a long nvarchar string truncates

Hello, all

I have a long nvarchar field in SQL Anywhere 16 DB.

I am trying to update it through PB.

When the string is less than 32K everything is fine. When it is longer, it truncates itself without any error.

Question: is there a way to update a long string using an embedded update statement. Would it work if I set up a DW with field length of 512000 ?

Thank you

Arcady

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    May 23, 2017 at 01:28 PM

    Hi Arcady;

    You probably need to set the maximum text length in the SA connection (PBMaxTextSize) ...

    For example: SQLCA.DBParm = " PBMaxTextSize='64000' "

    HTH

    Regards ... Chris

    Add comment
    10|10000 characters needed characters exceeded

  • May 23, 2017 at 05:43 PM

    Actually, I already have it.

    But it does not seem to affect the regular update statement from embedded SQL:

    //-----------------------------

    update t_table set c_field = :very_long_text where c_id = :ll_id;

    //-----------------------------

    Does it only work on a DW ?

    I work in PB.NET 12.5.2

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 23, 2017 at 08:45 PM

    Hi Arcady;

    Sorry ... I only use PB Classic. I am not sure if there are differences between the DWO's DML usages between the two PB versions. In PB v12.5.x Classic & higher though, you can now use the new TableBob support in the DWO's to handle super large columns. That feature is not supported though in PB.Net.

    Note: PB.Net is now "end of life" (EOL'ed) and no new development has been done on it since 2015. Note that the new PB 2017 is solely based on the PB Classic IDE code-line.

    Regards ... Chris

    Add comment
    10|10000 characters needed characters exceeded

  • May 24, 2017 at 05:38 AM

    BTW, will this parameter work on ODBC connections as well?

    I work with SLQ Anywhere 16, and the help says that this parameter works with native client for MSSQL

    Add comment
    10|10000 characters needed characters exceeded

  • May 29, 2017 at 02:38 PM
    An nchar/nvarchar in SQL Anywhere has a maximum of 32K characters. Depending on the specifics of the characters, it may require >32k for storage. If the byte size >32k, you will likely need to use SELECTBLOB and UPDATEBLOB.As an asideL There is not a byte semantic form for nchar/nvarchare where as in char/varchar supports both byte and character semantics. By default, char/varchar uses byte semantics. That means in a default case, the maximum size in bytes if 32k. However, character semantics permit 32k characters so in a multibyte character set its size can exceed 32k bytes.
    Add comment
    10|10000 characters needed characters exceeded