以下是程序:
CREATE PROCEDURE show @faculty VARCHAR(20)
AS
BEGIN
SELECT *
FROM tutor
WHERE title LIKE @faculty+'%'
END
以下是程序执行:
EXEC show 'FI'
如何为SQL Developer重写此内容?
答案 0 :(得分:2)
使用Oracle 12 ,您可以执行此操作:
CREATE PROCEDURE show(p_faculty varchar)
AS
cur SYS_REFCURSOR;
BEGIN
OPEN cur FOR
SELECT *
FROM tutor
WHERE title LIKE p_faculty || '%';
DBMS_SQL.RETURN_RESULT(cur);
END;
/
然后用:
运行它exec show_x ('FI');