Re: [GENERAL] Re: [HACKERS] [Fwd: SGVLLUG Oracle and Informix on Linux] - Mailing list pgsql-general

From Herve Lefebvre
Subject Re: [GENERAL] Re: [HACKERS] [Fwd: SGVLLUG Oracle and Informix on Linux]
Date
Msg-id 19980722143912.12067.rocketmail@web2.rocketmail.com
Whole thread Raw
List pgsql-general
---Bruce Tong <zztong@laxmi.ev.net> wrote:
> > features != ANSI SQL compliance, right?
>
> I suppose ANSI SQL is the heart of it.
>
> > Again, what are we missing that Oracle currently has...?
>

Stored procedures with tuples resultset:

SELECT F1,F2,F3 FROM TABL1

And Multi-resultsets stored-procedures:

SELECT F1,F2 FROM TABLE1
SELECT F3,F4,F5 FROM TABLE2

And how can we declare/use variables with PG-SQL ?

With Sybase (and oracle) I can do that:

PROCECURE p (@org_account int, @dest_account int, @amount money)
as
   DECLARE @balance money
   BEGIN TRAN
      SELECT @balance=balance
      FROM account_table
      WHERE @account_num=@org_account

      /* Check if enough money on the account */
      IF @balance<@amount
      BEGIN
         ROLLBACK TRAN
         RETURN -1 /* Not enough money */
      END

   /* proceed with the updates */
       ...

   COMMIT TRAN
   RETURN 0
go

How to do a such stored procedure with pgSQL ? (please, don't say me
to write it in C language ).

--
H.L.
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


pgsql-general by date:

Previous
From: Maarten Boekhold
Date:
Subject: Re: [GENERAL] Re: [HACKERS] [Fwd: SGVLLUG Oracle and Informix on Linux]
Next
From: James Olin Oden
Date:
Subject: Re: [GENERAL] Re: [HACKERS] [Fwd: SGVLLUG Oracle and Informix on Linux]