delete sql query

Use this board to ask questions or have discussions with other Profound.js users.
gtyagig
New User
Posts: 1
Joined: Tue Mar 05, 2019 2:11 am
First Name: gajender
Last Name: tyagi
Company Name: programmers.io
Phone: 09785374546
Address 1: lalkothi
Address 2: jaipur
City: jaipur
State / Province: Rhode Island
Zip / Postal Code: 302015
Country: India
Contact:

delete sql query

Post 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
User avatar
Kaylee Law
Profound Logic Staff Member
Posts: 13
Joined: Mon Sep 18, 2017 11:36 am
First Name: Kaylee
Last Name: Law
Company Name: Profound Logic
Contact:

Re: delete sql query

Post 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.
Kaylee Law
Technical Support Specialist
Profound Logic Software
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests