Problem: execute a piece of code to reverse a string, which is to execute multiple SQL statements. How to make it pass in Oracle. I want to think about dynamic SQL. execute immediate is a syntax for parsing and Executing standard SQL statements. You only need to format the statement to be executed in this string. For example, the strings of Multiple SQL statements to be executed are:
Delete tableA where Aid = 1; update tableB where Bid = 2; insert into tableC values (id, 3,4 );
An SQL statement like this cannot be executed together. It is okay to add some formatting points,
To do this, begin execute immediate 'delete tableA where Aid = 1'; execute immediate 'Update tableB where Bid = 2'; execute immediate 'insert into tableC values (id, 3, 4 )'; END;
Note that you must write the format, such as the semicolon after END. In this way, you can execute this string in ORACLE.