MS-SQL Store Procedure to Postgresql Function - Mailing list pgsql-sql

From Rehan Saleem
Subject MS-SQL Store Procedure to Postgresql Function
Date
Msg-id 1327905771.73991.YahooMailNeo@web121606.mail.ne1.yahoo.com
Whole thread Raw
Responses Re: MS-SQL Store Procedure to Postgresql Function  ("F. BROUARD / SQLpro" <sqlpro@club-internet.fr>)
List pgsql-sql
hi , how i can convert this store procedure to PostgreSQL function, especially I really dont know how to set type to readonly in PostgreSQL.
thanks


ALTER PROCEDURE [dbo].[sp_DeleteUserData]
      @ACDetailsID dbo.ACdetailsID_type READONLY
     
AS
 
DECLARE @ID int
begin try
begin transaction
 
 DECLARE c_ACDetailsID CURSOR FOR SELECT id FROM @ACDetailsID
 OPEN c_ACDetailsID
 FETCH NEXT FROM c_ACDetailsID INTO @ID
 WHILE (@@FETCH_STATUS = 0) BEGIN
 
      delete from UserAccountDetails  where UserDataAcountId=@ID
      delete from UserAC where UserDataAcountId=@ID
     
 FETCH NEXT FROM c_ACDetailsID INTO @ID
End --end of while loop      
 
commit transaction     
CLOSE c_ACDetailsID
DEALLOCATE c_ACDetailsID
end try
 
begin catch
      rollback transaction;
      print error_message(

pgsql-sql by date:

Previous
From: Lew
Date:
Subject: Re: Query question
Next
From: Anson Abraham
Date:
Subject: querying a column w/ timestamp with timezone datatype