Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » UltraLiteJ » UltraLiteJ 参考 » UltraLiteJ API 参考 » Connection 接口

 

createForeignKey 方法

创建新的外键。

语法
ForeignKeySchema Connection.createForeignKey(
  String table_name,
  String primary_table_name,
  String name
) throws ULjException
参数
  • table_name   包含外键的表的名称。该表被限制为必须包括对主表的有效引用。

  • primary_table_name   包含被引用列的表的名称。

  • name   外键的名称。所指定的名称必须是有效的 SQL 标识符。

注释
注意

UltraLiteJ 不强制对表进行外键约束。外键用于确定对多个表进行同步时要遵循的正确顺序。客户端数据库上的外键应与客户端要与之同步的统一数据库中的关系相匹配。

返回值

定义了名称和相关表的 ForeignKey。