Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.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
每次在sql存储过程中声明游标都会出现“成功但有编译错误”。我的语法错了吗?我正在使用Oracle11g 我在hr模式下运行查询。从用户错误中选择*是什么;给你什么?这通常足以找出问题所在。 CREATE OR REPLACE PROCEDURE dept_Sql_Loops_Stored Procedures_Oracle11g_Cursor - Fatal编程技术网

每次在sql存储过程中声明游标都会出现“成功但有编译错误”。我的语法错了吗?我正在使用Oracle11g 我在hr模式下运行查询。从用户错误中选择*是什么;给你什么?这通常足以找出问题所在。 CREATE OR REPLACE PROCEDURE dept

每次在sql存储过程中声明游标都会出现“成功但有编译错误”。我的语法错了吗?我正在使用Oracle11g 我在hr模式下运行查询。从用户错误中选择*是什么;给你什么?这通常足以找出问题所在。 CREATE OR REPLACE PROCEDURE dept,sql,loops,stored-procedures,oracle11g,cursor,Sql,Loops,Stored Procedures,Oracle11g,Cursor,每次在sql存储过程中声明游标都会出现“成功但有编译错误”。我的语法错了吗?我正在使用Oracle11g 我在hr模式下运行查询。从用户错误中选择*是什么;给你什么?这通常足以找出问题所在。 CREATE OR REPLACE PROCEDURE deptShow (tempCID IN VARCHAR2) IS CURSOR temp_cursor IS SELECT D.DEPARTMENT_ID dept_id, D.DEPARTMENT_NAME dept_name FROM DEP

每次在sql存储过程中声明游标都会出现“成功但有编译错误”。我的语法错了吗?我正在使用Oracle11g
我在hr模式下运行查询。从用户错误中选择*是什么;给你什么?这通常足以找出问题所在。
CREATE OR REPLACE PROCEDURE deptShow (tempCID IN VARCHAR2) IS

CURSOR temp_cursor IS SELECT D.DEPARTMENT_ID dept_id, D.DEPARTMENT_NAME dept_name

FROM DEPARTMENTS D
JOIN LOCATIONS L ON (D.LOCATION_ID=L.LOCATION_ID)
JOIN COUNTRIES C ON (L.COUNTRY_ID=C.COUNTRY_ID)

WHERE C.COUNTRY_ID=tempCID;



BEGIN

FOR temp_row IN temp_cursor 

    LOOP
    DBMS_OUTPUT.PUT_LINE(temp_row.dept_id||temp_row.dept_name);
    END LOOP;


END;