pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Clint Stotesbery <cstotes@hotmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: converting an oracle procedure to postgres
Date: Mon, 20 Oct 2003 14:28:24 -0700
Message-ID: <200310201428.24871.josh@agliodbs.com> (raw)
In-Reply-To: <BAY9-F31GnRtU4RFuiP0001795c@hotmail.com>
References: <BAY9-F31GnRtU4RFuiP0001795c@hotmail.com>

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




view thread (3+ messages)  latest in thread

Message-ID: <200310201428.24871.josh@agliodbs.com>
Permalink:  ../200310201428.24871.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200310201428.24871.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, cstotes@hotmail.com
  Subject: Re: converting an oracle procedure to postgres
  In-Reply-To: <200310201428.24871.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox