Oracle9i Supplied PL/SQL Packages and Types Reference
Release 1 (9.0.1)

Part Number A89852-02
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

DBMS_DEBUG, 19 of 27


SET_VALUE Function

This function sets a value in the currently-running program. There are two overloaded SET_VALUE functions.

Syntax

DBMS_DEBUG.SET_VALUE (
   frame#               IN binary_integer,
   assignment_statement IN varchar2) 
  RETURN BINARY_INTEGER;

Parameters

Table 9-31 SET_VALUE Function Parameters
Parameter  Description 
frame#
 

Frame in which the value is to be set; 0 means the currently executing frame. 

assignment_statement
 

An assignment statement (which must be legal PL/SQL) to run in order to set the value. For example, 'x := 3;'.

Only scalar values are supported in this release. The right side of the assignment statement must be a scalar. 

Returns

Table 9-32 SET_VALUE Function Returns
Return  Description 
success
 

 

error_illegal_value
 

Not possible to set it to that value. 

error_illegal_null
 

Cannot set to NULL because object type specifies it as 'not null'. 

error_value_malformed
 

Value is not a scalar. 

error_name_incomplete
 

The assignment statement does not resolve to a scalar. For example, 'x := 3;', if x is a record. 

This form of SET_VALUE sets the value of a package variable.

Syntax

DBMS_DEBUG.SET_VALUE (
   handle               IN program_info,
   assignment_statement IN VARCHAR2) 
  RETURN BINARY_INTEGER;  

Parameters

Table 9-33 SET_VALUE Function Parameters
Parameter  Description 
handle
 

Description of the package containing the variable. 

assignment_statement
 

An assignment statement (which must be legal PL/SQL) to run in order to set the value. For example, 'x := 3;'.

Only scalar values are supported in this release. The right side of the assignment statement must be a scalar. 

Table 9-34 SET_VALUE Function Returns
Return  Description 
error_no_such_object
 

Either:

- Package does not exist.

- Package is not instantiated.

- User does not have privileges to debug the package.

- Object does not exist in the package. 

In some cases, the PL/SQL compiler uses temporaries to access package variables, and Probe does not guarantee to update such temporaries. It is possible, although unlikely, that modification to a package variable using SET_VALUE might not take effect for a line or two.

Example

To set the value of SCOTT.PACK.var to 6:

DECLARE
   handle  dbms_debug.program_info;
   retval  BINARY_INTEGER;
BEGIN
   handle.Owner     := 'SCOTT';
   handle.Name      := 'PACK';
   handle.namespace := dbms_debug.namespace_pkgspec_or_toplevel;
   retval           := dbms_debug.set_value(handle, 'var := 6;');
END;

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback