Received: from aaanet.ru (aaanet.ru [213.59.98.254]) by hub.org (8.10.1/8.11.0) with ESMTP id e9R67dq22660 for ; Fri, 27 Oct 2000 02:07:40 -0400 (EDT) (envelope-from tolik@tolikus.hq.aaanet.ru) Received: from tolikus.hq.aaanet.ru ([213.59.98.104]) by aaanet.ru with esmtp (Exim 3.12 #1) id 13p2fs-000Hfx-00; Fri, 27 Oct 2000 10:07:32 +0400 Received: (from tolik@localhost) by tolikus.hq.aaanet.ru (8.9.3/8.9.3) id KAA02921; Fri, 27 Oct 2000 10:07:35 +0400 (MSD) (envelope-from tolik) To: "Sivagami ." Cc: Subject: Re: Create Procedure syntax References: <005401c03f61$a3515d50$43c0f4d1@worlddata.com> Mime-Version: 1.0 (generated by tm-edit 1.5) Content-Type: text/plain; charset=US-ASCII From: tolik@aaanet.ru (Anatoly K. Lasareff) Date: 27 Oct 2000 10:07:35 +0400 In-Reply-To: "Sivagami ."'s message of "Thu, 26 Oct 2000 11:30:14 -0400" Message-ID: <86snpiu89k.fsf@tolikus.hq.aaanet.ru> Lines: 46 X-Mailer: Gnus v5.6.45/XEmacs 21.1 - "Canyonlands" X-Archive-Number: 200010/126 X-Sequence-Number: 920 >>>>> "S" == Sivagami writes: S> [1 ] S> Hi, S> I have 3 simple questions: S> 1. What is the exact syntax to create a procedure? CREATE FUNCTION name ( [ ftype [, ...] ] ) RETURNS rtype AS definition LANGUAGE 'langname' [ WITH ( attribute [, ...] ) ] CREATE FUNCTION name ( [ ftype [, ...] ] ) RETURNS rtype AS obj_file , link_symbol LANGUAGE 'C' [ WITH ( attribute [, ...] ) ] There are _no_ procedures in Postgres, functions only! This syntax is taken from "PostgreSQL User's Guide". S> 2. How can I print something to my screen ,e..g, the value of a variable in a stored procedure. You can use 'raise notice' in plpgsql functions: --------------------------------------- Aborting and messages As indicated in the above examples there is a RAISE statement that can throw messages into the Postgres elog mechanism. RAISE level format'' [, identifier [...]]; Inside the format, "%" is used as a placeholder for the subsequent comma-separated identifiers. Possible levels are DEBUG (silently suppressed in production running databases), NOTICE (written into the database log and forwarded to the client application) and EXCEPTION (written into the database log and aborting the transaction). --------------------------------------- -- Anatoly K. Lasareff Email: tolik@aaanet.ru http://tolikus.hq.aaanet.ru:8080 Phone: (8632)-710071