选择查询中的Oracle更新查询| 错误ORA-01733虚拟列在这里不允许

库纳尔·沃拉(Kunal Vohra)
update(
    select id, word, status
           case when sm = 1 and status = 'Renew' 
                then coalesce(lgst, 'Add') 
           else status
           end as status1, 
           timestamp,
clob_column
    from
        (select id, word, status, 
                sum(case when status = 'Renew' then 1 else 0 end) over (partition by id order by timestamp) as sm,
                lag(status) over (partition by id order by timestamp) as lgst, timestamp, clob_column
           from your_table)_
set clob_column = REPLACE( clob_column , '"key":'||status, '"key":'||status1);

在查询上方运行给我错误

set clob_column = REPLACE(clob_column,'“ key”:'||状态,'“ key”:'|| status1)错误在命令行:26列:7错误报告:SQL错误:ORA-01733:不允许虚拟列此处01733。00000-“此处不允许使用虚拟列”

我的Oracle版本12c

乔恩·海勒

更新子查询有一些怪异的限制,可以通过使用MERGE语句来避免

merge into your_table
using
(
    select
        id, word, status, timestamp, clob_column,
        case when sm = 1 and status = 'Renew' then coalesce(lgst, 'Add') else status end as status1
    from
    (
        select
            id, word, status, timestamp, clob_column, rowid the_rowid,
            sum(case when status = 'Renew' then 1 else 0 end) over (partition by id order by timestamp) as sm,
            lag(status) over (partition by id order by timestamp) as lgst
        from your_table
    )
) new_rows
    on (your_table.rowid = new_rows.rowid)
when matched then update set
        clob_column = replace(clob_column , '"key":'||status, '"key":'||status1);

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

数据库更新后的ORA-01733(此处不允许使用虚拟列)

为什么在这里看到“ Access-Control-Allow-Origin不允许来源”错误?

错误:第6行的'{'标记之前不允许在这里进行功能定义

如何运行这样的SQL查询。我在这里遇到错误ORA-01427

尝试替换列时,Oracle SQL错误“ ORA-00984:此处不允许列”

如何解决此错误 - ORA-22818:不允许子查询表达式?

从视图创建表-Oracle SQL SQL错误:ORA-01723:不允许长度为零的列

Oracle 12c-插入到选择查询中的歧义列,ORA-00918

存储过程错误中不允许子查询

oracle查询ORA00907中缺少右括号错误

如何修复Yaml文件中的“在这种情况下不允许映射值”错误?

使用选择子查询执行更新查询,返回ora-01427错误

在Oracle的选择查询中隐藏列

子查询中的选择查询给出选择列表中的列无效,因为其中不包含错误

Oracle中的查询错误

{“错误”:“不允许在查询中显式构造实体类型“ ###”。”}

在这种情况下不允许子查询

EclipseLink:对本机查询“ INSERT INTO”中的“不允许更新”

使用合并更新列时出现错误:ORA-38104

收到错误:“ ORA-20999:无法解析SQL查询!<p> ORA-06550:第3行,第25列:ORA-00936:缺少表达式

Oracle:错误ORA-00937:Oracle Join查询中不是单组组函数

INSERT INTO 得到“Oracle SQL Developer 错误 - 此处不允许列”

Oracle选择查询带有内部选择查询错误

列不允许为空。简单成员资格mvc5中的INSERT失败错误

ORA-00942 子查询错误

在Oracle中执行sql查询时抛出ORA-00911无效错误

Koenig的查询在这里适用吗?

Oracle-选择查询中的XMLType列比较

此处不允许的列错误