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

  • SEARCH
  • Home
  • 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 7971899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:43:58+00:00 2026-06-04T07:43:58+00:00

Problem We have a DBA provided wrapper script that is used to execute a

  • 0

Problem

We have a DBA provided wrapper script that is used to execute a number of underlying sql scripts which comprise a given software release.

The wrapper script outputs some debug information about what will be executed then asks the user if they wish to continue, using the following sqlplus command

ACCEPT DB_OK PROMPT "Do you wish to Continue Y/[N]? : " DEFAULT N

We’re trying to automate the database creation in our build using maven…the build hangs waiting for user input 🙁

<plugin>
 <groupId>org.codehaus.mojo</groupId>
 <artifactId>exec-maven-plugin</artifactId>
 <version>1.2.1</version>
 <executions>
  <execution>
   <phase>pre-integration-test</phase>
   <goals>
    <goal>exec</goal>
    </goals>
    <configuration>
     <executable>sqlplus</executable>
     <arguments>
      <argument>${db.user}/${db.password}@${db.service.name}</argument>
      <argument>@${project.build.directory}/test-resources/create-db.sql</argument>
      </arguments>
      <workingDirectory>${project.build.directory}/test-resources</workingDirectory>
     </configuration>                
    </execution>
   </executions>
  </plugin>

Attempted Solutions

I’ve attempted to wrap the ACCEPT call in a plsql IF/ELSE block but this leads to an error regarding ‘ACCEPT’ and incorrect syntax, I guess this is because I’m mixing plsql and sqlplus commands.

Question

So, does anyone know how I can disable the ACCEPT prompt in sqlplus akin to SET DEFINE OFF for traditional substitution variables?

I can make small modifications to the wrapper script but the DBA’s would probably complain if I were to do a bulk refactor.

Thanks.

  • 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-04T07:43:59+00:00Added an answer on June 4, 2026 at 7:43 am

    SQL*Plus uses positional notation to pass parameters. So this would pass 42 as the first (and only) parameter expected by some_script.sql

    $ sqlplus scott/tiger@orcl @@$HOME/scripts/some_script.sql 42 
    

    This would short-circuit any ACCEPT call.

    So, if I have correctly understood how your Maven plugin works, I think you can achieve the same thing like this:

     <executable>sqlplus</executable>
         <arguments>
              <argument>${db.user}/${db.password}@${db.service.name</argument>              
              <argument>@${project.build.directory}/test-resources/create-db.sql</argument>
              <argument>Y</argument>
        </arguments>    
    

    That is, pass Y as the next argument in the sqlplus command string (assuming DB_OK is the first expected parameter – you’ll know your scripts better than I).

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

Sidebar

Related Questions

Problem: Have made a small mail program which works perfectly on my developer pc
I've seen that a few instances of this problem have been raised already. However,
Problem : I have a hand held device that scans those graphic color barcodes
Problem I have a custom tab control using Chrome-shaped tabs that binds to a
I have a number of stored procs which I would like to all run
I'm an Oracle DBA that's been asked to do some work on SQL Server
I have an ad-hoc query that should be pretty zippy (I have a DBA
Problem: I have a WCF service setup to be an endpoint for a call
Problem -- I have something like the following entries, 1000 of them: args1=msg args2=flow
Problem: I have a symfony project with a database full of production data I

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.