I am using ORACLE 10g & PHP codeigniter for my application. I have a procedure defined like this:-
CREATE OR REPLACE PROCEDURE
insertMovie (id IN NUMBER, title IN VARCHAR2,
sdate IN DATE, edate IN DATE,
image IN VARCHAR2, add_date IN DATE,
message OUT NUMBER)
AS
BEGIN
INSERT INTO tbl_movie (movie_id, movie_title, movie_sdate, movie_edate, movie_image, movie_add_date)
VALUES ( id, 'title', to_date('sdate', 'yyyy-mm-dd hh24:mi:ss'), to_date('edate', 'yyyy-mm-dd hh24:mi:ss'), 'movie_image', to_date('add_date', 'yyyy-mm-dd hh24:mi:ss'));
message:= 1;
END;
/
Now, I want a if condition to return either 1 or 0. If insert will be successful, message will be 1. If insert fails. message will be 0.
How can I do that?