[Operation and Maintenance|Database] Mysql migration Jincang database stepping pit notes (continuously updated...)

kingabse view:

  1. The view body of Jincang database is sql statement, create or replace is provided by basic attributes, and the final structure can be viewed in DDL;
  2. Variables do not need to include ' ', you can use "" or no quotes, the variable type is customized through ::type, the error in the figure below is: union all puts all query result sets into the same table, provided that each query result The table structure of the set must be similar, that is, the attribute types must be consistent, and the AS alias method must be used to ensure that they are in the same column. The mismatch between integer and bit is caused by the inconsistency of the attribute types of the same column during the union connection. It is necessary to force a column of attribute types to be consistent through custom ::type
  3. It can also be assigned directly through 0::bigint AS mode, that is, assign 0 to the mode field;

kingbase function:

  1. Type declaration part (declare): mysql is placed after begin, kingbase is placed between AS and BEGIN;
  2. The main body of the kingbase function is a sql statement, other parts are generated in the basic attributes, and the final structure is viewed in DDL;
  3. MySQL uses SET to assign values ​​to variables, such as set levelCount = 0; kingabse uses := to assign values ​​to variables, such as levelCount := 0;
  4. Loop: the while judgment statement must end with a loop, mysql end while is changed to end loop; ISNULL(v) is changed to v.ISNULL;

kingbase trigger:

  1. The main body is the sql statement, and the other parts are in the basic attributes;
  2. The function NEW.id represents the new id value after the insert operation, and OLD.id represents the original id value;
  3. The type row indicates a row-level trigger, that is, for each row; the type statement is a table-level trigger, that is, for each statement;

other

floor(extract(epoch from now())): generate the current timestamp;

Guess you like

Origin blog.csdn.net/macaiyun0629/article/details/132178152
Recommended