在SQL中調用的 function, 參數一定要是數據庫的類型, 不能用 PL/SQL 類型. 還有, 只能用 IN 參數, 不能用 OUT.
------------
以前看的资料。
------------
以前看的资料。
解决方案 »
- ORACLE,小弟求助!
- ORACLE从9i迁移至10G后,查询比原来9i慢了N倍,请问怎么解决
- 目前我想用vb.net做一个客户端应用软件,但是要求通过web services 去读取oracle数据库的数据,我想问该web servises 该怎样搭建.
- rownum的疑惑
- 请问在ORCL中如何将一张表的一列数据赋值到另一个表里
- 安装 oracle9i database 9.2.0.1.0(92010NT)时出错!?
- 有关全局名的问题--在线等
- 各位大侠是否DBMS_OUTPUT.put_line一行只能输出255个字符?怎样实现将一个大约有3000个字符的varchar2变量输出(里面存的是个SQL)?
- 关于o9i的用户管理!!!
- pl/sql写文件的问题!utl_file.fopen创建文件总是失败,说是目录无效。
- 怎样向表中插入number?
- 问个简单的问题
select Szqs('3','4') from Wq_Wqsinf_b;
改成
tempVar=Szqs('3','4');
open CUR_OUT for
select tempVar from Wq_Wqsinf_b;(tempVar是声明varchar2的变量)
Cause: A proscribed function was used in a SQL statement. Certain functions
such as SQLCODE and SQLERRM can be used only in procedural statements.
Action: Remove the function call from the SQL statement. Or, replace the
function call with a local variable. For example, the following statement is
illegal:
INSERT INTO errors VALUES (SQLCODE, SQLERRM);
However, you can assign the values of SQLCODE and SQLERRM to local
variables, then use the variables in the SQL statement, as follows:
err_num := SQLCODE;
err_msg := SQLERRM;
INSERT INTO errors VALUES (err_num, err_msg);
关键是procedure getPjtjxxList(CUR_OUT OUT cur_OUT),这里cur_out是什么东西,如果这样写,则必须在oracle中定义这个类型,或者你这个过程是一个包中过程,你已经在包中定义了cur_out.
给你一个最为简单的例子。create or replace function f_sex(a in integer,b in integer)
return integer
is
begin
return power(a,b);
end;create or replace procedure p_outcur(r out sys_refcursor)
is
rs sys_refcursor;
begin
open rs for select f_sex(2,rownum) from tab;
r:=rs;
end;-- Created on 2006-7-26
declare
r sys_refcursor;
tn tab.tname%type;
begin
-- Test statements here
p_outcur(r);
fetch r into tn;
while (r%found) loop
dbms_output.put_line(tn);
fetch r into tn;
end loop;
close r;
end;------
注释:sys_refcursor是9i2种存在的系统已经定义的类型,我不知道9i1以下(包括9i1)有没有