首页 > 代码库 > oracle 流程控制语句

oracle 流程控制语句

DECLARE
                                                               CNT   PLS_INTEGER;
                                                            BEGIN
                                                               SELECT COUNT (*) FCOUNT
                                                                 INTO CNT
                                                                 FROM (SELECT 1
                                                                         FROM USER_TAB_COLUMNS
                                                                        WHERE     (    TABLE_NAME = {0}
                                                                                   AND COLUMN_NAME = FCKJF)
                                                                              AND ROWNUM <= 1);

                                                               IF CNT > 0
                                                               THEN
                                                                  EXECUTE IMMEDIATE
                                                                     UPDATE {0}
                                                               SET FFOUNDORSTOCKCOST = FFOUNDORSTOCKCOST + nvl(FCKJF,0);
                                                               END IF;
                                                            END;

if...else...条件选择结构。

oracle 流程控制语句