embedded native SQL(EXEC SQL) method to connect HANA as secondary database

embedded native SQL(EXEC SQL) method to connect HANA as secondary database
Rate this post

Another Top-Down approach of HANA usage is EXEC SQL method which you write SQL commands between EXEC SQL/ENDEXEC lines. Difficult side of this approach is you will be dependent to static special SQL statements which does not follow ABAP syntax. For example in order to connect the HANA database ” connect to : ‘HDB’ ” statement is used. In DEMO_EXEC_SQL program you can find more samples including create/insert/read/delete statemens or check SAP Help for more details. Below i have shared a code to get a list of tables and view in your HANA db. Here i have used native SQL method to connect HANA and open/fetch/close database cursor SQL commands to extract data.

 

 

You may also like

  • ADBC usage with HANA as a secondary database (0)
    "ADBC is an API for the Native SQL interface of the AS ABAP that is based on ABAP Objects. The ADBC methods can be used to pass Native SQL statements to the database interface". It was a […]
  • number of distinct values for an SAP table (0)
    As you all know SAP provides a direct way to query database by ABAP programs. However sometimes we don't have a chance to transport ABAP programs easily.On the other hand we have to write […]
  • navigating to ABAP editor for related code line (0)
    Recently i have needed an ABAP program which reports ABAP programs with the related code line. My intention was catching Select sql statements without in connection keyword. By this means […]