I have this code in VB where I open my connection to the database and connect to my pgsql function..
Set oCmd = New ADODB.Command
oCmd.ActiveConnection = GetConnectionString
oCmd.CommandType = adCmdStoredProc
oCmd.CommandTimeout = 36000
oCmd.Parameters.Append oCmd.CreateParameter("lngUserId", adInteger, adParamOutput)
oCmd.CommandText = "P_Login"
oCmd.Execute
g_USRid = oCmd.Parameters("lngUserId")
In my pgsql function I have this:
CREATE OR REPLACE FUNCTION p_login(
OUT lnguserid bigint) RETURNS record AS
$BODY$
DECLARE
BEGIN
--Select USR_Id into lngUserID From tbl_User Where USR_Login = strLogin;
lngUserID := 369;
END;
$BODY$
LANGUAGE plpgsql VOLATILE SECURITY DEFINER
COST 100;
The problem is that my variable g_USRid
doesn't get the value 369. How can I do that?