Limitations of Pb on varchar type of database fields 255

Source: Internet
Author: User
Tags odbc connection sybase sybase database

Because Pb is a product of Sybase, it follows the 255 varchar type limitation of Sybase Database. However, the varchar of SQL Server has reached 8000, while the DBM OF Pb can only process 255. I personally think there are the following solutions to this problem. Welcome to the discussion.

1. Use ODBC connection instead of direct database connection.

2. If you still use direct connection, you can use text to replace varchar (500)

3. If you still use direct connection or varchar (500), you can use the following methods:
Data Table (n_id integer not null PK, c_content varchar (500) null ):

To write data to a database, you can create a DW. The data source is the n_id and c_content of the table.
At this time, you will find that the limit of c_content is 255. you can change the data window export, edit the SRD file, change the limit of c_content to 500, and import it back to enter the 500 character and update it successfully.
Note: If you directly change the limit value to 500, an error is returned when you enter a character greater than 255.

If you want to read the database, take varchar (1000) as an example:
Define four calculation columns:
Select column1, column2 ,......, substring (REM, 1, Len (REM)/4) C1, substring (REM, Len (REM)/4 + 1, Len (REM)/4) C2, substring (REM, Len (REM)/4*2 + 1, Len (REM)/4) C3, substring (REM, Len (REM)/4*3 + 1, len (REM)/4) C4,

In addition, the calculated column C5 = C1 + C2 + C3 + C4

 

 

A better way to pass the test:

// Profile
Sqlca. DBMS = "MSS Microsoft SQL Server 6.x"
Sqlca. Database = "master"
Sqlca. logpass = 'sa'
Sqlca. servername = "data"
Sqlca. logid = "sa"
Sqlca. autocommit = false
Sqlca. dbparm = ""
Connect;

String ls_c
Select cast (unit as text) into: ls_c from TB;
MessageBox (string (LEN (ls_c), ls_c)
Select unit into: ls_c from TB;
MessageBox (string (LEN (ls_c), ls_c)

 

Result

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.