DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: oracle output

  1. #1
    Join Date
    Jan 2004
    Posts
    1

    oracle output

    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.

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    SET SERVEROUTPUT ON is a SQL*Plus configuration command, that allows it to receive messages from the server. It applies to the SQL*Plus application only, andpersists until the app is closed. It would have no affect on the Pro*C application, nor the server itself.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width