1. if the procedure has only simple input parameters, we can run it simply in Toad SQL Edit window.
a. select * from dhcp_server_ip where lower_ip 171114500;
b. select ptdb_pkg.convert_ip(‘10.33.00.04’) from dual;
c. select ptdb_pkg.convert_ip(‘10.51.0.04’) from dual;
2. This is how to call it from Sqlplus and with output variables as input parameters.
——————————————————————————————–
SET SERVEROUTPUT ON
DECLARE
err_code NUMBER(9);
err_reason varchar2 (50);
dhcp_server_ip varchar2 (50);
device_type varchar2 (50);
i_ip varchar2 (50);
BEGIN
i_ip :=’192.168.28.18′;
DBMS_OUTPUT.ENABLE(1000000);
ptdb_pkg.get_dhcp_server_ip (
err_code,
err_reason,
dhcp_server_ip,
device_type,
i_ip
);
DBMS_OUTPUT.PUT_LINE(‘ERROR: ‘ || err_code || ‘ ‘ || err_reason );
DBMS_OUTPUT.PUT_LINE(‘i_ip: ‘ || i_ip );
DBMS_OUTPUT.PUT_LINE(‘dhcp_server_ip: ‘ || dhcp_server_ip );
DBMS_OUTPUT.PUT_LINE(‘device_type: ‘ || device_type );
END;
/
——————————————————————————————–
3. to use escape in like statement:
a. in sqlplus: run “show all” or “show escape” or “set escape on” to make sure that escape is turned on.
Then, run “select * from TABLE where nm like ‘%abc\_%’;”
b. in TOAD, run “select * from TABLE where nm like ‘%bpm\_%’ escape ‘\’;