MeOnTheW3 wrote:From my quick research on building functions for postgreSQL I found it was easier in my case to build a table that held my sql statments along with usage restriction(s) ids that were references to xml definitions responsible for dictating how it was to be used in my system, and this was all called in with a php API i developed that processed the statement based on the definition and acted accordingly.
HOWEVER,

if you wanted to build functions, they seem quite basic and are best developed in C/C++ and imported as addtional functionality add-ins. This is all supported by postgreSQL.
Thank you Jason, but...
When I build a Stored Procedure in SQL Server, for example, to insert some data I do this:
IF EXISTS (SELECT name FROM sysobjects
WHERE name = 'proc_gbl_InsertLogin' AND type = 'P')
DROP PROCEDURE proc_gbl_InsertLogin
GO
CREATE PROCEDURE proc_gbl_InsertLogin
(
@cLoginName VARCHAR(10),
@cPassWord VARCHAR(10),
)
AS
-----------------------------------
--Here I put all my Code
------------------------------------
DECLARE @EXISTLOGIN varchar(10)
DECLARE @HORAH datetime
SELECT @HORAH = GETDATE()
---------------
BEGIN
SELECT @nCodLogin=0;
ETC....
From VB component I can call..
With Cmd
.ActiveConnection = Conn
.CommandText = "proc_gbl_InsertLogin"
.CommandType = adCmdStoredProc
.CommandTimeout = 15
Set Prm = Cmd.CreateParameter("cLoginName", adVarChar, adParamInput, 10, cLoginName)
.Parameters.Append Prm
Set Prm = Cmd.CreateParameter("cPassWord", adVarChar, adParamInput, 10, cPassWordCript)
.Parameters.Append Prm
.Execute
End With
----------------------------------------------------------------------------
In the same way I do this for Delete and Update.Sorry for the long text.
The question is:
How can I build a Stored Procedure (Function) in PostgreeSQL and
how can I call it from PHP, what is the sintaxe ?
Of course if the friend have some tutorial or URL to help, it will be great.
Yours sincerely