Home » SQL & PL/SQL » SQL & PL/SQL » DBMS_OUTPUT package and "set serveroutput on" command
DBMS_OUTPUT package and "set serveroutput on" command [message #302182] Sun, 24 February 2008 14:20 Go to next message
batitou81
Messages: 11
Registered: February 2008
Junior Member

hi everybody
my name is Baptiste, I'm a french student and I'm interested about Oracle Technologies.
Now, I have a problem.
I want to create a trigger, and when a user logon, "SET SERVEROUTPUT ON" command must be activate.
So how can I do that?
I have made some search about the dbms_output package, but I don't found anything intersting for my request.
Is anyone can help me ?
Thanks!
Re: DBMS_OUTPUT package and "set serveroutput on" command [message #302183 is a reply to message #302182] Sun, 24 February 2008 14:33 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
>I want to create a trigger, and when a user logon, "SET SERVEROUTPUT ON" command must be activate.
Forgive me, but this makes NO sense.

>"SET SERVEROUTPUT ON"
Above is a SQL*Plus command; which does not come into play inside a trigger.

A trigger runs deep inside the database engine & has no direct way to "talk" to the user invoking the trigger.

[Updated on: Sun, 24 February 2008 14:33] by Moderator

Report message to a moderator

Re: DBMS_OUTPUT package and "set serveroutput on" command [message #302188 is a reply to message #302183] Sun, 24 February 2008 15:32 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Perhaps LOGIN.SQL (or even GLOGIN.SQL) is what you are looking for. This file will let you set some initial settings.
Re: DBMS_OUTPUT package and "set serveroutput on" command [message #302191 is a reply to message #302183] Sun, 24 February 2008 16:17 Go to previous messageGo to next message
batitou81
Messages: 11
Registered: February 2008
Junior Member

anacedent wrote on Sun, 24 February 2008 14:33
>I want to create a trigger, and when a user logon, "SET SERVEROUTPUT ON" command must be activate.
Forgive me, but this makes NO sense

Scuse me...
In fact, I use iSQLplus, and when I build a PL/SQL request with
"dbms_output.put_line", I'm oblige to add: set serveroutput ON.
Now, I want that this command "set serveroutput on" will be automaticaly made when an user log on.
So, I must to use a trigger.
does it make any sense?
Re: DBMS_OUTPUT package and "set serveroutput on" command [message #302192 is a reply to message #302188] Sun, 24 February 2008 16:19 Go to previous messageGo to next message
batitou81
Messages: 11
Registered: February 2008
Junior Member

Littlefoot wrote on Sun, 24 February 2008 15:32
Perhaps LOGIN.SQL (or even GLOGIN.SQL) is what you are looking for. This file will let you set some initial settings.

Thank you, I'll search by this way.
Re: DBMS_OUTPUT package and "set serveroutput on" command [message #302193 is a reply to message #302182] Sun, 24 February 2008 16:30 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
batitou81,

You don't say from where, how, or what the "user" actually does to initiate the logon trigger.

How or why do you expect this user to be able to see the results of the DBMS_OUTPUT in any case?

Another way of asking the same question is how will Oracle know where to "pop the output string" so that it is visible to every user logging into the database?

Have A Nice Day (HAND)!
Re: DBMS_OUTPUT package and "set serveroutput on" command [message #302196 is a reply to message #302193] Sun, 24 February 2008 16:40 Go to previous messageGo to next message
batitou81
Messages: 11
Registered: February 2008
Junior Member

I want to use a trigger because sometimes, I forget to do " set serveroutput on", so with this trigger, don't worry about that.
My trigger looks like that:
CREATE TRIGGER log_on
AFTER LOGON
"My command to the dbms_output package"
...

Do you know what I mean ?
Re: DBMS_OUTPUT package and "set serveroutput on" command [message #302197 is a reply to message #302182] Sun, 24 February 2008 16:52 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
see previously posted solution by Littlefoot.

Re: DBMS_OUTPUT package and "set serveroutput on" command [message #302188 is a reply to message #302183 ] Sun, 24 February 2008 13:32
Littlefoot
Messages: 4883


Re: DBMS_OUTPUT package and "set serveroutput on" command [message #302198 is a reply to message #302197] Sun, 24 February 2008 16:54 Go to previous message
batitou81
Messages: 11
Registered: February 2008
Junior Member

Ok, I'm searching this file in my db... Thanks!
Previous Topic: How to create a single query with joins using these two below mentioned tables
Next Topic: table deadlock
Goto Forum:
  


Current Time: Sat Dec 03 07:59:17 CST 2016

Total time taken to generate the page: 0.09757 seconds