RE: sql developer vs sqlplus sql and plsql syntax

From: Jeff Smith <jeff.d.smith_at_oracle.com>
Date: Mon, 14 Dec 2020 05:35:48 -0800 (PST)
Message-ID: <c1b95013-3ae1-4dc5-aa97-bd96b9a27e36_at_default>


What William said.

Our previous plsql expert NEVER used statement terminators, which I found to be extreme, but it is also valid.

When you're constructing SQL in your php or js or whatever code, you don't include a ';' there either.

I advise always explicitly run your code, never rely on your tool to 'guess' what you want to run.

Jeff

-----Original Message-----

From: William Robertson <william_at_williamrobertson.net> Sent: Sunday, December 13, 2020 6:25 PM
To: oracle-l <oracle-l_at_freelists.org> Subject: Re: sql developer vs sqlplus sql and plsql syntax

Because it's valid syntax in those languages. Requiring everyone to include the same terminating symbols as the SQL*Plus default settings might be convenient for your forgetful developers at deployment time, but it would be a redundant annoyance for everyone else.

Oracle SQL has no semicolon character. Even SQL*Plus doesn't require it, it's just the default. PL/SQL doesn't have a block terminator character.

Desktop tools can optionally add slash characters in their Save As features. I don't know about SQL Developer but PL/SQL has this as a preference setting for Program Windows.

On 13 Dec 2020, at 18:19, Ls Cheng <exriscer_at_gmail.com> wrote:

Hi

This is for Jeff Smith! :-)

I would like to know why SQL Developer allow people to execute SQL code without semicolon and PLSQL code with backslash? (OK TOAD does the same thing but it is not made by Oracle)

For example code such as this works in SQL developer

  • semicolon missing select * from dba_users
  • backslash missing declare l_a number; begin select 1 into l_a from dual; end;
  • backslash missing create or replace procedure p_test is l_a number; begin select 1 into l_a from dual; end;

This is causing some serious conflicts between DBA team and the developers because the developers write codes in SQL developer then they upload them as script for the DBA to run in the test/prod environment which all fails (and plsql objects not created) obecause DBA's uses SQLPLUS and because most SQL execution request are batched with SQLPLUS.

The developers claim if the code runs in SQL developer it must run in SQLPLUS because it is a tool from Oracle. Is there a way to configure SQL Developer so it can have the same behaviour as SQLPLUS?

Thanks

--

https://urldefense.com/v3/__http://www.freelists.org/webpage/oracle-l__;!!GqivPVa7Brio!MhpqayAQvPBo_M2W4-LEheUHs9s-jzDeEar5WKHPSQ_TQ2lzwzRTI5s8NNZiGyYeCNQ$

--

http://www.freelists.org/webpage/oracle-l Received on Mon Dec 14 2020 - 14:35:48 CET

Original text of this message