Skip to main content

Questions tagged [oracle-sqlcl]

Oracle SQLcl is a command line interface for Oracle Database. It is a Java-based replacement for SQL*Plus, providing a more modern experience in addition to supporting most of the SQL*Plus features.

Filter by
Sorted by
Tagged with
0 votes
1 answer
41 views

Count number of digits in one field

I'm trying to come up with a code that would count the number of digits in one field. in this case it's passports I want to make sure they have valid digits and characters. select p.passport_nbr, ...
Mira's user avatar
  • 3
-1 votes
2 answers
106 views

not return count = 0 if value is null - oracle

I'm trying to write a oracle SQL query to return if the values are not present then return the count as zero. My query : select company, sum(case when company IN ('ABC','DEF','GHI','JKL','MNO') ...
Karthik Awesomes's user avatar
0 votes
1 answer
289 views

How to format the output of query in SQLcl to have no header?

I want to execute a query that will produce an output that are SQL commands too to be executed later. Something like: SELECT 'DROP ' || OBJECT_TYPE || ' "' || owner || '"."' || ...
Gustavo's user avatar
  • 163
0 votes
1 answer
677 views

SQLcl Oracle to export data to CSV without blank first line and without carriage return character at the end

For reasons, I am using the following here-doc approach to export data to CSV. $ /oracle/sqlcl/bin/sql -s username/password@//host.mybiz.com.my:1521/dwh > arca.csv <<EOF SET SQLFORMAT CSV SET ...
idazuwaika's user avatar
1 vote
0 answers
192 views

oracle sqlcl and sqlplus - seperate login.sql on linux

I feel I'm probably missing something obvious here, but I can't see an easy way to have a separate login.sql for sqlplus and sqlcl This is problematic for me as the errors thrown up by sqlplus for the ...
Dave Smylie's user avatar
1 vote
0 answers
427 views

Liquibase on Oracle SQLcl - table and index drops not being propagated

I've been using Oracle's SQLcl, specifically the lb command to use Liquibase, for the last day or so to use for versioning my development, staging and production databases, which are using Oracle's ...
Ash Oldershaw's user avatar
1 vote
1 answer
612 views

SQLcl: set color in sqlprompt (ANSI/VT100 Control sequences)

This is my login.sql SET sqlprompt "_user'@'_connect_identifier > " SET sqlformat ansiconsole SET serveroutput on SET lines 3000 How to set the sqlprompt to color red for Prod (and green color ...
Sybil's user avatar
  • 2,518
3 votes
1 answer
266 views

SQLcl history (up-arrow) rewrites my queries

Version sql -version SQLcl: Release 18.4.0.0 Production I type this: SQL> exec dbaspace.long_ops; SID % Done Start Time Rem [s] Elapsed Message ==== ======= =================== =====...
Sybil's user avatar
  • 2,518
0 votes
1 answer
879 views

use SQLcl with EZconnect and multiple hostnames (ADDRESS_LIST=)

this is our classic tnsnames.ora test1= (DESCRIPTION= (CONNECT_TIMEOUT=4) (TRANSPORT_CONNECT_TIMEOUT=3) (ENABLE=BROKEN) (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=example1....
Sybil's user avatar
  • 2,518
2 votes
0 answers
3k views

Removing REM INSERTING and SET DEFINE OFF from SQLcl Output

I ran below script to get data from Oracle, and then load to Postgres with psql. SET SQLFORMAT INSERT SET FEEDBACK OFF SET TERMOUT OFF SPOOL asset_file.sql SELECT * FROM FINANCE.ASSET; SPOOL OFF ...
idazuwaika's user avatar