Skip to Content
0
Former Member
Jun 15, 2017 at 12:00 PM

HDBSEQENCE throw error 585. The statement is not supported by the function

402 Views

Hi,

I try to create a table entry with xsjs.

For the key-field I use an hdbseqence.file.

When I debug the source, copy the SQL Statment and use it in the SQL-Console everything works fine.

What's wrong with my xsjs file?

function create(key) {


	var mnumber = key;
	var conn = $.hdb.getConnection();
	var query = 'insert into "KKH_SM.Development.DDIC::Contact.Detail" values("KKH_SM.Development.DDIC::contactSeq".NEXTVAL,\'\',\'\',\'\',\'\',\'\',\'\',\'\',\'\',' + 
	            mnumber 
	            + ',\'\');';


	try {
		var qResult = conn.executeQuery(query);
		$.response.setBody(qResult.toString());
		$.response.status = $.net.http.OK;
	} catch (ex) {
		$.response.setBody(ex.message.toString());
		$.response.status = $.net.http.BAD_REQUEST;
	}
	conn.close();
}

Regards Klaus