Skip to Content
0

Updating a long nvarchar string truncates

May 23, 2017 at 12:17 PM

144

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

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

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

Share
10 |10000 characters needed characters left characters exceeded
Arcady Abramov May 23, 2017 at 05:43 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 23, 2017 at 08:45 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Arcady Abramov May 24, 2017 at 05:38 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Chris Keating
May 29, 2017 at 02:38 PM
0
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.
Share
10 |10000 characters needed characters left characters exceeded