DB2 reported SQLCODE204, SQLSTATE42704 error solution is actually because no alias was built

When jdbc links DB2, SQLCODE204, SQLSTATE42704 error solution

needs to create an alias, because MPOS does not have an alias, but directly use IBBDKUSR as the 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
)

so it is necessary to establish the aliases of these tables of the login user mpos,


quote
create alias MPOS.USER_INFO for IBBDKUSR.USER_INFO


In this way, there is no need to bring schema in sql, and it is also convenient to transplant in the future.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326220578&siteId=291194637