Then I had a procedure that called the function
and kept the data in a table variable
now how to do it in SQL Anywhere
the query is slightly longer but I have summarized
* /
CREATE FUNCTION fun_1
(@finicio datetime,
@ffinal datetime)
RETURNS @tab1 TABLE (CIndice int IDENTITY(1, 1) NOT NULL,
CodOperacion numeric(18,0),
CodCliente varchar(10))
AS
BEGIN
DECLARE @masvariables numeric(18,0)
Insert into @tab1 (CodOperacion, CodCliente)
Select CodOP, Cliente from Tabla1
--where .......
return
End
go
Create procedure SP_1
As
declare @finicio datetime
declare @ffinal datetime
declare @vartabla_1 table (
CIndice int NOT NULL, CodOperacion numeric(18,0), CodCliente
varchar(10) )
insert into @vartabla_1
Select CIndice, CodOperacion ,CodCliente from [fun_1]
(@finicio, @ffinal)
/*
more code....
*/
thanks greetings