7

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?
TERACytE
  • 7,553
  • 13
  • 75
  • 111
  • Just a note: `SHOW error` is also a SQL Plus command, not part of PL/SQL. As to whether the `/` should be removed, how are the scripts generally used, if working with a team, there needs to be some agreement about tools and how scripts will be constructed. – Shannon Severance Feb 01 '11 at 06:03

2 Answers2

7

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

Chandu
  • 81,493
  • 19
  • 133
  • 134
4

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

Andy White
  • 86,444
  • 48
  • 176
  • 211