Page 1 of 1

delete sql query

Posted: Tue Mar 05, 2019 2:14 am
by gtyagig
i'm not able to execute delete query in nodejs pgm used with profoundjs
i have used simply pjs.query("myquery");
but when i check the record in db table it is still there
i dont know what is happening here

Re: delete sql query

Posted: Tue Mar 05, 2019 4:15 pm
by Kaylee Law
Hello Gajender,

In Profound.js commit control is turned on by default, what is most likely happening is that your delete query is not being committed properly before the module ends, therefore the delete statement is being reverted. There are several ways you can correct this:
  1. You can issue a commit transaction via SQL to finalize all changes.
  2. You can append the SQL clause "with nc;" to the end of your SQL statement to cause that statement to run without commit control.
  3. You could use the pjs.setConnectAttr() api or the connectionDetails configuration option to set the SQL variable 'SQL_ATTR_COMMIT' to 'SQL_TXN_NO_COMMIT'. This will change the SQL connection to no longer use commit control on the SQL statements for as long as that connection stays open.


You can find more information on setConnectAttr() here: http://www.profoundlogic.com/docs/pages ... d=31260795 and you can find more information on the connectionDetials config option here: http://www.profoundlogic.com/docs/displ ... ionDetails.