SQLite uses the PLSQL language as basis for your commands because this many commands resemble other common DBMS market. Because of that the syntax for creating procedures are simple to be learned and understood.

CREATE PROC [Procedure name]([Parameters])

AS

$$

[Commands]

$$

As a practical example we will create a simple procedure that will return a query from database.

CREATE PROC product_list()

AS

$$

SELECT Name, Size

FROM Product

$$

To perform the procedure exec statement is used as shown in the example below, you can also use the drop statement to delete the procedure from the database.

exec product_list();

drop product_list;

Using procedures reuse the source code gets much simpler in several situations while developing a project and because of this feature is so important.

SQLite

Learn more about SQLite in PHP projects and understand why he is considered a great option for web applications.

Source:http://chriswolf.heroku.com/articles/2011/01/26/adding-stored-procedures-to-sqlite

You might also like…

PROCESAMIENTO AJAX EN SCRIPTCASE

Ajax en los formularios de Scriptcase puede usarse para recargar un campo de tipo de select basado e...

IMPORTAR IMAGENES DE LA BASE DE DATOS Y UTILIZAR CLASES DE BOOSTRAP

Como muchas personas ya saben, Bootstrap es una biblioteca de front-end libre y de código abierto p...

TENDENCIAS DE DESARROLLO WEB PARA 2017

Usted verá en este post tendencias para 2017 en Diseño Web, en el medio digital y en el desarrollo...

Comment this post

Get new posts, resources, offers and more each week.

We will use the information you provide to update you about our Newsletter and Special Offers. You can unsubscribe any time you want by clinck in a link in the footer of any email you receive from us, or by contacting us at sales@scriptcase.net. Learn more about our Privacy Police.