Skip to Main Content
  • Questions
  • how to install SQLCL on windows machine 86bit

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Enrique.

Asked: September 19, 2016 - 7:46 pm UTC

Last updated: November 01, 2021 - 4:07 am UTC

Version: oracle11g

Viewed 10K+ times! This question is

You Asked

hello Connor,

I wanted to know if can guide me in right direction where by i may be able to download and install(Step By Step) Sqlcl.
i heard about it thats its awesome tool and i really wanted to dig into it.

I am using windows machine 86bit and oracle databae 11g2.

and Connor said...

1) download
2) unzip
3) you are ready to go

It is that easy.


C:\oracle\product>cd sqlcl

C:\oracle\product\sqlcl>cd bin

C:\oracle\product\sqlcl\bin>dir
 Volume in drive C is TI10659400C
 Volume Serial Number is 48C3-B1BC

 Directory of C:\oracle\product\sqlcl\bin

17/09/2016  10:53 PM    <DIR>          .
17/09/2016  10:53 PM    <DIR>          ..
17/09/2016  10:53 PM            12,413 sql
17/09/2016  10:53 PM             2,585 sql.bat
17/09/2016  10:53 PM           398,866 sql.exe
               3 File(s)        413,864 bytes
               2 Dir(s)  41,891,893,248 bytes free

C:\oracle\product\sqlcl\bin>sql.bat

SQLcl: Release 4.2.0 Production on Wed Sep 21 01:18:40 2016

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

Username? (''?)


Rating

  (7 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Maybe a little more magic?

Duke Ganote, November 09, 2016 - 5:21 pm UTC

I've always found Java vexing:

C:\Users\DGANOTE\Downloads\sqldeveloper-4.1.5.21.78-x64\sqldeveloper\sqlcl\bin>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 22DF-493B

 Directory of ...

11/09/2016  11:58 AM    <DIR>          .
11/09/2016  11:58 AM    <DIR>          ..
11/09/2016  11:58 AM            12,413 sql
11/09/2016  11:58 AM             2,585 sql.bat
11/09/2016  11:58 AM           398,866 sql.exe
               3 File(s)        413,864 bytes
               2 Dir(s)  30,510,108,672 bytes free

C:\Users\DGANOTE\Downloads\sqldeveloper-4.1.5.21.78-x64\sqldeveloper\sqlcl\bin>sql.bat
'java' is not recognized as an internal or external command,
operable program or batch file.

Connor McDonald
November 11, 2016 - 5:15 am UTC

Perhaps in that case, download the version that *contains* the jre as well :-)

Neophyte on Java

Duke Ganote, November 11, 2016 - 3:28 pm UTC

Actually, I did download the version with JRE:

http://download.oracle.com/otn/java/sqldeveloper/sqldeveloper-4.1.5.21.78-x64.zip

I suspect that there's off with the PATH, for which I need administrative privileges to modify.

The SQL*Developer app fires right up.
Chris Saxon
November 11, 2016 - 4:05 pm UTC

Yep, Java needs to be in your path. And you need 1.8+.

seriously?

Andrew Wolfe, April 20, 2020 - 12:56 am UTC

The response barely mentions the vexations around Java on Windows, and "hey just unzip and run from \bin" is useless.

People need to use SQLCL to run database installation and operation scripts. Are they going to start SQLCL from its `bin` subdirectory and then give paths all over the computer to run the scripts?

And if they put SQLCL\bin into their PATH, will that work? Didn't for me.

Not anymore...

Scott Wesley, May 19, 2021 - 4:04 am UTC

As at SQLcl 21.1, there is no option to download with Java.
Updating path environment variable did not help me.

I needed to use the suggestion in the following thread to copy the /jdk folder from my SQL Developer folder to the same base as my SQLcl folder.


https://community.oracle.com/tech/developers/discussion/4139916/unable-to-launch-sqlcl-18-1

There may be a simpler way, but my Windows command prompt skills went stale circa DOS 6.x
Connor McDonald
May 24, 2021 - 5:19 am UTC

From the install notes for SQLcl

"SQLcl release 21.1 requires Java version 1.8 and above. Go here to download the latest version.

https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html

If SQLcl cannot find a local JRE, you will be prompted to enter the location path for the JRE. Note that the prompt wants only the folder, not the java.exe. For example C:\Program Files\Java\jre1.8.0_262"

Once you install Java, you should be good to go.,

SQLCL command.

Rajeshwaran Jeyabal, October 29, 2021 - 2:13 am UTC

Team,

was reading this new feature about LOAD from Jeffsmiths blog https://www.thatjeffsmith.com/archive/2021/10/using-sqlcl-to-load-csv-to-a-table-without-column-headers/

Played with this feature on my local 21c XE instance – here is what i get.
Can you help us to understand why we got only 13 rows loaded instead of 14 rows from the file ?
Kindly let me know if this has to go as a new question.

demo@XEPDB1> $ type c:\users\admin\emp_csv_without_header.txt
7698,”BLAKE”,”MANAGER”,7839,01-MAY-1981,2850,,30
7566,”JONES”,”MANAGER”,7839,02-APR-1981,2975,,20
7788,”SCOTT”,”ANALYST”,7566,19-APR-1987,3000,,20
7902,”FORD”,”ANALYST”,7566,03-DEC-1981,3000,,20
7369,”SMITH”,”CLERK”,7902,17-DEC-1980,800,,20
7499,”ALLEN”,”SALESMAN”,7698,20-FEB-1981,1600,300,30
7521,”WARD”,”SALESMAN”,7698,22-FEB-1981,1250,500,30
7654,”MARTIN”,”SALESMAN”,7698,28-SEP-1981,1250,1400,30
7844,”TURNER”,”SALESMAN”,7698,08-SEP-1981,1500,0,30
7876,”ADAMS”,”CLERK”,7788,23-MAY-1987,1100,,20
7900,”JAMES”,”CLERK”,7698,03-DEC-1981,950,,30
7839,”KING”,”PRESIDENT”,,17-NOV-1981,5000,,10
7782,”CLARK”,”MANAGER”,7839,09-JUN-1981,2450,,10
7934,”MILLER”,”CLERK”,7782,23-JAN-1982,1300,,10

demo@XEPDB1> truncate table emp2;

Table EMP2 truncated.

demo@XEPDB1> load emp2 c:\users\admin\emp_csv_without_header.txt

Load data into table DEMO.EMP2

csv
column_names on
delimiter ,
enclosures “”
encoding UTF8
row_limit off
row_terminator default
skip_rows 0
skip_after_names

#ERROR Unable to scan data.
#ERROR Index -1 out of bounds for length 8
#INFO Number of rows processed: 13
#INFO Number of rows in error: 0
#INFO Last row processed in final committed batch: 13
SUCCESS: Processed without errors
demo@XEPDB1> select count(*) from emp2;

COUNT(*)
___________
13

demo@XEPDB1>

Connor McDonald
October 29, 2021 - 5:22 am UTC

SQL> load emp x:\tmp\emp.dat

Load data into table MCDONAC.EMP

csv
column_names off
delimiter ,
enclosures ""
encoding UTF8
row_limit off
row_terminator default
skip_rows 0
skip_after_names
batch_rows 50
batches_per_commit 10
clean_names transform
SQL> load emp x:\tmp\emp.dat

Load data into table MCDONAC.EMP

csv
column_names on
delimiter ,
enclosures ""
encoding UTF8
row_limit off
row_terminator default
skip_rows 0
skip_after_names
batch_rows 50
batches_per_commit 10
clean_names transform
column_size rounded
commit on
date_format
errors 50
map_column_names off
method insert
timestamp_format
timestamptz_format
locale English Australia
scan_rows 100
truncate off
unknown_columns_fail on

#ERROR Unable to scan data.
#ERROR -1
#INFO Number of rows processed: 13
#INFO Number of rows in error: 0
#INFO Last row processed in final committed batch: 13
SUCCESS: Processed without errors
SQL> delete emp;

13 rows deleted.

SQL> set loadformat column_names off       <<<===========
SQL> load emp x:\tmp\emp.dat

Load data into table MCDONAC.EMP

csv
column_names off
delimiter ,
enclosures ""
encoding UTF8
row_limit off
row_terminator default
skip_rows 0
skip_after_names
batch_rows 50
batches_per_commit 10
clean_names transform
column_size rounded
commit on
date_format
errors 50
map_column_names off
method insert
timestamp_format
timestamptz_format
locale English Australia
scan_rows 100
truncate off
unknown_columns_fail on

#ERROR Unable to scan data.
#ERROR -1
#INFO Number of rows processed: 14
#INFO Number of rows in error: 0
#INFO Last row processed in final committed batch: 14
SUCCESS: Processed without errors
SQL>


SQLCL command.

Rajeshwaran Jeyabal, October 29, 2021 - 6:14 am UTC

Thanks for the response, but by default we got "column_names off"
SQL> load emp x:\tmp\emp.dat

Load data into table MCDONAC.EMP

csv
column_names off
delimiter ,

if so can you please help us to understand, why we need to do explicitly like this?
SQL> set loadformat column_names off       <<<===========

Connor McDonald
November 01, 2021 - 4:07 am UTC

I don't know - you'd need to ask that on the sqlcl forum.

https://community.oracle.com/tech/developers/categories/sqlcl

I just know I had to run it explicitly to make it work

SQLCL command.

Rajeshwaran Jeyabal, November 01, 2021 - 11:08 am UTC

thanks, checked with sqlcl team, here is what i see.
SQLcl: Release 21.3 Production on Mon Nov 01 16:29:18 2021

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

idle> conn demo/demo@pdb1
Connected.
demo@XEPDB1> show loadformat

csv
column_names on
delimiter ,
enclosures ""
encoding UTF8
row_limit off
row_terminator default
skip_rows 0
skip_after_names

By default column_names are on. so considers the first rows in the datafile as column_names.
so when we load using defaults, it ignores the first rows and others get loaded.
demo@XEPDB1> truncate table emp2;

Table EMP2 truncated.

demo@XEPDB1> load emp2 c:\users\admin\emp_csv_without_header.txt

Load data into table DEMO.EMP2

csv
column_names on
delimiter ,
enclosures ""
encoding UTF8
row_limit off
row_terminator default
skip_rows 0
skip_after_names

#ERROR Unable to scan data.
#ERROR Index -1 out of bounds for length 8
#INFO Number of rows processed: 13
#INFO Number of rows in error: 0
#INFO Last row processed in final committed batch: 13
SUCCESS: Processed without errors

but when we say column_names off, we load all data from the datafile as such.
demo@XEPDB1> truncate table emp2;

Table EMP2 truncated.

demo@XEPDB1> set loadformat column_names off
demo@XEPDB1> load emp2 c:\users\admin\emp_csv_without_header.txt

Load data into table DEMO.EMP2

csv
column_names off
delimiter ,
enclosures ""
encoding UTF8
row_limit off
row_terminator default
skip_rows 0
skip_after_names

#ERROR Unable to scan data.
#ERROR Index -1 out of bounds for length 8
#INFO Number of rows processed: 14
#INFO Number of rows in error: 0
#INFO Last row processed in final committed batch: 14
SUCCESS: Processed without errors
demo@XEPDB1>