Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Data type NVARCHAR larger than 5000?

$
0
0

Hello,

 

There is a following definition in the SAP document "SAP HANA SQL and System Views Reference - SAP HANA Platform SPS 11 (Document Version: 1.0 – 2015-11-25)“:

"The NVARCHAR(n) data type specifies a variable-length Unicode character set string, where <n> indicates the maximum length in characters and is an integer between 1 and 5000.”

 

But HAHA allows nvarchar larger than 5000 (see test procedure 1). The allowable maximum length is 8388607 (see test procedure 2)

My question is whether may I use nvarchar larger than 5000?

 

Regards.

Yujun Hu

 

---------------------------------------------

createprocedure TEST_PROC_1

as

begin

       declare s nvarchar(20000) = '';     -- test with length 20000

      

       declare i int;

       for i in 1 .. 2000 do

             s := :s || '1234567890';

       endfor;

      

       select :s as X, length(:s) as LEN from dummy;

    /* It works. Output: LEN=20000 */

end;


---------------------------------------------

createprocedure TEST_PROC_2

as

begin

       declare s nvarchar(9000000) = '';

    /* error */

end;


SAP HANA message:

specified length too long for its datatype: the identifier "S" is too long. Maximum length is 8388607

 

---------------------------------------------



Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>