cancel
Showing results for 
Search instead for 
Did you mean: 

connecting hana through sqlscript via abap

Former Member
0 Kudos

Hi,

I am trying to access HANA database table from ECC system using database connection but the database connection is throwing connection error -10709(connection failed no reachable host left). We have maintained database connection to access HANA. Please advise if you have experienced this problem.

Here is the snippet I am using to connect:

TRY.

con_ref = cl_sql_connection=>get_connection( con_name ).

stmt_ref = con_ref->create_statement( ).

con_ref->close( ).

CATCH cx_sql_exception INTO sqlerr_ref.

PERFORM handle_sql_exception USING sqlerr_ref.

ENDTRY.

Thanks,

Alok

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I ran into a similar problem but with this error message. The solution? The version of unix-ODBC I was using was too old. It appears the HANA driver needs at least 2.2.14.

-Kyle

Former Member
0 Kudos

Hi Alok,

I think the parameter that you used "con_name" is incorrect in the following line:

con_ref = cl_sql_connection=>get_connection( con_name ).

Assuming you're on ECC system, you may want to check the correct value the connection name under "CON_NAME" field with DBMS value = "HDB" in DBCON table (you can use T-Code: SE16 to view the content of DBCON table).

Regards,

Ferry

Former Member
0 Kudos

Thank you Ferry for the response. Here in snippet con_name is variable and I am passing right connection name taken from DBCON table.

Regards,

Alok