In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Today, the editor will take you to understand the structure of Oracle PL/SQL IF sentences. The code explanation of this article is quite good for the editor, so I would like to share it with you for reference. Let's follow the editor and have a look.
The structure of the Oracle IF statement is similar to that of most languages
IF condition THEN expr;ELSIF condition THEN expr;ELSE expr;END IF
For example:
SELECT COUNT (DISTINCT INDEX_NAME) INTO CNT FROM USER_INDEXES WHERE TABLE_NAME=C1.TABLE_NAME; IF CNT > 1 THEN FOR C2 IN (SELECT DISTINCT INDEX_NAME FROM USER_INDEXES WHERE TABLE_NAME=C1.TABLE_NAME) LOOP EXECUTE IMMEDIATE 'ALTER INDEX' | | C2.INDEX_NAME | | 'REBUILD'; END LOOP; ELSIF CNT = 1 THEN EXECUTE IMMEDIATE' ALTER INDEX'| | C2.INDEX_NAME | | 'REBUILD' ELSE DBMS_OUTPUT.PUT_LINE (C1.TABLE_NAME | | 'THERE IS NO INDEXES NEED TO REBUILDING'); END IF
After reading the content of the appeal, do you have a general understanding of the structure of the Oracle PL/SQL IF sentence? If you want to know more about the content of the article, welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.