Passing parameters in js batch
Hi!
I'm testing MySQL Shell (ver. 8.0.30) using a JavaScript batch file which begin with:
#!/usr/bin/mysqlsh --file
After a shell.connect(), I'm running this test SQL:
session.runSql("SHOW Tables FROM DB");
It is working but the DB name is hardcoded in the script. I would like to pass the database name on the command line as a parameter, i.e. "./testBatch.js DBNAME". That way, I could use the same batch script with different databases. I can't seem to find the way to pass and use the parameter in the js script.
Any help would be greatly appreciated.
Thank you!
Claude
Subject
Views
Written By
Posted
Passing parameters in js batch
489
August 06, 2022 10:24AM
257
August 07, 2022 12:54PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.