title: ORA-00928: missing SELECT keyword while executing the update query in shell script
body: <p>I am running a shellscript to update the database but getting the error <strong>"ORA-00928: missing SELECT keyword"</strong>. But it works fine when executing the select query. I'm not getting what's the issue?</p>
  
  <p><strong>Executing the script with select query:</strong></p>
  
  <pre><code>./dbScript.sh "select columnName from tableName where uniqueColumnName = 'XYZ'" &lt;setEnvFilePath&gt;
  </code></pre>
  
  <p><strong>Executing the script with update query:</strong></p>
  
  <pre><code>./dbScript.sh "UPDATE tableName SET columnName = columnName - interval '45' day WHERE uniqueColumnName = 'XYZ'" &lt;setEnvFilePath&gt;
  </code></pre>
  
  <p><strong>dbScript.sh</strong></p>
  
  <pre><code>#!/bin/bash
  
  function setEnvDetails()
  {
    if [[ $JAVA_HOME = "" || $WL_HOME = "" ]]; then
              echo "Please set environment variables JAVA_HOME and WL_HOME."
              echo "Exiting..." &amp;&amp; exit 1
      fi
      LOGIN_NM=${DB_USER_ROOT}/${DB_PASSWORD}@$DB
  }
  
  cd $2
  . ./setEnv.sh
  
  setEnvDetails
  
  query=$1
  
  #echo $query
  
  sqlplus -s $LOGIN_NM  &lt;&lt;!
  set echo off;
  set feedback off;
  
  set pagesize 0;
  set trimspool off;
  
  ($query);
  !
  </code></pre>
  
  <p><strong>setEnv.sh</strong></p>
  
  <pre><code>#!/bin/ksh
  
  #----------------------------------------------------------------------------
  # Set user-defined variables.
  # these values are taken from env_user.properties at installation time
  #----------------------------------------------------------------------------
  
  
  export JAVA_HOME=/nfs/tools/jdk/linux/jdk1.8.0_25-x64
  if [ "${MEM_ARGS}" = "" ] ; then
     export MEM_ARGS="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m - 
     XX:PermSize=512m -verbose:gc"
  fi
  
  export WL_HOME=/nfs/tools/bea/12.c/12.c/wlserver_12.1/
  
  export DB_USER_ROOT=abcd11111
  export DB_PASSWORD=abcd11111
  export DB=sidev11g
  export OM_DB_TYPE=ORACLE
  export ORACLE_HOME=/nfs/tools/oracle/linux_64/11.2.0
  export TNS_ADMIN=/nfs/tools/oracle/linux_64/11.2.0/network/admin
  export THIN_URL=punvm-oracle03.sigmasys.net:1522:si12c
  
  #export NLS_LANG=@nls.lang@
  
  PATH=$ORACLE_HOME/bin:$PATH
  
  export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
  </code></pre>