Hi all
Like I told before, I'm coming from Interdabe!!
so, could anyone send me some examples of CREATE FUNCTION? (using SQL
language)
This is an Interbase sample:
CREATE PROCEDURE MY_PROC( P_DATE_START TIMESTAMP )
RETURNS ( R_DATE_PAYMENT TIMESTAMP, R_DESCRIPTION VHARCHAR(50), R_VALUE
NUMERIC (12,2))
AS
BEGIN
FOR SELECT DATE_PAYMENT, R_DESCRIPTION,VALUE FROM PAYMENTS
WHERE DATE_PAYMENT BETWEEN :P_DATE_STAR AND 'TODAY'
INTO
:R_DATE_PAYMENT ,
:R_DESCRIPTION ,
:R_VALUE
DO
BEGIN
/*here I can do any check for each row of SELECT below!! */
SUSPEND; /* Each SUSPEND command returns a row */
END
END^
I can use this stored proc like this:
SELECT * FROM MY_PROC( '01/01/2002' )
and it may return many rows ...
tia
Roberto de Amorim