zoukankan      html  css  js  c++  java
  • oracle迁移到12c的时列转行 wm_concat 报错解决

    原来的保存function

    create or replace function get_area_path_name(areaId  in number) return varchar2 is
      pathName  varchar2(1000);
    begin
      select replace(to_char(wm_concat(pathname) ),',','/') into pathName
      from (select rs.name as pathname
      from rs_area rs
      start with rs.id=areaId
      connect by  rs.id = prior rs.parent_id
      order by rs.area_type_id );
      return pathName;
    exception
      when others then
        return '';
    
    end get_area_path_name;

    修改后:

    create or replace function get_area_path_name(areaId in number)
      return varchar2 is
      pathName varchar2(1000);
    begin
      select replace(to_char(LISTAGG(pathname, ',') within
                             group(order by pathname)),
                     ',',
                     '/')
        into pathName
        from (select rs.name as pathname
                from rs_area rs
               start with rs.id = areaId
              connect by rs.id = prior rs.parent_id
               order by rs.area_type_id);
      return pathName;
    exception
      when others then
        return '';
    
    end get_area_path_name;
  • 相关阅读:
    POJ 1265 Pcik定理
    POJ 1380 坐标旋转
    POJ 1788
    POJ 3714 平面最近点对
    POJ 1905 二分
    POJ 1151 矩形面积并
    POJ 1654 多边形面积
    ZOJ 1010 判断简单多边形+求面积
    about work
    Python 打印 不换行
  • 原文地址:https://www.cnblogs.com/linhongwenBlog/p/10565790.html
Copyright © 2011-2022 走看看