How can I get access to _CONNECT_IDENTIFIER from within SQLcl JavaScript
0
votes
1
answer
35
views
I have would like to customize my SQLcl prompt and I call a javascript file from my login.sql
I tried this but without success. Variable dbIdentifier contains the string '&_CONNECT_IDENTIFIER'
var dbIdentifier = util.executeReturnOneCol("select '&_CONNECT_IDENTIFIER'");
This one works after login:
SQL> select '&_CONNECT_IDENTIFIER';
old:select '&_CONNECT_IDENTIFIER'
new:select 'jdbc:oracle:thin:@DEMODB_HIGH'
'JDBC:ORACLE:THIN:@DEMODB_HIGH'
__________________________________
jdbc:oracle:thin:@DEMODB_HIGH
Is there a way to assign the value of CONNECT_IDENTIFIER into a SQLcl JavaScript variable?
I would like my prompt to include the string '*DEMODB_HIGH*'.
sqlcl.setStmt('set sqlprompt "🙊 @|yellow _USER|@@@|green ' + someStringManipulation(dbIdentifier) + '|@@|yellow >|@ "');
Thank you
Asked by Bjarte Brandt
(702 rep)
May 26, 2025, 10:52 AM
Last activity: Jun 7, 2025, 10:58 AM
Last activity: Jun 7, 2025, 10:58 AM