# Region Extract Function
String soraconnection = "Data Source = sh2.chs. cyw.rik. com; persist Security info = true; user id = Doc; Password = ***; Unicode = true ";
/// <Summary>
/// Method 2 for retrieving a function from a table
/// </Summary>
Private Void Connecctoraclefunctiontwo ()
{
Oracleconnection occonnection = New Oracleconnection (soraconnection );
Oraclecommand occommand = Occonnection. createcommand ();
Occommand. commandtext = " Doc. get_dm_object " ;
Occommand. commandtype = Commandtype. storedprocedure;
Occommand. Parameters. Add ("V_id", Oracletype. number );
// Note: The name must be consistent with that in PLSQL; otherwise, it is incorrect.
// Value of the number of incoming records
Occommand. Parameters [ " V_id " ]. Value = 83 ;
Occommand. Parameters [ " V_id " ]. Direction = Parameterdirection. input;
Occommand. Parameters. Add ("V_name", Oracletype. varchar,200);
Occommand. Parameters ["V_name"]. Direction=Parameterdirection. returnvalue;
Try
{
Occonnection. open ();
Occommand. executeoraclescalar ();
String Strret = Occommand. Parameters [ " V_name " ]. Value. tostring ();
RTB. Text = Strret;
}
Catch (Exception ex)
{
ThrowEx;
}
}
/// <Summary>
/// Method 1 for retrieving a function from a table
/// </Summary>
Private Void Conneoracleoraclefunctionone ()
{
Oracleconnection occonnection = New Oracleconnection (soraconnection );
Oraclecommand occommand = Occonnection. createcommand ();
Occommand. commandtext = " Select Doc. get_dm_object (: dob_id) from dm_object " ;
Occommand. Parameters. Add ( " Dob_id " , Oracletype. number );
// Value of the number of incoming records
Occommand. Parameters [ " Dob_id " ]. Value = 83 ;
Occommand. Parameters [ " Dob_id " ]. Direction = Parameterdirection. input;
Try
{
Occonnection. open ();
String Strret = Occommand. executeoraclescalar (). tostring ();
RTB. Text = Strret;
}
Catch (Exception ex)
{
ThrowEx;
}
}
# Endregion
/* Function used by the consumer
* Create or replace function get_dm_object (v_id dm_object.id % type)
* Return dm_object.name % Type
*
* V_name dm_object.name % type;
* Begin
* Select name into v_name
* From dm_object
* Where id = v_id;
* Return v_name;
* Exception when no_data_found
* Then return '';
* End;
*/
*/