title: I am getting error 3802 while running a SQL query in Teradata SQL
body: <p>I am running the following query.</p>
  
  <pre><code>create multiset volatile table table1 as (
  select
  a.variable1,
  a.variable2, 
  b.variable3, 
  b.variable4, 
  c.variable5, 
  c.variable6, 
  d.variable7,
  d.variable8
  
  from data1 as a
  left join data2 as b
  on a.ID1=b.ID1 and a.date1=b.date1
  left join data3 as c
  on a.ID1=c.ID1 and a.date1=c.date1
  left join data4 as d
  on a.ID1=d.ID1 and a.date1=d.date1
  where a.variable1&gt;100 and a.varaiable2 in ('A','B'))
  with data primary index (id1,id2,id3,date1) on commit preserve rows ;
  </code></pre>
  
  <p>I am getting the error- 
  PreparedStatementCallback; bad SQL grammar []; nested exception is java.sql.SQLException: [Teradata Database] [TeraJDBC 16.20.00.08] [Error 3802] [SQLState 42S02] Database 'd' does not exist."
  ]</p>
  
  <p>However, I am able to run the query select * from data4 which means that data4 does exist. </p>
  
  <p>It will be great if you guys can help me find out what's generating this error. </p>
  
  <p>Many Thanks in advance.</p>