I used
CREATE TABLE "roundtrip"
(
"pk" INTEGER NOT NULL,
"avalue" BIT,
PRIMARY KEY ("pk")
) to create a new table named roundtrip. Then I read the metadata of this table so as to check whether or not this table was correctly built as expected. However, I've got the following error:
"Required status not the same for column pk. expected: but was:."
SQL Syntax which you provide describes that "Column can store null values, so that constraint NOT NULL is ignored."
I would ask you how this problem can be solved?
|
As the error message included angle brackets, this message is not correctly displayed. I paste it again:
Required status not the same for column pk. expected:<true> but was::<false>
|
>SQL Syntax which you provide describes that "Column can store null values, so that
> constraint NOT NULL is ignored."
Yeah.
>I would ask you how this problem can be solved?
>PRIMARY KEY ("pk")
You have assigned it as primary key, so that it's impossible to store more than one null value for pk.
|
������DatabaseMetaData.getColumns(...)���s������roundtrip������columns�����������������������pk������������������IS_NULLABLE��������NO��������������������������������������
According to JDBC specification, IS_NULLABLE is defined as follows:
NO means the column definitely does not allow NULL values;
YES means the column might allow NULL values. An empty
string means nullability is unknown.
|
>������DatabaseMetaData.getColumns(...)���s������roundtrip������columns�����������������������pk������
>������������IS_NULLABLE��������NO��������������������������������������
��������������������������������ResultSetMetaData.columnNullableUnknown������������������������������IS_NULLABLE���������������������YES, NO�����������������������������NO.
|
|
������������������������������IS_NULLABLE����������������������NO������������������YES��������������������������2������
|