Home » SQL & PL/SQL » SQL & PL/SQL » dbms_output.put_line synchronize (Oracle Database 19c Enterprise Edition Release 19.0.0.0.0)
dbms_output.put_line synchronize [message #681672] Fri, 14 August 2020 08:02 Go to next message
wtolentino
Messages: 333
Registered: March 2005
Senior Member
i have this pl/sql code that takes long to complete. it is writing it's output thru dbms_output.put_line by spool to a file. since the code takes long to complete it wouldn't write anything yet to the file until it finish. is there a way that every time the dbms_outout.put_line executes it will write right away to the file? so that i will know from time to time what is going on while the pl/sql code executes.

i know there is another way by using UTL_FILE but i can't use it because i don't have access to the database server.

thanks,
warren

[Updated on: Fri, 14 August 2020 09:46]

Report message to a moderator

Re: dbms_output.put_line synchronize [message #681673 is a reply to message #681672] Fri, 14 August 2020 10:14 Go to previous messageGo to next message
Michel Cadot
Messages: 67851
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

dbms_output writes into a buffer, the client reads (and displays) this buffer when the PL/SQL call is completed.

The other ways are:
- utl_file
- write a row in a table using an autonomous transaction procedure
- dbms_debug

Re: dbms_output.put_line synchronize [message #681674 is a reply to message #681672] Fri, 14 August 2020 11:17 Go to previous messageGo to next message
Solomon Yakobson
Messages: 3055
Registered: January 2010
Location: Connecticut, USA
Senior Member
In addition to what Michel listed you could write some limited (up to 64 bytes) info using DBMS_APPLICATION_INFO.SET_CLIENT_INFO.

SY.
Re: dbms_output.put_line synchronize [message #681675 is a reply to message #681674] Fri, 14 August 2020 13:14 Go to previous messageGo to next message
wtolentino
Messages: 333
Registered: March 2005
Senior Member
thanks michael and solomon.
Re: dbms_output.put_line synchronize [message #681676 is a reply to message #681674] Fri, 14 August 2020 13:15 Go to previous message
Michel Cadot
Messages: 67851
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Yes, a very good way, how could I forget it when I used it so much times, I even wrote an article about that (it was in 2006, unfortunately in French, the title was (translated) "The DBMS_APPLICATION_INFO package or how to know what my application is doing")!

Previous Topic: min / max date of grouped status of a values ? (merged)
Next Topic: regexp_substr fix string unable to handle.
Goto Forum:
  


Current Time: Mon May 17 22:51:21 CDT 2021