Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PostgreSQL
Message
From
01/10/2009 15:42:31
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
01/10/2009 15:26:56
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
01426969
Message ID:
01427175
Views:
59
Thanks.

>some code that may help:
>
>postgres=# CREATE TABLE myTable (
>postgres(# id int,
>postgres(# sid int,
>postgres(# name text);
>CREATE TABLE
>postgres=#
>postgres=# insert into myTable values(1,2,'a');
>INSERT 0 1
>postgres=# insert into myTable values(2,3,'b');
>INSERT 0 1
>postgres=#
>postgres=# select * from myTable;
> id | sid | name
>----+-----+------
> 1 | 2 | a
> 2 | 3 | b
>(2 rows)
>
>postgres=#
>postgres=# CREATE FUNCTION getData(int) RETURNS SETOF myTable AS $$
>postgres$# SELECT * FROM myTable WHERE id = $1;
>postgres$# $$ LANGUAGE SQL;
>CREATE FUNCTION
>postgres=#
>postgres=# SELECT * FROM getData(1) AS t1;
> id | sid | name
>----+-----+------
> 1 | 2 | a
>(1 row)
>
>postgres=#
>postgres=# drop function getData(int);
>DROP FUNCTION
>postgres=# drop table myTable;
>DROP TABLE
>postgres=#
Previous
Reply
Map
View

Click here to load this message in the networking platform