Deleting data from database

If I want to delete data from database. Is there anyother way expect Delete from Data Store Entity?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    Hi you have an another way to do this as well,

    You can write a stored procedure which will have an IN parameter to accept input from Appian, this procedure should perform your required operations.

    Now you can use Appian smart service or smart service function to invoke this procedure by passing it's parameter.

    I recommend this approach compared to Query Database Smart Service because in case of Query Database Smart Service we are going to use Native SQL queries in Appian process level, which differs from vendor to vendor. And a minor change in column name can cause you to edit the process or Appian object such as constant.

    But when we are using stored procedure, it means any changes in db, will cause you change your procedure in SQL side to avoid any object modification in Appian.

    The another benefit of going with procedure could be, When we use stored procedure and not expecting any output from it, in such case Appian will deliver the request to db and rest of all will be taken care by db hence node will proceed further without making any delay, this will help you when you want to act upon thousands or lakhs of rows in a single transaction. And in fact if you want to halt the node till it's completion then in such case return an output from procedure and capture the same in Appian. But in case of query database smart service, your node will wait till it completes all its query specified with in it.

    However not to forget, both of these approaches are like integration touch point.

    Hope this will help you
Reply
  • 0
    Certified Lead Developer
    Hi you have an another way to do this as well,

    You can write a stored procedure which will have an IN parameter to accept input from Appian, this procedure should perform your required operations.

    Now you can use Appian smart service or smart service function to invoke this procedure by passing it's parameter.

    I recommend this approach compared to Query Database Smart Service because in case of Query Database Smart Service we are going to use Native SQL queries in Appian process level, which differs from vendor to vendor. And a minor change in column name can cause you to edit the process or Appian object such as constant.

    But when we are using stored procedure, it means any changes in db, will cause you change your procedure in SQL side to avoid any object modification in Appian.

    The another benefit of going with procedure could be, When we use stored procedure and not expecting any output from it, in such case Appian will deliver the request to db and rest of all will be taken care by db hence node will proceed further without making any delay, this will help you when you want to act upon thousands or lakhs of rows in a single transaction. And in fact if you want to halt the node till it's completion then in such case return an output from procedure and capture the same in Appian. But in case of query database smart service, your node will wait till it completes all its query specified with in it.

    However not to forget, both of these approaches are like integration touch point.

    Hope this will help you
Children
No Data