title: Oracle PL/SQL, Database Link, and Heterogeneous Services Fails: ORA-02070: database MSAccessODBC64bit does not support TO_NUMBER in this context
body: <p>I am using Oracle's Heterogeneous Services (HS).  I have a database link to a Microsoft Access table called <code>employee</code>.  From an Oracle connection using SQL*Plus, I can describe the table's columns and datatypes (<code>desc employee</code>).  I can also select from the remote table and receive the records.</p>
  
  <p>However, when using an anonymous block, I receive the Oracle error:</p>
  
  <pre><code>ORA-02070: database MSAccessODBC64 does not support TO_NUMBER in this context
  </code></pre>
  
  <p><code>MSAccessODBC64</code> is my configured ODBC DSN in Windows 7.</p>
  
  <h1>The code:</h1>
  
  <pre><code>declare
     my_record_position number := 60109;
     my_record employee@MSAccessODBC64bit%rowtype;
  begin
     select
        *
     into
        my_record
     from
        eemployee@MSAccessODBC64bit ----&gt;&gt; When I remove the database link, it works
     where
        staff_number = my_record_position ----&gt;&gt; when I remove the where clause, it works
     order by
        staff_number asc;
     dbms_output.put_line(my_record.staff_number);
  end;
  /
  </code></pre>
  
  <h2>The error:</h2>
  
  <pre><code>   declare
        *
     ERROR at line 1:
     ORA-02070: database MSAccessODBC64 does not support TO_NUMBER in this context
     ORA-06512: at line 5
  </code></pre>
  
  <p>Is there some sort of issue or option required to make HS work?  What am I overlooking?</p>
  
  <p>When I use a substitution variable, it works and displays the <code>employee</code> <code>id</code>.</p>
  
  <pre><code>define emp = 60109;
  declare
     my_record_position number := 60109;
     my_record employee@MSAccessODBC64bit%rowtype;
  begin
     select
        *
     into
        my_record
     from
        employee@MSAccessODBC64bit
     where
        staff_number = &amp;emp
     order by
        staff_number asc;
     dbms_output.put_line('emp=' || my_record.staff_number);
  end;
  /
  emp=60109
  
  PL/SQL procedure successfully completed.
  
  ===========initMSAccessODBC64bit.ora for ODBC==============
  
  # This is a sample agent init file that contains the HS parameters that are
  # needed for the Database Gateway for ODBC
  
  #
  # HS init parameters
  #
  HS_DESCRIBE_CACHE_HWM   = 4000
  HS_FDS_CONNECT_INFO     = MSAccessODBC64bit
  HS_FDS_TRACE_LEVEL      = DEBUG
  HS_OPEN_CURSORS         = 50
  HS_RPC_FETCH_REBLOCKING = ON
  HS_RPC_FETCH_SIZE       = 10000
  HS_FDS_FETCH_ROWS       = 100
  HS_TRANSACTION_MODEL    = READ_ONLY
  
  #This was supposed to fix ORA-02070: database MSAccessODBC64bit does not
  #support TO_number in this context
  #This didn't work
  #EnableWCharSupport      = 0 
  </code></pre>