Skip to Main Content

SQLcl

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Please ask technical questions in the appropriate category. Thank you!

Javascript multiline strings

David H.Apr 10 2024

Any clues on how to use Javascript multiline text variables in SQLcl? Here I'm trying to use back-ticks to preserve formatting. This works in browser, and I understand that it should be compatible.

My test script x.js contains a really basic demonstration of what's happening. Any help is appreciated!

--DH

SQLcl: Release 21.4 Production on Wed Apr 10 13:10:03 2024

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

Connected to:
Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.22.0.0.0

SQL> host cat x.js
var test = `Hello
World`;

ctx.write(test);



SQL> script  x.js
"Error at line : 1 Column : 11
 Expected an operand but found error
var test = `Hello
           ^ in <eval> at line number 1 at column number 11
"SQL>

Comments
Post Details
Added on Apr 10 2024
2 comments
51 views