RawSQL plugin error

Hello everybody,

I’m using Servoy 3.5RC5 on a Mac Intel. I would like to use the rawSQL plugin to feed data to a Sybase 9.02 table, but I get a message (using plugins.rawSQL.getExceptionMsg() ) saying that my primary key cannot be NULL.

I certainly understand that, but I would’ve thought that the rawSQL plugin would take care of creating the rows, putting the autoenter incremented value in the PK, which is not referenced at all in my code… :?

Here is my code (the server and table names are defined as globals earlier in the method):

var sqlString = "INSERT INTO mod_ls_importer_table01 (ls_supplier_no, ls_supplier_name) VALUES('1188','Messagerie XYZ');";

plugins.rawSQL.executeSQL(svrName, tblName, sqlString);

Any clues as to how to avoid the error condition and effectively import the data in the table?

Thanks in advance,

Ben

Obviously if your Primary key is Servoy managed the rawSQL plugin will not update your primary key, that’s why we call it raw it goes straight to your database with no Servoy intervention. What you can consider to do is set an autoincrement PK in sybase, then in Servoy set the PK to db managed.

Thanks for the quick reply Jan, I tested with your recommendations and it works! :)

Sincerely,

Ben