This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 31st, when you will be able to use this site as normal.

    Forum Stats

  • 3,890,573 Users
  • 2,269,776 Discussions


SQLCL on windows. Error executing javascript

IOcampo Member Posts: 2
edited Apr 26, 2016 3:07PM in SQLcl

I'm using sqlcl trying to execute a javascript to upload files into blob field.

DB connexion it's ok bet when I ran the script I receive the following error:

SQL> script load_file_to_db.js

javax.script.ScriptException: ReferenceError: "load" is not defined. (<Unknown source>#1) in <Unknown source> at line number 1

My script:


/* File name */

var files= helpers.exec('find . -maxdepth 1 -type f ').stdout.split('\n');

/* bind for reuse */

var binds = helpers.getBindMap();

for(f in files ) {

    /* load the blob */

  blob = helpers.getBlobFromFile(files[f]);

  /* assign the binds */



/* Just do it */

  var ret = util.execute("insert into k(path,blob_content,when) values(:path , :b, sysdate)",binds);