| From: | "Josh Berkus" <josh(at)agliodbs(dot)com> |
|---|---|
| To: | Wendy Powley <wendy(at)cs(dot)queensu(dot)ca>, pgsql-novice(at)postgresql(dot)org |
| Subject: | Re: Stored Procedures |
| Date: | 2002-05-07 17:35:11 |
| Message-ID: | web-1452560@davinci.ethosmedia.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
Wendy,
> Is it possible to write a stored procedure which takes a struct as a
> parameter? I'd like to be able to pass in some info via a struct &
> return some info via another struct something like this:
What's a "Struct"? It's not a standard SQL term, and I don't recognize
it.
> struct in_struct {
> integer i, j;
> }
>
> struct out_struct {
> integer k;
> char p;
> }
Are you trying for a custom data type, or more of a record? Postgres
supports both.
> create function myfunc(in_struct, out_struct) .....
Postgres does not support output parameters, at present. Functions
have one return value of a defined data type (which may be a custom
data type or a record, if you wish).
-Josh Berkus
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Josh Berkus | 2002-05-07 17:38:41 | Re: Problems with psql : ERROR : pg_user: permission |
| Previous Message | Henshall, Stuart - WCP | 2002-05-07 16:13:26 | Re: ERROR: $1 is declared CONSTANT in plpgsql |