On Thu, May 13, 2010 at 10:09:51AM +0000, Jasen Betts wrote: > On 2010-05-12, Josh <[email protected]> wrote: > don't need a function for that one. > > INSERT INTO unpart_tbl_test > SELECT GENERATE_SERIES(0,9999999), > 'teststring data', > date '1995-01-01' +(floor(random()*36520)::int % 3652);
...and if you'd rather it were a function anyway, do this:
CREATE FUNCTION populate_table() RETURNS VOID AS $$
INSERT INTO unpart_tbl_test
SELECT GENERATE_SERIES(0,9999999),
'teststring data',
date '1995-01-01' +(floor(random()*36520)::int % 3652);
$$ LANGUAGE SQL;
--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com
signature.asc
Description: Digital signature
