on 12-22-2017 9:16 AM
Hello,
I'm currently facing a problem when connecting to HANA database via ODBC. It works properly when I omit Parameter "DATABASENAME". But when I try to Connect using this Parameter, I always receive a "General error; 2 General error: database '<dbname>' does not exist. I've alread read about a similar problem, where incorrect port-no. seemed to cause the Problem. Well, I'm connecting to a multi-tenant DB and use 30015 as port-no. How can I retrieve proper port?
Hello Bartosz,
Thank you very much for your soon Response!
I checked the blog post and run SQL-Statement on our Server. It returned
So, in my opinion port-no 30015 is appropriate for ODBC-Connectstring:
DRIVER={HDBODBC32};UID=SYSTEM;PWD=<pwd>;SERVERNODE=srvsbodev10:30015;DATABASENAME=SBODEMODE
As this doesn't work, I also tried port-no 39013 (System tenant) which also failed.
I'm wondering, why using port 30015 works when ommiting DATABASENAME-Option. If port-no was not correct, it should work at all
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're right, I'm used to SQL Server. I've tried out some various Connection strings and found that I used a catalog name instead of the database name. After changing that, I can connect to HANA-DB now. There's one problem with that: Unlike SQL Server I cannot determine an initial catalog. As none of the SQL-Statements used in our program references tables in way like "<catalog>.<table>", it would be very helpful to have an option to dertermine a Default catalog I need to use. Otherwise I'd have to change tons of queries.
The "initial catalog" in SAP HANA is the database users own schema.
You can set a different current schema when connecting to the database via the CURRENTSCHEMA parameter or, once connected, change the current schema via SET SCHEMA <SCHEMA NAME>.
There's no need to change your application code for that.
Hello ,
please check folowing blog post:
https://blogs.sap.com/2017/12/04/hey-sap-hana-express-edition-any-idea-whats-your-sql-port-number/
It clearly says how to retrieve the port numbers for multitenant databases.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
connect to the SystemDB via port 3<instance no>13 plus the DATABASENAME. That will trigger the SAP HANA client to query the SystemDB for the actual port of the database.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.