From sivagami@worlddata.com Thu Oct 26 20:47:54 2000 Received: from hub.org.org (localhost [127.0.0.1]) by hub.org (8.10.1/8.11.0) with SMTP id e9QKlsU18042 for ; Thu, 26 Oct 2000 16:47:54 -0400 (EDT) (envelope-from pgsql-admin-owner@hub.org) Received: from hydra.worlddata.com (hydra.worlddata.com [209.244.192.166]) by hub.org (8.10.1/8.11.0) with ESMTP id e9QFWUU04215 for ; Thu, 26 Oct 2000 11:32:31 -0400 (EDT) (envelope-from sivagami@worlddata.com) Received: from dragon ([209.244.192.67]) by hydra.worlddata.com (Netscape Messaging Server 4.15) with SMTP id G31N2F00.QEY for ; Thu, 26 Oct 2000 11:30:15 -0400 Message-ID: <005401c03f61$a3515d50$43c0f4d1@worlddata.com> From: "Sivagami ." To: Subject: Create Procedure syntax Date: Thu, 26 Oct 2000 11:30:14 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0051_01C03F40.1C307B10" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.3018.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 X-Archive-Number: 200010/125 X-Sequence-Number: 919 This is a multi-part message in MIME format. ------=_NextPart_000_0051_01C03F40.1C307B10 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I have 3 simple questions: 1. What is the exact syntax to create a procedure? 2. How can I print something to my screen ,e..g, the value of a variable i= n a stored procedure. Something similar to DBMS_OUTPUT.PUT_LINE in Oracle?? 3. Also, is there any dynamic discussion forum for PGSQL, where I post a q= uery, and anyone can reply me back and I can see the reply immediately in t= he forum. Thanks to anyone who can guide me in the right direction. Shiva. ------=_NextPart_000_0051_01C03F40.1C307B10 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
I have 3 simple questions:
 
1.  What is the exact syntax to create a=20 procedure?
 
2.  How can I print something to my screen ,e..g, = the=20 value of a variable in a stored procedure.
     Something similar=20 to DBMS_OUTPUT.PUT_LINE in Oracle??
 
3.  Also, is there any dynamic discussion forum fo= r=20 PGSQL, where I post a query, and anyone can reply me back and I can see the= =20 reply immediately in the forum.
 
Thanks to anyone who can guide me in the right=20 direction.
Shiva.
------=_NextPart_000_0051_01C03F40.1C307B10-- From tolik@aaanet.ru Fri Oct 27 06:07:40 2000 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