If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > oracle output

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-20-04, 09:01
subwrc subwrc is offline
Registered User
 
Join Date: Jan 2004
Location: Greece
Posts: 23
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 09:04.
Reply With Quote
  #2 (permalink)  
Old 01-22-04, 00:10
Rushi Rushi is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On