pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: C K <shreeseva.it@gmail.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Functions
Date: Tue, 24 Jun 2008 16:13:38 +0530
Message-ID: <d3561eb00806240343i772d1043jdd320cc629898901@mail.gmail.com> (raw)

Dear Members,
I am switching our ERP and other under development applications from MySQL
to PostgreSQL. While working on this, I got some problems while creating
store procedures. As PG does not support procedures, rather it uses
Functions. While creating a function from MySQL as

CREATE DEFINER=`root`@`localhost` PROCEDURE `postdoc`(vardocid int)
    MODIFIES SQL DATA
UPDATE docs        SET posted = -1        WHERE docid = vardocid;

on PG, it gave me error for using variable in where condition. Other things
are properly defined thru' PGAdmin. Does PG do no support to use variables
or variable names in the functions? As per manual for 8.3, I understood to
use $1, $2...$n for the input parameter reference, but it is difficult to
mark them correclty in a big function having many parameters.
How could I use varibles in the functions?
Plesae help and give the details on above issue.

Thanks

CPK
-- 
Keep your Environment clean and green.

view thread (12+ messages)  latest in thread

Message-ID: <d3561eb00806240343i772d1043jdd320cc629898901@mail.gmail.com>
Permalink:  ../d3561eb00806240343i772d1043jdd320cc629898901@mail.gmail.com/
Also on:    postgresql.org/message-id/d3561eb00806240343i772d1043jdd320cc629898901@mail.gmail.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-admin@postgresql.org
  Cc: shreeseva.it@gmail.com
  Subject: Re: Functions
  In-Reply-To: <d3561eb00806240343i772d1043jdd320cc629898901@mail.gmail.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