SQL> create or replace function
2 remove_constants(p_query in varchar2) return varchar2
3 as
4 l_query long;
5 l_char varchar2(1);
6 l_in_quotes boolean default FLASE;
7 begin
8 for i in 1..length(p_query)
9 loop
10 l_char :=substr(p_query,i,1);
11 if(l_char='''' and l_in_quotes)
12 then
13 l_in_quotes := FALSE;
14 elsif(l_char='''' and not l_in_quotes)
15 then
16 l_in_quotes := TRUE;
17 l_query := l_query || '''#';
18 end if;
19 if(not l_in_quotes)
20 then
21 l_query := l_query || l_char;
22 end if;
23 end loop;
24
25 l_query := translate(l_query,'0123456789','@@@@@@@@@@');
26 for i in 0..8
27 loop
28 l_query := replace(l_query,lpad('@',10-i,'@'),'@');
29 l_query := replace(l_query, lpad(' ',10-i,' '),' ');
30 end loop;
31 return upper(l_query);
32 end;
33 / Warning: Function created with compilation errors. SQL>

  

查看并解决:

SQL> show errors
Errors for FUNCTION REMOVE_CONSTANTS: LINE/COL ERROR
-------- -----------------------------------------------------------------
6/14 PL/SQL: Item ignored
6/30 PLS-00201: identifier 'FLASE' must be declared #这里看出写错单词了
11/3 PL/SQL: Statement ignored
11/22 PLS-00320: the declaration of the type of this expression is
incomplete or malformed 19/3 PL/SQL: Statement ignored
19/10 PLS-00320: the declaration of the type of this expression is
incomplete or malformed SQL> create or replace function
2 remove_constants(p_query in varchar2) return varchar2
3 as
4 l_query long;
5 l_char varchar2(1);
6 l_in_quotes boolean default FALSE;
7 begin
8 for i in 1..length(p_query)
9 loop
10 l_char :=substr(p_query,i,1);
11 if(l_char='''' and l_in_quotes)
12 then
13 l_in_quotes := FALSE;
14 elsif(l_char='''' and not l_in_quotes)
15 then
16 l_in_quotes := TRUE;
17 l_query := l_query || '''#';
18 end if;
19 if(not l_in_quotes)
20 then
21 l_query := l_query || l_char;
22 end if;
23 end loop;
24
25 l_query := translate(l_query,'0123456789','@@@@@@@@@@');
26 for i in 0..8
27 loop
28 l_query := replace(l_query,lpad('@',10-i,'@'),'@');
29 l_query := replace(l_query, lpad(' ',10-i,' '),' ');
30 end loop;
31 return upper(l_query);
32 end;
33 / Function created. SQL>

  

Warning: Function created with compilation errors.的更多相关文章

  1. Warning: Function created with compilation errors!

    解决方案: sqlplus / as sysdba grant execute on UTL_I18N to scott; grant execute on DBMS_CRYPTO to scott;

  2. oracle 存储过程创建报错 Procedure created with compilation errors

    出现这错误的话,存储过程还是会成功创建的,创建好后再逐个打开查找存储过程的问题 问题:基本上就是存储过程里面的表不存在,dblink 不存在    ,用户名.xx表  要么用户名不存在要么表不存在 创 ...

  3. CodeForces 519B A and B and Compilation Errors

    B. A and B and Compilation Errors time limit per test 2 seconds memory limit per test 256 megabytes ...

  4. CF A and B and Compilation Errors (排序)

    A and B and Compilation Errors time limit per test 2 seconds memory limit per test 256 megabytes inp ...

  5. Codeforces Round #294 (Div. 2)B - A and B and Compilation Errors 水题

    B. A and B and Compilation Errors time limit per test 2 seconds memory limit per test 256 megabytes ...

  6. Codeforce 519B - A and B and Compilation Errors

    A and B are preparing themselves for programming contests. B loves to debug his code. But before he ...

  7. CodeForces 519B A and B and Compilation Errors【模拟】

    题目意思还是蛮简单的,看 输入数据输出数据还是比较明显的 我用排序来写还是可以AC的 //#pragma comment(linker, "/STACK:16777216") // ...

  8. 【Henu ACM Round#15 B】A and B and Compilation Errors

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 开3个map, 存在map里面: 然后迭代第一个和第二个map; 分别与第二个和第三个map比较就可以了 [代码] #include ...

  9. CodeForces 519B A and B and Compilation Errors (超水题)

    这道题是超级水的,在博客上看有的人把这道题写的很麻烦. 用 Python 的话是超级的好写,这里就奉上 C/C++ 的AC. 代码如下: #include <cstdio> #includ ...

随机推荐

  1. 【BZOJ4773】负环 [SPFA][二分]

    负环 Time Limit: 100 Sec  Memory Limit: 256 MB[Submit][Status][Discuss] Description 在忘记考虑负环之后,黎瑟的算法又出错 ...

  2. 记录weiye项目上线遇到的一些问题

    1.使用vpn访问客户内网 参考:http://jingyan.baidu.com/article/a3f121e4f9903cfc9052bb0b.html 2.设置使用ip地址直接访问项目(之后可 ...

  3. Python 模块介绍

    一.模块:用一坨代码实现了某个功能的代码集合. 二.模块分为三种 1.自定义模块 2.内置标准模块(又称标准库) 3.开源模块(上传方式,百度PyPi) 开源模块安装方式: a.yum b.pip c ...

  4. BZOJ1030 [JSOI2007]文本生成器 AC自动机 动态规划

    欢迎访问~原文出处——博客园-zhouzhendong 去博客园看该题解 题目传送门 - BZOJ1030 题意概括 给出n个模式串,问长度为m的串中有多少个至少含有这n个模式串中的任意一个. 注意, ...

  5. 003 关于shell基础,大数据的前期准备

    一:正则表达式 1.通配符与正则表达式的区别 通配符有 *,?,[]. 区别: 通配符用来匹配文件名 正则表达式是为了匹配字符串 2.“.*”的意思 .:任意字符 *:匹配前一个字符任意次 3.过滤出 ...

  6. FastAdmin 的 CRUD 不支持层级模型

    FastAdmin  的 CRUD 可以快速生成控制器,模型和前端文件. 群里有人试了这个命令: php think crud -t departmant -c auth/departmant -m ...

  7. 001.LVS简介及算法

    一 LVS简介 1.1 LVS介绍 LVS是linux virtual server的简写linux虚拟服务器,是一个虚拟的服务器集群系统,可以再unix/linux平台下实现负载均衡集群功能. 使用 ...

  8. vue 解决双向绑定中 父组件传值给子组件后 父组件值也跟着变化的问题

    说明: 近日开发中碰见一个很诡异的问题,  父组件动态的修改对象 data 中的值, 然后将这个对象 data 传给子组件, 子组件拿到后将 data 中的值 乘以 100 ,发现父组件中的值也跟着变 ...

  9. python 列表返回重复数据的下标

    class Solution(object): def searchRange(self, nums, target): """ :type nums: List[int ...

  10. beta到production版本上线

    1.beta版本到production上线,production要发到预发布测试一下避免配置问题导致发布异常.