It isnt working this sentence and also i want to capture the result of the function in fwh
sql;
- Code: Select all Expand view
CREATE FUNCTION [dbo].[CalcSaldo]
(
@Codigo varchar(8), @nMes int, @codusu char(2)
)
RETURNS int
AS
BEGIN
-- Declare the return variable here
DECLARE @nResul int
-- Consigo el stock actual
Set @nResul = (dbo.CalcIngAno(@Codigo, @nMes,@codusu) - dbo.CalcSalAno(@Codigo, @nMes, @codusu)) + (dbo.CalcIngMes(@Codigo, @nMes, @codusu) - dbo.calcSalMes(@Codigo, @nMes, @codusu))
RETURN @nResul
END
GO
fwh code
- Code: Select all Expand view
oCon1:=AbreConexBD()
oCon1:Execute( "CALL CalcSaldo('T25CD', '01', '00' )" )
Function AbreConexBD()
LOCAL cCString, oError //, oRS, lRS := .f.
cCString := "Provider=SQLOLEDB;"
cCString += "Server=PYSASERVER;"
cCString += "Database=PysaBD;Uid=sa;Pwd=Pysa123456;"
TRY
oCon1 := CreateObject( "ADODB.Connection" )
oCon1:Open( cCString )
CATCH oError
MsgStop( oError:Description )
//RETURN
END
Return Nil
this error results me
- Code: Select all Expand view
Error description: (DOS Error -2147352567) WINOLE/1007 Sintaxis incorrecta cerca de 'T25CD'. (0x80040E14): Microsoft OLE DB Provider for SQL Server
Args:
[ 1] = C CALL CalcSaldo('T25CD', '01', '00' )
sql: