Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returnning more than one field in FUNCTION

Status
Not open for further replies.

JCarlosS

Programmer
Oct 5, 2001
4
0
0
MX
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,

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top