help with function .. .. date data type - Mailing list pgsql-novice

From ed
Subject help with function .. .. date data type
Date
Msg-id KGELJGBAHPDNPFCCDAKHAEBHCAAA.ntworldnet@netzero.net
Whole thread Raw
Responses Re: help with function .. .. date data type  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: help with function .. .. date data type  (John DeSoi <desoi@pgedit.com>)
List pgsql-novice

I have a table with 7 columns and Im trying to pull a section(rows) of the table

by using the date column(field), in a function. I want it to work like so;

# Select Slice('03/01/2004', '03/05/2003');

But Im getting an error .. .. ...

------------------------- this is the error ------------------------------

NOTICE: Error occurred while executing PL/pgSQL function slice

NOTICE: line 9 at SQL statement

ERROR: zero-length delimited identifier

-------------------------- end of error -----------------------------------

What Am I doing wrong.

------------------------------ my code ----------------------------------

CREATE FUNCTION Slice(date, date)

RETURNS date AS'

DECLARE

f_table RECORD;

lower Alias for $1;

upper Alias for $2;

BEGIN

set datestyle to ""US, SQL"";

for name in lower..upper

Loop

SELECT * INTO f_table from g_table          -- my g_table is the real table in the datebase.

WHERE g_table.date BETWEEN upper AND lower

ORDER BY g_table.date;

End Loop;

 

END;

'Language 'plpgsql';

Ed..

 
 
 

pgsql-novice by date:

Previous
From: "Prasad dev"
Date:
Subject: Raise Notice
Next
From: Tom Lane
Date:
Subject: Re: help with function .. .. date data type