CREATE OR REPLACE PROCEDURE p_ra(v_eno IN emp.EMPNO%TYPE) AS
v_sal EMP.SAL%TYPE;
BEGIN
SELECT SAL INTO v_sal FROM emp WHERE empno = v_eno;
UPDATE EMP set SAL = v_sal + 100 WHERE EMPNO = v_eno;
dbms_output.put_line('漲薪前:'||v_sal||'漲薪后:'||(v_sal + 100));
END;
v_sal EMP.SAL%TYPE;
BEGIN
SELECT SAL INTO v_sal FROM emp WHERE empno = v_eno;
UPDATE EMP set SAL = v_sal + 100 WHERE EMPNO = v_eno;
dbms_output.put_line('漲薪前:'||v_sal||'漲薪后:'||(v_sal + 100));
END;
2023-10-24
SQL> desc dbms_output;
Element Type
--------- ---------
ENABLE PROCEDURE
DISABLE PROCEDURE
PUT PROCEDURE
PUT_LINE PROCEDURE
NEW_LINE PROCEDURE
GET_LINE PROCEDURE
CHARARR TYPE
GET_LINES PROCEDURE
我查看這個(gè)包怎顯示這個(gè)啊
Element Type
--------- ---------
ENABLE PROCEDURE
DISABLE PROCEDURE
PUT PROCEDURE
PUT_LINE PROCEDURE
NEW_LINE PROCEDURE
GET_LINE PROCEDURE
CHARARR TYPE
GET_LINES PROCEDURE
我查看這個(gè)包怎顯示這個(gè)啊
2021-05-12
最新回答 / 明仔范特西
oracle和mysql里很多語(yǔ)法命令是不一樣的,這里可以寫:CREATE PROCEDURE sayhello()BEGIN SELECT 'hello,world!' as var;END;然后用CALL sayhello();調(diào)用。你可以網(wǎng)上查一下相關(guān)資料。
2020-04-07