I am trying to put togeather a stored procedure that will update exsisting records or insert a new record when appropriate.
Any suggestions on how to do this would be greatly appreciated.
You can refer to the Stored procedure documentaion for detail reference. Here is the link
The stored procedure support both the INSERT and UPDATE SQL statements just like you are doing in any other scripts. Here is a very basic example showing how things work in stored procedure...
REPLACE PROCEDURE DP_CCP.IC_AGLD_CCP(OUT Ret_Cd INTEGER)
DECLARE AGG_ALL_MAX_ROW_DT DATE;
INSERT INTO TBL_Error
( Time_Stamp )
SET Ret_cd = 1;
IF Ret_Cd = 0 THEN
SET TIME_STAMP = CURRENT_TIMESTAMP;