Skip to Content
avatar image
Former Member

Unable to execute Inner join

Hi All,

I have executed the below query and the validation is failed because of Invalid table name. But I have created both the tables Customer and Sales_Order .I have checked the data inthose tables also. But not sure why this error is coming.

SELECT T2."OrderID", T1."CustomerID", T1."CustomerName", T2."Product", T2."Total_Units"

     from "CUSTOMER" AS T1

        INNER JOIN

    "SALES_ORDER" AS T2

        ON T1."CustomerID" = T2."CustomerID";

Error:

Could not execute 'SELECT T2."OrderID", T1."CustomerID", T1."CustomerName", T2."Product", T2."Total_Units" from ...' in 3 ms 270 µs .

SAP DBTech JDBC: [259] (at 145): invalid table name:  Could not find table/view SALES_ORDER in schema XXXX: line 4 col 8 (at pos 145)

Please help me on this.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 26, 2014 at 05:48 AM

           Hi Sreelatha ,

          This is because table SALES_ORDER is not in your schema or table does not exists.

     

          If you don't add the schema name first, then by default hana thinks that table is located in your schema.

          Below query will help, where it is located:

        

          select * from "PUBLIC"."TABLES" WHERE TABLE_NAME = 'SALES_ORDER' ;

        

         Table Name should be like these:

        "BASE_SCHEMA"."DB_ACTIVITY_MAPPING"

         Hope these helps😳.

             -

          Pratik

    .

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      The issue got resolved . Thanks

      I have executed the below query and noticed that table Sales_Order is present under multiple schemas. Hence the system is not able to recognize the exact schema. I have added Schema name before the table and executed the query and worked successfully

      select * from "PUBLIC"."TABLES" WHERE TABLE_NAME = 'SALES_ORDER' ;

  • Dec 26, 2014 at 05:36 AM

    Hi sreelatha,

    Can you check table names (spelling)?

    Are these two tables belongs to same schema?

    Regards,

    sai Krishna.

    Add comment
    10|10000 characters needed characters exceeded