【问题标题】:Error Attribute 'Computed' is not allowed to appear in element 'column'错误属性“计算”不允许出现在元素“列”中
【发布时间】:2019-08-05 08:55:40
【问题描述】:

我正在尝试使用虚拟列创建 oracle 表,如下所示 在液基中 创建表 MY_TABLE ( entry_datetime DATE 不为空, entry_date DATE AS (TRUNC(entry_datetime)))

根据文档,我尝试使用 ValueComputed 属性,如下所示

<changeSet author="base_script" id="idx_31710" context="btr_rem" dbms = "oracle">
</changeSet>
<changeSet author="my_scripts" id="t11" dbms="oracle">
<createTable
          remarks= ""
          tableName= "my_table1">
<column name="entry_datetime" type="date" >
          <constraints nullable="false"/>
</column>
<column name="entry_date" type="DATE"  ValueComputed="TRUNC(entry_datetime)"></column>
</createTable>
</changeSet>

当我运行它时,它会给出如下错误 cvc-complex-type.3.2.2:属性“ValueComputed”不允许出现在元素“列”中。

我尝试使用计算属性作为 但它给出错误 cvc-complex-type.3.2.2:属性“计算”不允许出现在元素“列”中。

【问题讨论】:

    标签: liquibase


    【解决方案1】:

    您正在创建一个新表,而不是为列分配值。 这需要defaultValueComputed 属性。

    例如: &lt;column name="entry_date" type="DATE" defaultValueComputed="TRUNC(entry_datetime)"&gt;&lt;/column&gt;

    【讨论】:

      猜你喜欢
      • 2016-08-11
      • 1970-01-01
      • 2015-04-21
      • 2018-03-22
      • 2012-11-20
      • 2023-04-08
      • 1970-01-01
      • 2014-11-27
      • 1970-01-01
      相关资源
      最近更新 更多