Dameng database reports an error when executing a sql statement: Table [xxx] cannot contain aggregate KEY and large fields at the same time.

Recently, when deploying and testing an application with Dameng database, when using SQL statements to create tables and insert data, the following error occurred: Table [xxx] cannot contain aggregate KEY and large fields at the same time, as shown in the following figure:

Cause of the problem: Dameng database sets the primary key to clustered index by default when creating a table. After the table is created successfully, add it to the table. Large field types will report an error.

The system I am currently testing directly generates data tables through hibernate. This results in: firstly, when creating the table, it is not possible to specify the primary key and create large fields; secondly, it is not possible to specify a non-clustered index so that large fields can be added later. ; Therefore, it can be handled by configuring the PK_WITH_CLUSTER parameters of the database instance.

Reference:-3243: Aggregation KEY and large fields cannot be included at the same time_bp0707's blog-CSDN blog_aggregation key and large fields cannot be included at the same time

The specific operations are as follows:

./disql SYSDBA/SYSDBA:5236 #Connect to the current database instance. If it is a remote connection, use ./disql SYSDBA/password@server IP address or hostname:port number to enter.

SQL> sp_set_para_value(1,'PK_WITH_CLUSTER',0); #Execute sql command to set support for aggregation keys and large fields

After setting the database instance to support simultaneous aggregation and large fields, delete the original generated table first, and then generate the table again, and this error will no longer be reported.

Supongo que te gusta

Origin blog.csdn.net/yeyuningzi/article/details/126749990
Recomendado
Clasificación