PL/SQL 不容易调试通过,所以以此小例子作备忘。
Declare TYPE V_Struct is record ( VTimestamp varchar2(10), VMessage varchar2(60), ); my_message V_Struct; mysql_stmt varchar2(100); BEGIN my_message.VTimestamp := ‘mytime‘; mysql_stmt :=‘INSERT INTO tab001(VTimestamp) VALUES (:1)‘; dbms_output.put_line(‘Before Executing SQL:‘); EXECUTE IMMEDIATE mysql_stmt USING my_message.VTimestamp; dbms_output.put_line(‘After Executing SQL:‘); END; /