SV: sqlcl and sqlplus (Jeff Smith)

From: Niels Jespersen <NJN_at_dst.dk>
Date: Tue, 18 Jun 2019 05:46:23 +0000
Message-ID: <3967181ED595B445B1E39718204FD4BD0122B92C7B_at_SRVEXC5.dst.local>



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

Fra: oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org> På vegne af Jeff Smith Sendt: 17. juni 2019 14:49
Til: xt.and.r_at_gmail.com; Mladen Gogala <gogala.mladen_at_gmail.com> Cc: Andy Klock <andy_at_oracledepot.com>; oracle-l <oracle-l_at_freelists.org> 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_at_gmail.com<mailto:xt.and.r_at_gmail.com>> Sent: Saturday, June 15, 2019 5:56 PM
To: Mladen Gogala <gogala.mladen_at_gmail.com<mailto:gogala.mladen_at_gmail.com>> Cc: Andy Klock <andy_at_oracledepot.com<mailto:andy_at_oracledepot.com>>; oracle-l <oracle-l_at_freelists.org<mailto:oracle-l_at_freelists.org>> 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; _at__at_&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_at_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; _at__at_&conditional_glogin
set ver on feed on;
[oracle_at_ORA193 admin]$ cat sqlcl.sql prompt SQLCL!
[oracle_at_ORA193 admin]$ cat sqlplus.sql prompt SQLPLUS!
[oracle_at_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_at_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_at_gmail.com<mailto:gogala.mladen_at_gmail.com>> 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

--
http://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=>

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jun 18 2019 - 07:46:23 CEST

Original text of this message