RE: dbms_system - set a string parameter in another session?

  • From: "Dunbar, Norman" <norman.dunbar@xxxxxxxxxxxxxxxxxxxxxxxxx>
  • To: "ORACLE-L" <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 1 Mar 2010 09:21:44 -0000

Morning all,

>> That string parameters can have "variable width."  is 
>> actually, in my 
>> opinion, a strong enough reason for Oracle to not provide or 
>> not even 
>> attempt to provide a SET command for parameters in other sessions.

I disagree! 

However in my defence, I claim ignorance of how Oracle does things
internally, but I'm almost 100% certain plain C is used, so, to change a
string parameter would be as [simple as] follows:

char *new_string = new [maximum_parameter_size] char;
if (new_string) {
  strncpy(new_string, input_buffer, maximum_parameter_size);
  char *temp_string = old_string;
  get_a_latch();
  old_string = new_string
  free_latch();
  delete [] temp_string;
} else {
  report_error(...);
}

Apologies for syntax etc, but the above looks simple to me :

Allocate room for the new string, read it into the allocated area from
the input buffer, get the address of the buffer holding the old value,
grab a latch, replace the old buffer pointer with the new one, free the
latch, delete the storage allocated for the old value. Job done.


Cheers,
Norman.


Information in this message may be confidential and may be legally privileged. 
If you have received this message by mistake, please notify the sender 
immediately, delete it and do not copy it to anyone else.   We have checked 
this email and its attachments for viruses. But you should still check any 
attachment before opening it. We may have to make this message and any reply to 
it public if asked to under the Freedom of Information Act, Data Protection Act 
or for litigation.  Email messages and attachments sent to or from any 
Environment Agency address may also be accessed by someone other than the 
sender or recipient, for business purposes.  If we have sent you information 
and you wish to use it please read our terms and conditions which you can get 
by calling us on 08708 506 506.  Find out more about the Environment Agency at 
www.environment-agency.gov.uk

Information in this message may be confidential and may be legally privileged. 
If you have received this message by mistake, please notify the sender 
immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should 
still check any attachment before opening it.
We may have to make this message and any reply to it public if asked to under 
the Freedom of Information Act, Data Protection Act or for litigation.  Email 
messages and attachments sent to or from any Environment Agency address may 
also be accessed by someone other than the sender or recipient, for business 
purposes.

If we have sent you information and you wish to use it please read our terms 
and conditions which you can get by calling us on 08708 506 506.  Find out more 
about the Environment Agency at www.environment-agency.gov.uk
--
//www.freelists.org/webpage/oracle-l


Other related posts: