回覆列表
  • 1 # 使用者8733619283313

    可以使用 execute immediate--FYI--execute immediate不支援多行返回,如果需要可新建臨時表declare v_source_sql varchar2(1000);v_union_sql varchar2(1000);beginselect column_name into v_source_sql from table_name ;--get source sqlv_union_sql="select * from tablename2,("||v_source_sql ||") h where ......";--sql str-- 之前先建立好所需欄位的temp_tableexecute immediate("insert into temp_table "||v_union_sql );--在臨時表中就是你所需要的資料。exception ......--如果只是需要返回單行資料,則可將execute immediate嵌入在sql中使用--execute immediate str into parameter1 ,parmeter2...--返回引數where column=:parameter....條件引數---我說的很仔細吧:) 今天心情好end;

  • 中秋節和大豐收的關聯?
  • 毛不易血型?