on 08-17-2017 2:28 PM
so I have the following code to remove a table from HANA using XSJS.
var table "ZNAme";
var connection = $.db.getConnection();
var query;
try{
query = 'DROP TABLE MYSCHEMA.' + table;
var drop = connection.prepareStatement(query);
drop.execute();
}catch(e){
$.response.setBody(e.message);
}
The problem is that when I run it it gives me an error saying it can't find the table "ZNAME". For some reason it changes all the chars to upper case. However I'm creating this table also using xsjs and it works fine. I'm able to create the table, add data to it and read the data from it. The only thing I can't do is remove it. It only works if all chars are in upper case. Can someone explain to me why this is going on?
In case the table name is not enclosed in double quotes the name is uppercased. You have to enclose it with double quotes:
...
query = 'DROP TABLE MYSCHEMA."' + table + '"';
...
Regards,
Florian
PS:
You said that you have used an XSJS service to create the table. Did you enclose the table name there? If not you should have seen the same behavior that the name is uppercased.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
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.