Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Question about using stored procedures to do inserts and updates - response (2) by QAKiani

$
0
0
You can refer to the Stored procedure documentaion for detail reference. Here is the link www.info.teradata.com/edownload.cfm?itemid=113480020 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) L1: BEGIN         DECLARE AGG_ALL_MAX_ROW_DT DATE;     INSERT    INTO TBL_Error     (        Time_Stamp     )     SELECT CURRENT_TIMESTAMP;             SET Ret_cd = 1;          IF   Ret_Cd = 0 THEN     UPDATE TBL_ERROR     SET TIME_STAMP = CURRENT_TIMESTAMP; END    ;  

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>