Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8457735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:53:11+00:00 2026-06-10T12:53:11+00:00

I have a problem executing all SQL files in a folder with sqlplus command

  • 0

I have a problem executing all SQL files in a folder with sqlplus command

I can run one file or first file with this code

<apply executable="sqlplus" dir="." parallel="false">
    <!-- <arg value="-S" /> -->
    <arg line="${db.user}/${db.pwd}@'${db.sid}'" />
    <arg value="@${db.run.build.script}" />  this is working, which is for executing one file
    <!-- <arg value="--e source" /> -->
    <srcfile/>
    <fileset dir="..\..\Documents\test\Database\SQL\common\test"
        casesensitive="no" description="take all sql files">
        <patternset>
            <include name="**/*.sql" />
        </patternset> 
     </fileset> 
</apply>

; but cannot proceed further with other files

I have tried various options with apply task; but still not succeed; I thought the second file hasn’t “@” in the beginning that causes the problem.

any help will be highly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:53:12+00:00Added an answer on June 10, 2026 at 12:53 pm

    OK, first of all: I’ve never used sqlplus 🙂

    But based on the post I’ve seen here: http://www.zorbathegeek.com/161/run-multiple-sqlplus-queries-via-dos-batch-file.html I understood that it’s a must to provide @ as a prefix to path to all the files that should be considered.

    I see there multiple options, based on restrictions:

    • First check if you can provide in command line multiple of your files like this:

    sqlplus [login details] @C:/<your_path>/<file1>.sql @C:/<your_path>/<file1>.sql

    • depending if it’s possible or not, you should later decide if you need to create 1 file containing all the filenames prefixed with @ (as the example provided in the reffered site) or not

    Now how to do the prepending? I think it should be simple, just try to use Ant’s parhconvert described: http://ant.apache.org/manual/Tasks/pathconvert.html

    <fileset dir="..\..\Documents\test\Database\SQL\common\test" id="sql.files">
          <include name="**/*.sql"/>
        </fileset>
    
    <pathconvert pathsep=" " property="prefixed.sql.files" refid="sql.files">
          <map from="c:/" to="@c:/"/>
        </pathconvert>
    

    (where you should replace c:/ with the string that your file paths start with. Moreover, if you will dump to file, pathsep=" " should be probably replaced with pathsep="\n" as there might be a need to have one file per line, but this needs test)

    then depending on the options of all in one file or all files on cmd line, you:

    • either need to dump it to tmp file and run using this tmp file name
      http://ant.apache.org/manual/Tasks/echo.html
      In this case, the file should be later deleted

    • use property prefixed.sql.files directly in your apply arg value like:
      <arg value="${prefixed.sql.files}" />

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Problem executing bash file I have created a bash file script and
I have a problem creating and executing a JAR file. I have already made
I have a problem executing a process from our testing server. On my localhost
I have a problem with executing large number of queries. I need to execute
I have a problem while executing a SSIS script component. To be honest I
I have a problem with the following code, when executing the call to cublasSrotg
I have some timeout problems when executing a SELECT query. It is SQL Server
I have problem with my query on C, I’m using the oci8 driver. This
I have several *.sql files with script to create table and sprocs for a
I have used Inserts, selects, updates, deleted without problem all over the program but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.