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’
答案 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
祝你好运。