Friday, 5 October 2018

SQL failed with error "column ambiguously defined" in HANA Database

Tags


Symptom
Execution of SQL statement failed with error:

SAP DBTech JDBC: [268]: column ambiguously defined: $rowid$: line col (at pos xxxx)

Environment

    HANA 1.0
    HANA 2.0

Reproducing the Issue

Execute the SQL statement via HANA studio SQL console or hdbsql
Cause

When internal columns such as $rowid$ is used, table name needs to be defined, otherwise, error message "column ambiguously defined" will occure
 
Resolution

If your SQL statement contains

ORDER BY "$rowid$"
And the execution failed with error "column ambiguously defined", you need to modify the statement to include the table name, for example:

ORDER BY ."$rowid$"

More details Refer Snote : 2695943

How to install HANA license by OS commands

Tags
Symptom

You need to use OS commands to access the HANA Database and manage the license.

Because there's no HANA Studio or HANA Cockpit available to manage the license for some reason.

Environment

    HANA Platform 1.0
    HANA Platform 2.0

Resolution

1. Logon as sidadm user, connect to the Database via hdbsql.

    If it is a single container system, please try below command:

> hdbsql -n :315 -i -u -p

    If it is a MDC system, please try connecting to the system DB by below command:

> hdbsql -n :313 -i -u -p

2. Enable multiline mode in hdbsql

hdbsql => \mu

3. You need a new license key, which you can download from Support Portal.

4. Enter statement  SET SYSTEM LICENSE ''.

Please note to add quotation mark outside the content of the license file you just downloaded.

5. Execute the statement by command: \g

hdbsql => \g


Remarks:
Install the new license via hdbsql cannot replace the old license. Please consider to delete the old license key before installing the new one.

You can also delete license keys by executing the SQL statement UNSET SYSTEM LICENSE ALL. 

More Details refer Snote :2690863