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. #1 // BZOJ 4361 isn

    Description 给出一个长度为n的序列A(A1,A2...AN).如果序列A不是非降的,你必须从中删去一个数, 这一操作,直到A非降为止.求有多少种不同的操作方案,答案模10^9+7.   题 ...

  2. Cpu 常见系列以及型号

    Intel旗下 赛扬(Celeron)——桌面低端 奔腾(Pentium)—— 桌面中端 酷睿 (Core)——桌面高端 至强(Xeon)——服务器中端 安腾(Itanium)——服务器高端 凌动(A ...

  3. P2031 脑力达人之分割字串

    P2031 脑力达人之分割字串字符串dp,f[i]表示主串到第i个字符,最多能分割成多少子串.f[i]=max(f[i],f[k]+1);k是能匹配到的前一位. #include<iostrea ...

  4. Python常用模块--json

    官方解释: JSON(JavaScript Object Notation)是一种轻量级的数据交换格式.人类很容易读写.机器很容易解析和生成.它基于 JavaScript编程语言的一部分, 标准ECM ...

  5. BZOJ.3693.圆桌会议(Hall定理 线段树)

    题目链接 先考虑链.题目相当于求是否存在完备匹配.那么由Hall定理,对于任意一个区间[L,R],都要满足[li,ri]完全在[L,R]中的ai之和sum小于等于总位置数,即R-L+1.(其实用不到H ...

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

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

  7. 添加 vip

    两台机器:172.16.91.101 172.16.91.107 在91.101上增加虚拟ip,92网段的 ifconfig eth0:1 172.16.92.2 netmask 255.255.25 ...

  8. Linux.Centos安装scp反复失败的解决方式

    现象 在A服务器用scp命令从B服务器拉文件时, 报找不到scp指令的错误 在A服务器运行 scp --help 发现是有指令的 在B服务器上 常规方式, 安装openssh-clients yum ...

  9. 用spring boot 2从零开始创建区块链

    区块链这么火的技术,大java怎能落后,所以有了本文,主要代码参考自 Learn Blockchains by Building One , 中文翻译:用Python从零开始创建区块链 . 一.区块链 ...

  10. .net core 3.0视图动态编译

    之前在使用Visual Studio 2019的时候,就发现asp.net 3.0中没有cshtml动态编译的功能了:也就是说,如果改了cshtml,刷新页面不会立即生效,而是要重新编译一次才行. 这 ...