为什么会出现错误:“遇到符号"/" &quot ;?

编程入门 行业动态 更新时间:2024-10-28 21:18:16
本文介绍了为什么会出现错误:“遇到符号"/" &quot ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在Mac的SQL Developer中编译一组存储过程.代码如下:

I'm compiling a collection of store procedures in SQL Developer for the Mac. The code looks like this:

// ... some other code .... END procedureX; END thePackageBodyName; / show error grant execute on thePackageBodyName to anotherName; / show error

SQLDev报告第一个斜杠遇到符号"/"的错误.如果我删除了第一个斜杠及其下的所有内容,它将成功编译:

SQLDev is reporting an error "Encountered the symbol "/" for the first slash. If I remove the first slash, and everything below it, it compiles successfully:

// ... some other code .... END procedureX; END thePackageBodyName;

为什么第一个斜杠会导致错误?

Why does the first slash cause an error?

推荐答案

/在SQL * Plus中使用.由于您未使用SQL * Plus进行编译,因此请将其删除,一切都将正常.

The / is used in SQL*Plus. Since you're not compiling in SQL*Plus, remove these, and all should be fine.

更具体地说:/结束一个PL/SQL块,该块可以是匿名的,也可以引用程序包/过程/函数/etc的定义/声明.斜线告诉SQL * Plus将到目前为止输入的内容传输到服务器并进行编译.因此,它不是PL/SQL语言的一部分,因此不需要.

More specifically: an / ends a PL/SQL block which can be anonymous or refer to a package/procedure/function/etc definition/declaration. The slash tells SQL*Plus to transmit what has been entered so far to the server and have it compiled. So, it's not part of the PL/SQL language and therefore not needed.

我假设您已将文件的内容导入或复制粘贴到SQL Developer中.因此,将其分解为斜线之间的可编译部分,然后对其进行编译.

I assume that you have imported or copy-pasted the content of a file into SQL Developer. So break it up into the compilable pieces between the slashes and compile these.

也许(这是因为我不了解SQL Developer),或者也有可能运行在SQL Developer中考虑到使用SQL * Plus创建的此类文件.

Maybe (and this because I don't know about SQL Developer) there is an option or a possibility to run such files that were created with SQL*Plus in mind in SQL Developer as well.

更多推荐

为什么会出现错误:“遇到符号"/" &quot ;?

本文发布于:2023-07-23 07:42:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1195234.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:出现错误   符号   amp   quot

发布评论

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

>www.elefans.com

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