Question: 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.

Answer: 
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).
You can use the [PRODUCT\_USER\_PROFILE](http://docs.oracle.com/cd/B13789_01/server.101/b12170/ch10.htm) to disable the `ACCEPT` command for the user which is running the script