0
我能使用條款,同時使用光標我可以用子句中使用,同時打開遊標
OPEN CURSOR_NAME FOR
WITH view1 as (Select v_name from tablename),
view2 as (Select p_name from tablename2)
Select * from view1, view2;
我能使用條款,同時使用光標我可以用子句中使用,同時打開遊標
OPEN CURSOR_NAME FOR
WITH view1 as (Select v_name from tablename),
view2 as (Select p_name from tablename2)
Select * from view1, view2;
是的,它可以使用with
子句中光標。檢查下面的例子。
DECLARE
l_cur sys_refcursor;
l_val VARCHAR2 (1000);
BEGIN
DBMS_OUTPUT.ENABLE;
OPEN l_cur FOR
WITH tab AS
(SELECT 'hello'
FROM DUAL)
SELECT *
FROM tab;
FETCH l_cur
INTO l_val;
CLOSE l_cur;
DBMS_OUTPUT.put_line (l_val);
END;
輸出:hello
謝謝..他現在工作。 – Vimal
您是否嘗試過?另外,請考慮切換到ANSI連接語法。 – Aleksej