DB2 报SQLCODE204,SQLSTATE42704错误解决方法 实际上是因为没有建alias

jdbc链接DB2时报SQLCODE204,SQLSTATE42704错误解决方法

需要建立别名, 因为MPOS没有别名,而直接用 IBBDKUSR 来作为schema


SET SCHEMA = 'IBBDKUSR';

CREATE TABLE "IBBDKUSR"."USER_INFO" (
"ID" BIGINT NOT NULL GENERATED ALWAYS
AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20,
NO MINVALUE, NO MAXVALUE, NO CYCLE, NO ORDER),
"USER_ID" BIGINT,
"USER_CODE" VARCHAR(32),
"USER_NAME" VARCHAR(32),
"PASSWORD" VARCHAR(64),
"EMAIL" VARCHAR(32),
"PHONE" VARCHAR(32),
"DEPART_CODE" VARCHAR(32),
"STCD" CHARACTER(1),
"CREATE_TIME" DATE,
"UPDATE_TIME" DATE
)

所以需要用 把登录用户 mpos 的 这些表的别名建立起来,


[quote][b]create alias MPOS.USER_INFO for IBBDKUSR.USER_INFO[/b][/quote]

这样就不需要在sql里面带 schema了, 以后移植也方便

你可能感兴趣的:(DB,db2,alias)