Purpose of Stored Procedure

Hi All,

Could someone please help on Stored Procedure used in Appian?

My main question is why do we need Stored Procedure in Appian? What is the main purpose behind using this?

In What scenario it can be preferred over views?

Thanks

Faisal

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    A VIEW is a stored SELECT statement that you run over and over.  Basically you SELECT things from a table JOIN to another table JOIN to another table and so on and so on, until you get something really useful that you like, that maps exactly to one of your CDTs for instance.  You save that SELECT you just built in a way it can be automatically run any time you want, and doesn't have to be rewritten from scratch every time.  That's a VIEW.  It lets you look at data.

    A STORED PROCEDURE allows you not only to look at data, but do practically ANYTHING you can possibly think of.  You can CREATE TABLE, ALTER TRIGGER, DROP INDEX, MODIFY USER, RENAME TABLE, REPLACE VIEW, DELETE DATABASE; basically ANYTHING.  Manipulate data, run calculations, put the results of calculations over here into a table over there, change the whole architecture of your schema, make a whole new database defined at runtime.  ANYTHING.  Is what you want to do even the slightest bit more complicated than writing a few rows to a single table?  Consider a STORED PROCEDURE.  Also, keep in mind that there are also FUNCTIONS, which are STORED PROCEDURES that return a value.

Reply
  • 0
    Certified Lead Developer

    A VIEW is a stored SELECT statement that you run over and over.  Basically you SELECT things from a table JOIN to another table JOIN to another table and so on and so on, until you get something really useful that you like, that maps exactly to one of your CDTs for instance.  You save that SELECT you just built in a way it can be automatically run any time you want, and doesn't have to be rewritten from scratch every time.  That's a VIEW.  It lets you look at data.

    A STORED PROCEDURE allows you not only to look at data, but do practically ANYTHING you can possibly think of.  You can CREATE TABLE, ALTER TRIGGER, DROP INDEX, MODIFY USER, RENAME TABLE, REPLACE VIEW, DELETE DATABASE; basically ANYTHING.  Manipulate data, run calculations, put the results of calculations over here into a table over there, change the whole architecture of your schema, make a whole new database defined at runtime.  ANYTHING.  Is what you want to do even the slightest bit more complicated than writing a few rows to a single table?  Consider a STORED PROCEDURE.  Also, keep in mind that there are also FUNCTIONS, which are STORED PROCEDURES that return a value.

Children