0

I am trying to run many SQL scripts that are contained within a few directories for an Oracle database. My approach was to use an Oracle SQL*Plus file that could simply run each file (or directory if possible) at once. However, when I run the SQLPlus file using the default intellij run configuration, I notice that it doesn't properly call any of my scripts and then, proceeds to change the SQL Dialect of the file to just Oracle.

Is this approach even possible? I have tried changing the dialects of all the scripts to be PLUS but, with no success. I've used all the methods I have seen: @, @@, SQL > and :r to call my scripts but, everything seems to fail and then, change the dialect of the SQLPlus file. However, running the sql statements themselves inside the SQLPlus file works fine, and does not change the dialect.

7
  • I should note that when you run an .sql file in intellij it automatically opens a popup where you are required to specify your execution target (database). Commented Dec 26, 2019 at 18:51
  • I'm not sure thats even a thing. To call a script with SQLPlus: sqlplus <user>/<password>@<instance> @<sqlfilename>. Commented Dec 26, 2019 at 18:51
  • @alexherm Ive never used sqlplus before and definetely not with intellij before but, it seemed to look like a possibility for running all of my sql scripts at once. I also tried to look at simply creating an specific run configuration within my ide but, apparantly that is not supported either for .sql files... Commented Dec 26, 2019 at 19:02
  • 1
    For that I would create a shell script that calls each of the SQL programs, and just run the shell script. Check this thread for more info - stackoverflow.com/questions/10277983/… Commented Dec 26, 2019 at 19:10
  • Thanks I'll take a look. I'd prefer not to store database credentials in some script file also but, I'm not sure if thats possible unless I could get intellij to handle that for me. Commented Dec 26, 2019 at 19:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.