简体   繁体   English

此Oracle SQL在Oracle Apex中不起作用

[英]This Oracle SQL doesn't work in Oracle Apex

if :p6_internal_id is null then 

INSERT INTO  table 
 (

   id,
   account  
  )

values
  (

    tseq_id.nextval,
   :p6_account,


  );

    else

  update table set "all columns"  where id = :p6_internal_id;

  end if ;

This says 这说

ORA-00927: missing equal sign ORA-00927:缺少等号

for the update set "all columns" line. update set "all columns"行。

I don't know how to fix this. 我不知道该如何解决。 How do I set the value of all the columns where id is what I enter? 如何设置ID为我输入的所有列的值?

Based on your comments, you just need to change that line to: 根据您的评论,您只需要将该行更改为:

update table set account = :p6_account where id = :p6_internal_id;

You don't need to set the id column to :p6_internal_id as you know it already has that value - since you're using it in the where clause. 您无需将id列设置为:p6_internal_id因为您知道它已经具有该值-因为您在where子句中使用了它。

There is no magic value of '"all columns"' that would allow every column to be updated at once, not least because you need to supply a value that corresponds to every column anyway, and in the right order. 没有“所有列”的神奇值可以立即更新每一列,这尤其重要,因为您需要始终以正确的顺序提供与每一列相对应的值。

If you have multiple columns to set then you have to list them all explicitly, with each column/value pair separated by commas; 如果要设置多个列,则必须显式列出所有列,每个列/值对之间用逗号分隔; eg with a few made-up columns and bind variables: 例如,有一些虚构的列和绑定变量:

update table set account = :p6_account,
  name = :p6_name,
  amount := p6_amount
where id = :p6_internal_id;

You can see the required syntax in the documentation . 您可以在文档中看到所需的语法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM