title: how to pass variable from shell script to sqlplus
body: <p>I have a shell script that calls file.sql</p>
  
  <p>I am looking for a way to pass some parameters to my file.sql.</p>
  
  <p>If I don't pass a variable with some value to the sql script, I will have to create multiple .sql files with SELECT statement and all that would change is few words.</p>
  
  <p>My shell script calls file.sql:</p>
  
  <pre><code>sqlplus -S user/pass@localhost
  echo " Processing triples"
  ./load_triples.sh BUILDING/Mapping_File BUILDING Y &gt;&gt; load_semantic.log
  
  @/opt/D2RQ/file.sql
  exit;
  EOF
  </code></pre>
  
  <p>And this is how my file.sql looks like:</p>
  
  <pre><code>SET ECHO ON;
  SPOOL count.log
  
  SELECT COUNT(*) as total_count
  FROM TABLE(SEM_MATCH(
  '{
          ?s rdf:type :ProcessSpec .
          ?s ?p ?o
  }',SEM_Models('BUILDING'),NULL,
  SEM_ALIASES(SEM_ALIAS('','http://VISION/DataSource/SEMANTIC_CACHE#')),NULL));
  
  SPOOL OFF;
  </code></pre>
  
  <p>Can I modify my shell script so that it passes variable names?</p>
  
  <p>I.e.: model = "BUILDING"
  and pass this on to file.sql?</p>
  
  <p>Is there anything like that?</p>