<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Native SQL &amp;quot;Table does not exist in database&amp;quot; in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-quot-table-does-not-exist-in-database-quot/m-p/2900478#M682047</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Developers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm doing a database connection to an Oracle db and trying to read data using native SQL - I keep getting the runtime error "table does not exist in database" on the statement Fetch Next Cursor. The following is the code snippet (I've commented out the Exec SQL and Fetch Next to make sure I have a connection and I do). HR is a schema in the database and T_Donation is a table in HR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: w1(3),&lt;/P&gt;&lt;P&gt;         c1 type cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if con_name is initial.&lt;/P&gt;&lt;P&gt;    write: 'No connection specified'.                       "#EC NOTEXT&lt;/P&gt;&lt;P&gt;    return.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;try to open the connection and catch the errors (if any)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  try.&lt;/P&gt;&lt;P&gt;      con_ref = cl_sql_connection=&amp;gt;get_connection( con_name ).&lt;/P&gt;&lt;P&gt;    catch cx_sql_exception into sqlerr_ref.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    error occured&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      write:&lt;/P&gt;&lt;P&gt;        'Could not open connection', con_name, '.'.         "#EC NOTEXT&lt;/P&gt;&lt;P&gt;      if sqlerr_ref-&amp;gt;unknown_connection = 'X'.&lt;/P&gt;&lt;P&gt;        write:&lt;/P&gt;&lt;P&gt;          / con_name, 'is not defined in DBCON'.            "#EC NOTEXT&lt;/P&gt;&lt;P&gt;      elseif sqlerr_ref-&amp;gt;db_error = 'X'.&lt;/P&gt;&lt;P&gt;        write:&lt;/P&gt;&lt;P&gt;          / 'sql error', sqlerr_ref-&amp;gt;sql_code, 'occured:',&lt;/P&gt;&lt;P&gt;          / sqlerr_ref-&amp;gt;sql_message.                        "#EC NOTEXT&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;        perform get_trace_file using dev_file.&lt;/P&gt;&lt;P&gt;        write:&lt;/P&gt;&lt;P&gt;          / 'DBI error', sqlerr_ref-&amp;gt;internal_error, 'occured.',&lt;/P&gt;&lt;P&gt;          / 'See trace file for further info:',&lt;/P&gt;&lt;P&gt;            icon_read_file as icon hotspot, dev_file.       "#EC NOTEXT&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;connection successfully opened&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  write:&lt;/P&gt;&lt;P&gt;    / 'Connection', con_name, 'successfully opened.'.       "#EC NOTEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Get the data from MS-SQL Server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  EXEC SQL.&lt;/P&gt;&lt;P&gt;    open C1 for&lt;/P&gt;&lt;P&gt;    SELECT HR.T_DONATION.DN_DONATIONYEAR&lt;/P&gt;&lt;P&gt;    FROM HR.T_DONATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  do.&lt;/P&gt;&lt;P&gt;    EXEC SQL.&lt;/P&gt;&lt;P&gt;      FETCH NEXT C1 into :w1&lt;/P&gt;&lt;P&gt;    ENDEXEC.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      perform loop_output.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;  EXEC SQL.&lt;/P&gt;&lt;P&gt;    CLOSE C1&lt;/P&gt;&lt;P&gt;  ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;close connection again&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  con_ref-&amp;gt;close( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  write:&lt;/P&gt;&lt;P&gt;    / 'Connection', con_name, 'closed'.                     "#EC NOTEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form LOOP_OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Output&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form loop_output .&lt;/P&gt;&lt;P&gt;  write: /5 w1.&lt;/P&gt;&lt;P&gt;endform. " LOOP_OUTPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        James Barnes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Oct 2007 13:42:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-15T13:42:12Z</dc:date>
    <item>
      <title>Native SQL "Table does not exist in database"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-quot-table-does-not-exist-in-database-quot/m-p/2900478#M682047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Developers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm doing a database connection to an Oracle db and trying to read data using native SQL - I keep getting the runtime error "table does not exist in database" on the statement Fetch Next Cursor. The following is the code snippet (I've commented out the Exec SQL and Fetch Next to make sure I have a connection and I do). HR is a schema in the database and T_Donation is a table in HR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: w1(3),&lt;/P&gt;&lt;P&gt;         c1 type cursor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if con_name is initial.&lt;/P&gt;&lt;P&gt;    write: 'No connection specified'.                       "#EC NOTEXT&lt;/P&gt;&lt;P&gt;    return.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;try to open the connection and catch the errors (if any)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  try.&lt;/P&gt;&lt;P&gt;      con_ref = cl_sql_connection=&amp;gt;get_connection( con_name ).&lt;/P&gt;&lt;P&gt;    catch cx_sql_exception into sqlerr_ref.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    error occured&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      write:&lt;/P&gt;&lt;P&gt;        'Could not open connection', con_name, '.'.         "#EC NOTEXT&lt;/P&gt;&lt;P&gt;      if sqlerr_ref-&amp;gt;unknown_connection = 'X'.&lt;/P&gt;&lt;P&gt;        write:&lt;/P&gt;&lt;P&gt;          / con_name, 'is not defined in DBCON'.            "#EC NOTEXT&lt;/P&gt;&lt;P&gt;      elseif sqlerr_ref-&amp;gt;db_error = 'X'.&lt;/P&gt;&lt;P&gt;        write:&lt;/P&gt;&lt;P&gt;          / 'sql error', sqlerr_ref-&amp;gt;sql_code, 'occured:',&lt;/P&gt;&lt;P&gt;          / sqlerr_ref-&amp;gt;sql_message.                        "#EC NOTEXT&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;        perform get_trace_file using dev_file.&lt;/P&gt;&lt;P&gt;        write:&lt;/P&gt;&lt;P&gt;          / 'DBI error', sqlerr_ref-&amp;gt;internal_error, 'occured.',&lt;/P&gt;&lt;P&gt;          / 'See trace file for further info:',&lt;/P&gt;&lt;P&gt;            icon_read_file as icon hotspot, dev_file.       "#EC NOTEXT&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;connection successfully opened&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  write:&lt;/P&gt;&lt;P&gt;    / 'Connection', con_name, 'successfully opened.'.       "#EC NOTEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Get the data from MS-SQL Server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  EXEC SQL.&lt;/P&gt;&lt;P&gt;    open C1 for&lt;/P&gt;&lt;P&gt;    SELECT HR.T_DONATION.DN_DONATIONYEAR&lt;/P&gt;&lt;P&gt;    FROM HR.T_DONATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  do.&lt;/P&gt;&lt;P&gt;    EXEC SQL.&lt;/P&gt;&lt;P&gt;      FETCH NEXT C1 into :w1&lt;/P&gt;&lt;P&gt;    ENDEXEC.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      perform loop_output.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;  EXEC SQL.&lt;/P&gt;&lt;P&gt;    CLOSE C1&lt;/P&gt;&lt;P&gt;  ENDEXEC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;close connection again&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  con_ref-&amp;gt;close( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  write:&lt;/P&gt;&lt;P&gt;    / 'Connection', con_name, 'closed'.                     "#EC NOTEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form LOOP_OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Output&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form loop_output .&lt;/P&gt;&lt;P&gt;  write: /5 w1.&lt;/P&gt;&lt;P&gt;endform. " LOOP_OUTPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        James Barnes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 13:42:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-quot-table-does-not-exist-in-database-quot/m-p/2900478#M682047</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T13:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Native SQL "Table does not exist in database"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-quot-table-does-not-exist-in-database-quot/m-p/2900479#M682048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Found answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2007 17:35:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-quot-table-does-not-exist-in-database-quot/m-p/2900479#M682048</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-15T17:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Native SQL "Table does not exist in database"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-quot-table-does-not-exist-in-database-quot/m-p/2900480#M682049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know I'm a few years too late, but for future reference, feel free to share what the solution was.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Apr 2010 17:42:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-quot-table-does-not-exist-in-database-quot/m-p/2900480#M682049</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-13T17:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Native SQL "Table does not exist in database"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-quot-table-does-not-exist-in-database-quot/m-p/2900481#M682050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well my advice is to check the question in the &lt;A href="http://www.learn-with-video-tutorials.com/sql-video-tutorial"&gt;sql tutorial&lt;/A&gt;, it will be quicker then getting an answere. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 06:58:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/native-sql-quot-table-does-not-exist-in-database-quot/m-p/2900481#M682050</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-04-29T06:58:23Z</dc:date>
    </item>
  </channel>
</rss>

