Warning: Function created with compilation errors.
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.的更多相关文章
- Warning: Function created with compilation errors!
解决方案: sqlplus / as sysdba grant execute on UTL_I18N to scott; grant execute on DBMS_CRYPTO to scott;
- oracle 存储过程创建报错 Procedure created with compilation errors
出现这错误的话,存储过程还是会成功创建的,创建好后再逐个打开查找存储过程的问题 问题:基本上就是存储过程里面的表不存在,dblink 不存在 ,用户名.xx表 要么用户名不存在要么表不存在 创 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- CodeForces 519B A and B and Compilation Errors【模拟】
题目意思还是蛮简单的,看 输入数据输出数据还是比较明显的 我用排序来写还是可以AC的 //#pragma comment(linker, "/STACK:16777216") // ...
- 【Henu ACM Round#15 B】A and B and Compilation Errors
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 开3个map, 存在map里面: 然后迭代第一个和第二个map; 分别与第二个和第三个map比较就可以了 [代码] #include ...
- CodeForces 519B A and B and Compilation Errors (超水题)
这道题是超级水的,在博客上看有的人把这道题写的很麻烦. 用 Python 的话是超级的好写,这里就奉上 C/C++ 的AC. 代码如下: #include <cstdio> #includ ...
随机推荐
- php事务回滚
<?php $mysqli = new mysqli("127.0.0.1","root","111111","test&q ...
- LR报错Error -27780: [GENERAL_MSG_CAT_SSL_ERROR]connect to host "XXX.XXX.com" failed解决方法
- Mac上c语言连接mysql遇到的问题
参照<Beginning Linux Programming>上的例程写了一个连接mysql的c语言小程序connect1.c.但是按照书上的编译命令无法编译.然后经过查阅资料解决了问题. ...
- java里获取uuid
//获取32位uuid工具类 ,此类事java自带的,不需要导包public static String get32UUID() { String uuid = UUID.randomUUID().t ...
- 【Java】 剑指offer(59-1) 滑动窗口的最大值
本文参考自<剑指offer>一书,代码采用Java语言. 更多:<剑指Offer>Java实现合集 题目 给定一个数组和滑动窗口的大小,请找出所有滑动窗口里的最大值.例 ...
- 015 在Spark中关于groupByKey与reduceByKey的区别
1.groupByKey的源代码 2.groupByKey的使用缺点 不使用groupByKey的主要原因:在大规模的数据下,数据分布不均匀的情况下,可能导致OOM 3.reduceByKey的源代码 ...
- Clion 常用快捷键
clion 快捷键 CTRL+ALT+I 自动缩进 查询快捷键CTRL+N 查找类CTRL+SHIFT+N 查找文件CTRL+SHIFT+ALT+N 查 找类中的方法或变量CIRL+B 找 ...
- TNS:listener does not currently know of service requested in connect descriptor错误改正
(SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = E:\oracle\product\10.2.0\db_1) (PR ...
- How to cast List<Object> to List<MyClass> Object集合转换成实体集合
List<Object> list = getList(); return (List<Customer>) list; Compiler says: cannot cast ...
- PHP给图片加水印
<?php /** *图片加水印 *@param $srcImg 原图 *@param $waterImg 水印图片 *@param $savepath 保存路径 *@param $savena ...