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
我查看这个包怎显示这个啊
Element Type
--------- ---------
ENABLE PROCEDURE
DISABLE PROCEDURE
PUT PROCEDURE
PUT_LINE PROCEDURE
NEW_LINE PROCEDURE
GET_LINE PROCEDURE
CHARARR TYPE
GET_LINES PROCEDURE
我查看这个包怎显示这个啊
2021-05-12
最新回答 / 明仔范特西
oracle和mysql里很多语法命令是不一样的,这里可以写:CREATE PROCEDURE sayhello()BEGIN SELECT 'hello,world!' as var;END;然后用CALL sayhello();调用。你可以网上查一下相关资料。
2020-04-07