I 'm using Pro*C and have the following part in my code
EXEC SQL SAVEPOINT do_insert;
..............................
.............
EXEC SQL EXECUTE
BEGIN
INSERT INTO OWNER VALUES(:id_idn,:id_nam,:id_fnam,:id_cit);
COMMIT;
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
DBMS_OUTPUT.PUT_LINE(id number' || TO_CHAR(:id_idn) || 'allready exists' );
ROLLBACK TO do_insert;
END;
END-EXEC;
...............
.......
It works fine without errors but when the exception is raised it doesn't print the message in monitor while rollback works.So i think it's the SET SERVEROUTPUT ON thing tha i must use.But how can i use it inside Pro*c?I 'm on a Solaris system and if i enter sqlplus ,SET SERVEROUTPUT ON and quit the next time that i will enter it will be off.