Hi,
How I do to return a resultset from a Function, by example:
CREATE FUNCTION MyFunction(cveCliente INTEGER)
RETURNING DECIMAL(8,0), -- Id
CHAR(30), -- Name
DATE, -- Birthday
CHAR(30); -- Adreess
DEFINE lId DECIMAL(8,0);
DEFINE lName CHAR(30;
DEFINE lBirthday DATE;
DEFINE lAdress CHAR(30);
FOREACH curMyCursor FOR
SELECT Id, Name, Birthday, Adress
INTO lId, lName, lBirthday, lAdress
FROM Customers
ORDER BY Id
RETURN lId, lName, lBirthday, lAdress WITH RESUME;
END FOREACH
END FUNCTION;
Its work, but, Is there any form to return all the fields without DEFINE one variable for each field in the table?
I am working with IDS 2000.
In SQL Server, You return all fields from a table with this code:
CREATE PROCEDURE myProc AS
SELECT * FROM Customers;
END;
This code return a resultset with all fileds in the table, can you do it in Informix?
You you can help me?
Regards,
How I do to return a resultset from a Function, by example:
CREATE FUNCTION MyFunction(cveCliente INTEGER)
RETURNING DECIMAL(8,0), -- Id
CHAR(30), -- Name
DATE, -- Birthday
CHAR(30); -- Adreess
DEFINE lId DECIMAL(8,0);
DEFINE lName CHAR(30;
DEFINE lBirthday DATE;
DEFINE lAdress CHAR(30);
FOREACH curMyCursor FOR
SELECT Id, Name, Birthday, Adress
INTO lId, lName, lBirthday, lAdress
FROM Customers
ORDER BY Id
RETURN lId, lName, lBirthday, lAdress WITH RESUME;
END FOREACH
END FUNCTION;
Its work, but, Is there any form to return all the fields without DEFINE one variable for each field in the table?
I am working with IDS 2000.
In SQL Server, You return all fields from a table with this code:
CREATE PROCEDURE myProc AS
SELECT * FROM Customers;
END;
This code return a resultset with all fileds in the table, can you do it in Informix?
You you can help me?
Regards,