cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting values from JAVA application to HANA tables

Former Member
0 Kudos

Hi experts,

I am trying to insert the content to HANA tables from a java application.

my table name is : movies

my schemaID is :IDXXXXXX

i have set the connection string like "jdbc:sap://<server IP>:3XX15/?user=<userid>&password=<password>&currentschema=IDXXXXX". My prepared statement is like follows :INSERT INTO MOVIE VALUES (?,?,?,?,?,?,?,?,?,?). when i am executing my java application i am getting an error as

"invalid table name:  Could not find table/view MOVIE in schema IDXXXXXX". can anyone help me?

Regards

Dinesh.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi All,

Thanks for all of your response. I solved the issue, problem is with the insert statement. we need to use the backslash to give the escape sequence. Following is the template to give insert statement.

INSERT INTO \"<SchemaName>\".\"<pkgname>::MOVIE\" (ID,TITLE,TITLE_ZH,YEAR,MPAA_RATING,RUNTIME,CRITICS_CONSENSUS,RELEASE_DATE,SYNOPSIS,POSTER) VALUES (?,?,?,?,?,?,?,?,?,?)"

Regards

Dinesh.

Answers (3)

Answers (3)

Former Member
0 Kudos

This message was moderated.

former_member290321
Participant
0 Kudos

Please give the full path schemaname.ownername.tablename and try again.

Former Member
0 Kudos

ownername means?

former_member184768
Active Contributor
0 Kudos

Pls execute a query SELECT schema_name, table_name from M_TABLES where table_name = 'movies' (check the case of the movies, upper or lower).

the schema name is the owner.

Ravi

Former Member
0 Kudos

Hi Ravi,

Name of the table is in uppercase only, is this related with any access priviliges?

Regards

Dinesh.

former_member182302
Active Contributor
0 Kudos

The error message is mentioning that the table is not present in that schema. Schema name and Table name are case sensitive.. if incase you are using a camel case or lowercase

Regards,

Krishna Tangudu