Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Insert data into the table when creating the table

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

DECLAREBEGINexecute immediate 'create table TJ_JKTJBACK(tjbh VARCHAR2(200) not null,grbh VARCHAR2(200),tjlb VARCHAR2(10),tjlbmc VARCHAR2(500))';execute immediate 'INSERT INTO TJ_JKTJBACK SELECT * FROM TJ_JKTJ';commit;EXCEPTIONWHEN OTHERS THENROLLBACK;END;

Execute immediate bypasses db's checking of statements. No overtime table has not been created, DB analysis insert statement error.

Ordinary SQL statements are executed at compile time, so without execute immediate, the program becomes "insert and rebuild the table first" in time.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report