Re: converting an oracle procedure to postgres

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Clint Stotesbery" <cstotes(at)hotmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: converting an oracle procedure to postgres
Date: 2003-10-20 21:28:24
Message-ID: 200310201428.24871.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Clint,

> v_taxstatus varchar(1);
> v_shipping varchar(12);

Drop the varchar limits, it's not supported inside PL/pgSQL.

> I know I have to relpace the word PROCEDURE with FUNCTION but then it wants
> me to put RETURNS <datatype> but I don't want to return anything. I was
> thinking that I could just have it return integer and then after the last
> update statement put return 0. I'd rather not have it return a junk value
> though. What should I do?

I generally return integer or boolean for such functions. For example, you
can have it return "TRUE" at the end, and then your client code can interpret
any non-true result (Error message, null) as an error.

--
-Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-10-20 22:32:15 Re: converting an oracle procedure to postgres
Previous Message Clint Stotesbery 2003-10-20 21:20:32 converting an oracle procedure to postgres