Results 1 to 2 of 2

Thread: oracle output

  1. #1
    Join Date
    Jan 2004
    Location
    Greece
    Posts
    23

    Unanswered: 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.
    Last edited by subwrc; 01-20-04 at 10:04.

  2. #2
    Join Date
    Jan 2004
    Location
    India
    Posts
    62
    Set serveroutput is ON is generally used in PL/SQL to print messages on screen.
    U can use printf statement to display messages in Pro*C program.
    Regards,

    Rushi

Posting Permissions

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