Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: CM8.4.0.3
-
Fix Version/s: CM/CQB-2013.04
-
Component/s: CUBRID Manager, CUBRID Query Browser
-
Environment:
CM8.4.1.0009
Description
1 create one table
CREATE TABLE "d"(
"v" national character(2) DEFAULT N'33',
"v2" national character(2) DEFAULT N'44',
"bit1" bit(1) DEFAULT B'1',
"v4" national character(2) DEFAULT N'dd',
"b" double SHARED 2 NOT NULL,
"v1" national character(2) DEFAULT N'33',
"a" national character(2) DEFAULT N'dd',
"shared1" date SHARED DATE'08/09/2011' NOT NULL
);
2 open query editor,input sql statement:
INSERT INTO "d" ("v", "v2", "bit1", "v4") VALUES (N'3', '43', B'0', '3');
it will pop error, please see the attachment
Addtional
When input insert into "d" ("v", "v2", "bit2", "v4") values (N'5', N'55', B'0', N'3'); it's ok.
"ERROR:Cannot coerce '3' to type nchar"The error is from server.
"INSERT INTO "d" ("v", "v2", "bit", "v4") VALUES (cast(N'3' as nchar(1))); " The sql maybe come from JDBC. In other space,there will display the error sql. (For example:http://www.jira.cubrid.org/browse/TOOLS-241)
When change the sql to
INSERT INTO "d" ("v", "v2", "bit", "v4") VALUES (N'3', cast(N'43' as nchar(2)), B'0', cast(N'3' as nchar(1)));
It's ok.
So the sql display in warning is not good. Let understand it is error by sql not example. I hope there is example, but please tell us that is example. Thanks.