为什么我在执行PL / SQL代码时收到编译错误?

时间:2015-10-08 02:35:55

标签: oracle plsql

create or replace PROCEDURE COMPANYEMPLOYEES 
(
  in_cname IN VARCHAR2
) AS 
  P_RESULT SYS_REFCURSOR;
BEGIN
  OPEN P_RESULT FOR
    SELECT ename, c.cid, in_cname
    FROM employee e
    JOIN company c on c.cid = e.cid 
    WHERE c.CNAME = in_cname;
  DBMS_SQL.RETURN_RESULT(P_RESULT);
END COMPANYEMPLOYEES;

执行脚本以创建sproc后,可以使用以下命令

运行此脚本
EXEC COMPANYEMPLOYEES ‘Verizon’ 

EXEC COMPANYEMPLOYEES ‘ATT’

1 个答案:

答案 0 :(得分:0)

鉴于 //leemos FileInputStream fis; ObjectInputStream ois; Alumno alumnoLeido = null; String cadena =""; JTextArea area = new JTextArea(6,1); while(true){ try { fis = new FileInputStream("alumnos.txt"); ois = new ObjectInputStream(fis); alumnoLeido = (Alumno) ois.readObject(); ois.close(); cadena = "Alumno " + alumnoLeido.getNombre() + " " + alumnoLeido.getApellido() + " vive en " + alumnoLeido.getDireccion() + " y tiene una beca de " + alumnoLeido.getBeca() + " euros \r\n"; } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } area.append(cadena); JOptionPane.showMessageDialog(null, area, "Alumnos",1); 仅在12c中可用且您使用的是版本11,我建议您将DBMS_SQL.RETURN_RESULT更改为一个功能,移除对COMPANYEMPLOYEES的调用,然后返回打开的光标:

DBMS_SQL.RETURN_RESULT

祝你好运。