MySQL Forums
Forum List  »  MySQL Shell

Passing parameters in js batch
Posted by: Claude J. Morin
Date: August 06, 2022 10:24AM

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

Options: ReplyQuote


Subject
Views
Written By
Posted
Passing parameters in js batch
105
August 06, 2022 10:24AM


Sorry, only registered users may post in this forum.

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.