欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

oracle long to char转换(oracle 11g 10g)

程序员文章站 2022-03-29 20:24:42
### Code ReferenceURL:https://blog.csdn.net/paul50060049/article/details/78811957DESC:oracle long to char转换(oracle 11g 10g)Last Update:2020-7-17 22:00Time:2020-7-17 22:00 Tittle:标题Version:001oracle long to char转换(oracle 11g 10g) -- 验证long to ch...

### Code Reference
  • URL:https://blog.csdn.net/paul50060049/article/details/78811957
  • DESC:oracle long to char转换(oracle 11g 10g)
  • Last Update:2020-7-17 22:00
  • Time:2020-7-17 22:00 Tittle:oracle long to char转换(oracle 11g 10g)
  • Version:001
    • oracle long to char转换(oracle 11g 10g)

        -- 验证long to char
        select a.column_name,
               b.constraint_name,
               b.constraint_type,
               instr(fun_long2char(b.constraint_name, a.owner), ' IS NOT NULL')
          from dba_cons_columns a, dba_constraints b
         where a.constraint_name = b.constraint_name
           and a.owner = b.owner
           and b.constraint_type in ('P', 'R', 'U', 'C', 'V', 'O', 'H', 'F', 'S')
           and instr(fun_long2char(b.constraint_name, a.owner), ' IS NOT NULL') = 0
        -- 转化方法
        create or replace function fun_long2char(pv_constraintname in varchar2,
                                                 pv_owner          in varchar2)
          return varchar2 as
          lv_text varchar2(32000);
        begin
          select search_condition
            into lv_text
            from dba_constraints t
           where upper(t.constraint_name) = upper(pv_constraintname)
             and upper(t.owner) = upper(pv_owner);
          lv_text := substr(nvl(lv_text, ''), 1, 500);
          return lv_text;
        end fun_long2char;
      

本文地址:https://blog.csdn.net/u011078141/article/details/107418843

相关标签: oracle