Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 586B1650E82 for ; Tue, 24 Jun 2008 07:43:44 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 11118-09 for ; Tue, 24 Jun 2008 07:43:36 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by postgresql.org (Postfix) with ESMTP id 18F7A650E2C for ; Tue, 24 Jun 2008 07:43:39 -0300 (ADT) Received: by fg-out-1718.google.com with SMTP id 16so1332209fgg.23 for ; Tue, 24 Jun 2008 03:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=sgNmC+NAJoe/LSz6whWQhqH+am1r8y4WI6s0w8JWyaU=; b=mWJfDP4P5uSMK9scHePVses2f42h1xBd9UATDBUZgoETeFcAJLdugYf61ZdIYO0lzP KKni9Fw8QiWX5qu1xUaCofY1lTkUZVIXNkdiIEA8it3C5OLusTh5DEHDJNsFVwOdw2dk hulhCAbRzPCKHxbn57Y6rZx6huo30/rrkgbHU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=bWLz22a/JDlUL5zFwVrx6ZWUDo5/d2Epz1QeVH8Q5Mqt2rz5jYhaqHV0ZwKr9yJvI6 8u9B7uMRIJzA8BP9UIvj0Y4KraPkYBLEGLXafLlc7zLKVHjMfBGfacFpJzEtS6jUctE9 linpIVvighluRkNqCLYt5Sa442BdI6G+fbK9c= Received: by 10.86.59.18 with SMTP id h18mr8810601fga.30.1214304218473; Tue, 24 Jun 2008 03:43:38 -0700 (PDT) Received: by 10.86.92.18 with HTTP; Tue, 24 Jun 2008 03:43:38 -0700 (PDT) Message-ID: Date: Tue, 24 Jun 2008 16:13:38 +0530 From: "C K" To: "pgsql-admin@postgresql.org" Subject: Functions MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_551_250315.1214304218444" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200806/204 X-Sequence-Number: 29542 ------=_Part_551_250315.1214304218444 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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. ------=_Part_551_250315.1214304218444 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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. ------=_Part_551_250315.1214304218444--