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
ALTERPROCEDURE [dbo].[sp_DeleteUserData] @ACDetailsID dbo.ACdetailsID_type READONLY AS DECLARE@ID int begintry begintransaction 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 committransaction CLOSEc_ACDetailsID DEALLOCATEc_ACDetailsID endtry begincatch rollback transaction; print error_message(