那的需要动态SQL语句来实现:查出总共有多少个字段
然后构造SQL语句:
动态sql
str:='update table_name set col1=11'+col2+col3;
execute immediate str ;

解决方案 »

  1.   

    Oracle9i有这样的SQL语句,具体语法如下:merge into table_name as table_alias
      using (table/view/sub_query) as alias
      on (join condition)
      when matched then
        update set col1=col_val1,
        col2=col2_val
      when not matched then
        insert (column_list)
        values (column_values);
      

  2.   

    存在于A表上则更新,否则插入
    merge into table1 a
    using(select * from table2 b) 
    on (a.id=b.id) 
    when matched then 
    update set fno='old' 
    when not matched then 
    insert into values(a.id,'new');参考:
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_915a.htm#SQLRF01606