ora-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 3977658
  • 博文数量: 536
  • 博客积分: 10470
  • 博客等级: 上将
  • 技术积分: 4825
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-26 14:08
文章分类

全部博文(536)

文章存档

2024年(3)

2021年(1)

2019年(1)

2017年(1)

2016年(2)

2013年(2)

2012年(10)

2011年(43)

2010年(10)

2009年(17)

2008年(121)

2007年(252)

2006年(73)

相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: oracle

2007-02-02 18:27:15

ora-14552: cannot perform a ddl, commit or rollback inside a query or dml
    cause: ddl operations like creation tables, views etc. and transaction control statements such as commit/rollback cannot be performed inside a query or a dml statement.
    action: ensure that the offending operation is not performed or use autonomous transactions to perform the operation within the query/dml operation.

eg:
create or replace function osm_dml_3sp.osm_tab_funcfunc1(t in integer)
  return integer is rt integer;
  col0 osm_tab_func.col_0%type := 48;
begin
  savepoint do_del;
  delete from osm_dml_3sp.osm_tab_func where col_0 < col0 t;

  if sql%found then
    rollback to do_del;
    insert into osm_dml_3sp.osm_tab_func select * from osm_dml_3sp.osm_tab_func;
    commit comment 'insert data two times.';
  end if;

  select count(*) into rt from osm_dml_3sp.osm_tab_func;
  return rt;
end;

-- this is the correct write
declare
  cursor c1(tc varchar2) is select col_0 from osm_dml_3sp.osm_tab_func
    where col_3 like '%'||tc||'%';
  rfunt integer;
begin
  for tc in c1('6') loop
    rfunt := osm_dml_3sp.osm_tab_funcfunc1(52);
    update osm_dml_3sp.osm_tab_func set col_0=rfunt where col_0=tc.col_0;
  end loop;
end;
/

-- this is the error write
declare
  cursor c1(tc varchar2) is select col_0 from osm_dml_3sp.osm_tab_func
    where col_3 like '%'||tc||'%';
begin
  for tc in c1('6') loop
    update osm_dml_3sp.osm_tab_func set col_0=osm_dml_3sp.osm_tab_funcfunc1(52)
      where col_0=tc.col_0;
  end loop;
end;
/

ora-14552: cannot perform a ddl, commit or rollback inside a query or dml
ora-06512: at "osm_dml_3sp.osm_tab_funcfunc1", line 1
ora-06512: at line 1
阅读(3976) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图