The stored procedure is written in Oracle10, with the following code:
CREATE OR REPLACE ProcedureProc_insert (SNameinch varchar2, SAgeinch int, Sexetimeinch varchar2) is begin Insert intot_test (c_id, C_name, C_age, C_intime, C_exetime)Values(T_test_cid.nextval,sname,sage, Sysdate, To_date (Sexetime,'YYYY-MM-DD'));EndProc_insert;
In order to invoke this stored procedure in PL/SQL, the following code is used:
begin Proc_insert ('hello6',+,'2005-12-24 ') ); Commit ; End;
In addition, a stored procedure is added, but Sexetime is a date type, and when called, the string must first be converted to the date type, otherwise the call will fail.
Stored procedures:
CREATE OR REPLACE ProcedureProc_insert2 (SNameinch varchar2, SAgeinch int, Sexetimeinchdate) is begin Insert intot_test (c_id, C_name, C_age, C_intime, C_exetime)Values(T_test_cid.nextval,sname,sage, Sysdate, sexetime);EndProc_insert2;
Code to invoke:
begin Proc_insert2 ('hellowhat', to_date ('2010-10-20 ' ' YYYY-MM-DD ' )); Commit ; End;
Go: Call a stored procedure in PL/SQL--oracle
Calling a stored procedure in PL/SQL--oracle