Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Oracle 创建显式游标时未声明绑定变量*_Oracle_Plsql - Fatal编程技术网

Oracle 创建显式游标时未声明绑定变量*

Oracle 创建显式游标时未声明绑定变量*,oracle,plsql,Oracle,Plsql,尝试使用显式光标显示值,但显示以下错误 SQL>@C:\Users\91800\Desktop\explicit.SQL; SP2-0552:未声明绑定变量C_CUST 代码如下: Declare c_id customer.id %type; c_name customer.name %type; c_add customer.address %type; cursor c_cust IS select id , name , address from customers; begin ope

尝试使用显式光标显示值,但显示以下错误

SQL>@C:\Users\91800\Desktop\explicit.SQL; SP2-0552:未声明绑定变量C_CUST

代码如下:

Declare
c_id customer.id %type;
c_name customer.name %type;
c_add customer.address %type;
cursor c_cust IS select id , name , address from customers;
begin
open c_cust;
loop
    fetch c_cust into c_id , c_name , c_add;
    exit when: c_cust %not found;
    dbms_output.put_line(c_id||' '||c_name||' '||c_add);
end loop;
close c_cust;
end;
/

问题是冒号退出后的时间和其他一些小事情

请参阅内联注释:

声明 c_id customer.id%类型; c_name customer.name%类型; c_添加客户地址%类型; 光标c_cust是从客户处选择id、名称、地址;-顾客而非顾客 开始 开放式客户服务; 环 将c_cust提取到c_id、c_name、c_add中; 未找到客户%c_时退出;-删除冒号和空格 dbms|u output.put|u linec|u id | | | | c| u name | | | | c|u add; 端环; 关闭客户; 终止 / 小提琴