Skip to Content

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

Jun 15, 2017 at 12:00 PM


avatar image
Former Member


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,\'\',\'\',\'\',\'\',\'\',\'\',\'\',\'\',' + 
	            + ',\'\');';

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

Regards Klaus

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Florian Pfeffer
Jun 15, 2017 at 05:42 PM

As you doing an insert you should use the executeUpdate method of the connection object instead of executeQuery. You also have to do a commit (using the commit method of the connection object) after your insert statement, because for the $.hdb connection object the autocommit mode is not activated by default.

Please check the $.hdb.Connection reference for more details.


Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hello Florian,

thank you for your help. it works.

Regards Klaus