Re: SV: sqlcl and sqlplus (Jeff Smith)

  • From: Mladen Gogala <gogala.mladen@xxxxxxxxx>
  • To: Niels Jespersen <NJN@xxxxxx>, "jeff.d.smith@xxxxxxxxxx" <jeff.d.smith@xxxxxxxxxx>, "xt.and.r@xxxxxxxxx" <xt.and.r@xxxxxxxxx>
  • Date: Tue, 18 Jun 2019 07:34:45 -0400

Yes, Code is better than Geany, Spyder or any number of IDE products. It looks like someone has remembered that Microsoft started as SCO Xenix reseller. They have even briefly poached Wim Coekarts from Oracle, but Oracle got him back:

http://www.internetnews.com/blog/skerner/wim-coekaerts-returns-to-oracle-after-brief-microsoft-stint.html

I will never forget the panic which took place when Tom Kyte announced on one April's fools day that he's quitting Oracle and going to Microsoft.

On 6/18/19 1:46 AM, Niels Jespersen wrote:


Oracle extension for MS VS Code ? When is that due? I spend my entire life in VS Code these days.

*Fra:* oracle-l-bounce@xxxxxxxxxxxxx <oracle-l-bounce@xxxxxxxxxxxxx> *På vegne af *Jeff Smith
*Sendt:* 17. juni 2019 14:49
*Til:* xt.and.r@xxxxxxxxx; Mladen Gogala <gogala.mladen@xxxxxxxxx>
*Cc:* Andy Klock <andy@xxxxxxxxxxxxxxx>; oracle-l <oracle-l@xxxxxxxxxxxxx>
*Emne:* RE: sqlcl and sqlplus (Jeff Smith)

Neat, thanks for sharing Sayan!

>>. Since those tools are diverging more and more

They were never…together?

Our product roadmap for SQLcl is generally…

/Give our Oracle Database users a modern command line interface./

Folks have spent years building out their login scripts, so we support those.

Going forward, we’re looking at adding a full vi editor interface.

In a related, but different space, we’re also working on an Oracle extension for MS VS Code. So the things you like in SQLcl, you’d see there, plus more.

Jeff

*From:*Sayan Malakshinov <xt.and.r@xxxxxxxxx <mailto:xt.and.r@xxxxxxxxx>>
*Sent:* Saturday, June 15, 2019 5:56 PM
*To:* Mladen Gogala <gogala.mladen@xxxxxxxxx <mailto:gogala.mladen@xxxxxxxxx>>
*Cc:* Andy Klock <andy@xxxxxxxxxxxxxxx <mailto:andy@xxxxxxxxxxxxxxx>>; oracle-l <oracle-l@xxxxxxxxxxxxx <mailto:oracle-l@xxxxxxxxxxxxx>>
*Subject:* Re: sqlcl and sqlplus (Jeff Smith)

There are 3 standard ways to do that:

1. Ignore such unsupported errors using "set termout off":

set termout off;
set history 200;
set sqlformat ansiconsole;
set termout on;

2. create different aliases for sqlplus and sqlcl where you can change SQLPATH and start required program. For example, I use "splus" for sqlplus and it changes path and starts sqlplus within rlwrap, and "sqlcl" for "sql"

3. You can create conditional glogin:

*glogin.sql:*

set ver off feed off;
col conditional_glogin new_val conditional_glogin noprint
col _PWD new_val _PWD noprint;
select '' as "_PWD" from dual where 1=0;
select nvl2('&_PWD','sqlcl','sqlplus') conditional_glogin from dual;
@@&conditional_glogin
set ver on feed on;

*sqlcl.sql:*

prompt SQLCL!

*sqlplus.sql*:
prompt SQLPLUS!

Full example: https://gist.github.com/xtender/8b7897c02839a74bf78db00613754068 <https://urldefense.proofpoint.com/v2/url?u=https-3A__gist.github.com_xtender_8b7897c02839a74bf78db00613754068&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=N2hWu5HFsaIjmMkjQbnlokJ7uinNZMgPVk8rqPT9esM&m=4YXhpRCSotaiQSfGM-Y97z6-6VlFmg0cdXyj-nYWWs0&s=DPdGoZ4eyCaUE7L0FqvgJ267BLIkIqC8fydTNodwJc0&e=>

[oracle@ORA193 admin]$ cat glogin.sql
set ver off feed off;
col conditional_glogin new_val conditional_glogin noprint
col _PWD new_val _PWD noprint;
select '' as "_PWD" from dual where 1=0;
select nvl2('&_PWD','sqlcl','sqlplus') conditional_glogin from dual;
@@&conditional_glogin
set ver on feed on;
[oracle@ORA193 admin]$ cat sqlcl.sql
prompt SQLCL!
[oracle@ORA193 admin]$ cat sqlplus.sql
prompt SQLPLUS!
[oracle@ORA193 admin]$ *sqlplus / as sysdba*

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Jun 15 21:44:13 2019
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0


*SQLPLUS!*
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@ORA193 admin]$ *sql / as sysdba*

SQLcl: Release 19.1 Production on Sat Jun 15 21:44:20 2019

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0


*SQLCL!*

SQL> exit

Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

On Sun, Jun 16, 2019 at 12:31 AM Mladen Gogala <gogala.mladen@xxxxxxxxx <mailto:gogala.mladen@xxxxxxxxx>> wrote:

    First, the product are diverging so the files should be different.
    Second, both products are following SQLPATH so if the files are the
    same, one of the products will throw an error.

    Regards

    On 6/15/19 5:15 PM, Andy Klock wrote:
    >
    > Rather than changing the products couldn't you just set SQLPATH
    to a
    > directory containing your glogin.sql ?
    >
    > Andy K

-- Mladen Gogala
    Database Consultant
    Tel: (347) 321-1217

    --
    //www.freelists.org/webpage/oracle-l
    
<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.freelists.org_webpage_oracle-2Dl&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=N2hWu5HFsaIjmMkjQbnlokJ7uinNZMgPVk8rqPT9esM&m=4YXhpRCSotaiQSfGM-Y97z6-6VlFmg0cdXyj-nYWWs0&s=w9oyeXk9BsyMSdsSjOML5PRUFJCfnggAXnm3hQyPwDE&e=>


--

Best regards,
Sayan Malakshinov

Oracle performance tuning engineer

Oracle ACE Associate
http://orasql.org <https://urldefense.proofpoint.com/v2/url?u=http-3A__orasql.org&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=N2hWu5HFsaIjmMkjQbnlokJ7uinNZMgPVk8rqPT9esM&m=4YXhpRCSotaiQSfGM-Y97z6-6VlFmg0cdXyj-nYWWs0&s=6-fxnoCQA6rrslcA8xrLVNWrE1caSs7zRDCcWskFu0A&e=>

--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217

Other related posts: