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. MySQL普通用户无法本地登录的解决方法及MySQL的用户认证算法

    在安装完成MySQL后,我们通常添加拥有相应权限的普通用户用来访问数据库.在使用普通用户本地登录数据库的时候,经常会出现怎么登录也无法登录的情况. 例如,我的MySQL中的用户为: mysql> ...

  2. Kettle学习之Spoon简单使用

    kettle学习之Spoon使用 2018-08-04 10:40:01 首先介绍两个博客入门: https://blog.csdn.net/zzq900503/article/details/785 ...

  3. 7-6 Bandwidth UVA140

    没有清空向量导致debug了好久 这题难以下手  不知道怎么dfs 原来是用排序函数. letter[n]=i; id[i]=n++; 用来储存与设置标记十分巧妙 for(;;) { while(s[ ...

  4. POJ 3304 Segments (叉乘判断线段相交)

    <题目链接> 题目大意: 给出一些线段,判断是存在直线,使得该直线能够经过所有的线段.. 解题思路: 如果有存在这样的直线,过投影相交区域作直线的垂线,该垂线必定与每条线段相交,问题转化为 ...

  5. 51Nod-1006【LCS】+【输出路径】模板题

    题目链接:https://vjudge.net/contest/225715#problem/B 转载于>>> 题目大意: 给出两个序列,要求输出它们的最长公共子序列. 解题思路: ...

  6. muduo网络库架构总结

    目录 muduo网络库简介 muduo网络库模块组成 Recator反应器 EventLoop的两个组件 TimerQueue定时器 Eventfd Connector和Acceptor连接器和监听器 ...

  7. IdentityServer4-前后端分离的授权验证(六)

    上两节介绍完Hybrid模式在MVC下的使用,包括验证从数据获取的User和Claim对MVC的身份授权.本节将介绍Implicit模式在JavaScript应用程序中的使用,使用Node.js+Ex ...

  8. AGC 016C.+/- Rectangle(思路 构造)

    题目链接 首先想到同样例1的构造方式.即不得不填负的格子填\(-h*w\),其余填\(1\).直接这样能过二三十个点. 只这样不对.比如1 4 1 3,会输出无解(会填[1 1 -3 1]).怎么改呢 ...

  9. struts2动态跳转action,修改和添加共用一个页面

    <s:form action="role_%{ id == null ? 'add' : 'edit' }"> <s:hidden name="id&q ...

  10. java的关键字与保留字

    1,Java 关键字列表 (依字母排序 共50组): abstract, assert, boolean, break, byte, case, catch, char, class, const(保 ...