Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "/" do in PL/SQL?

I reviewing some PL/SQL code and I came across the following in the scripts:

/
SHOW error

grant execute on someName1 to someName2;

/
SHOW error

Reviewing the documentation for PL/SQL I could not find an explanation what the /'s do.

Can anyone enlighten me?

  • Update: I opened the file that includes this script in SQL Developer for Mac. Compiling it gives the error "encountered the symbol '/'". Should these slashes be removed?
like image 345
TERACytE Avatar asked Jan 31 '11 23:01

TERACytE


People also ask

What does => mean in PLSQL?

That is the keyword/value notation for passing parameters to a PL/SQL procedure or function. The left side is the name of the parameter, the right is the value being passed. It's useful when you don't want to keep to a specific ordering of parameters, or for self-documenting code.

What does =: mean in Oracle?

:= is the assignment operator in PL/SQL (Oracle's procedural extension to SQL). You use this to assign values to variables. If you just use = then this is checking for equality rather than assigning a value.

What does in do in Oracle?

The Oracle IN condition is used to help reduce the need to use multiple OR conditions in a SELECT, INSERT, UPDATE, or DELETE statement.


2 Answers

"/" executes the sql command in the current buffer. It similar to GO of SQL Server

like image 51
Chandu Avatar answered Oct 01 '22 02:10

Chandu


The slash basically executes the latest command stored in the buffer.

It's kind of a clunky thing, but a lot of PL/SQL interpreters/engines like SQL Plus require you to enter a "/" after every complete statement to actually execute it and see the results.

http://download.oracle.com/docs/cd/B28359_01/server.111/b31189/ch12004.htm#SQPUG162

like image 25
Andy White Avatar answered Oct 01 '22 03:10

Andy White