在Oracle中的一个ExecuteScalar中运行多个命令

编程入门 行业动态 更新时间:2024-10-28 13:25:22
本文介绍了在Oracle中的一个ExecuteScalar中运行多个命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一批sql语句,例如...

I have a batch of sql statements such as ...

插入.... 插入.... ; 删除.........;

insert into.... ; insert into.... ; delete .........;

当我尝试针对oracle执行它们时,它给了我此错误(ORA- 00911无效字符)

When i try to execute them against oracle it gives me this error (ORA-00911 Invalid Character)

现在我可以理解,这是由于语句之间的分号所致,我在SQL Server上尝试了此操作,但仍有效,但到目前为止在Oracle中还算不上运气.

now i can understand that this is because of the semicolon between the statements, i tried this on SQL Server and it worked but in Oracle no luck so far.

是否有一种方法可以通过使用ExecuteScalar或其他函数针对oracle运行多个语句?

Is there a way to run multiple statements against oracle by using the ExecuteScalar or some other function?

重复:如何使用.NET执行多个Oracle SQL语句

推荐答案

尝试使用BEGIN..END

BEGIN insert into.... ; insert into.... ; delete .........; END;

更多推荐

在Oracle中的一个ExecuteScalar中运行多个命令

本文发布于:2023-08-05 11:26:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1305222.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   命令   Oracle   ExecuteScalar

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!