DBE_SESSION
API Description
Table 1 provides all APIs supported by the DBE_SESSION package. DBE_SESSION takes effect at the session level.
API |
Description |
---|---|
Sets the value of an attribute in a specified context. |
|
Clears the value of an attribute in a specified context. |
|
Queries the value of an attribute in a specified context. |
- DBE_SESSION.SET_CONTEXT
Sets the value of an attribute in a specified namespace (context). The prototype of the DBE_SESSION.SET_CONTEXT function is as follows:
1 2 3 4 5
DBE_SESSION.SET_CONTEXT( namespace text, attribute text, value text )returns void;
Table 2 DBE_SESSION.SET_CONTEXT API parameters Parameter
Description
namespace
Name of the context to be set. If the context does not exist, create a context. The value contains a maximum of 128 characters.
attribute
Attribute name. The value contains a maximum of 128 characters.
value
Name of the value to be set. The value contains a maximum of 128 characters.
- DBE_SESSION.CLEAR_CONTEXT
Clears the value of an attribute in a specified namespace (context). The prototype of the DBE_SESSION.CLEAR_CONTEXT function is as follows:
1 2 3 4 5
DBE_SESSION.CLEAR_CONTEXT ( namespace text, client_identifier text default 'null', attribute text )returns void ;
Table 3 DBE_SESSION.CLEAR_CONTEXT API parameters Parameter
Description
namespace
User-specified context.
client_identifier
Client authentication. The default value is 'null'. Generally, you do not need to manually set this parameter.
attribute
Attribute to be cleared.
- DBE_SESSION.SEARCH_CONTEXT
Queries the value of an attribute in a specified namespace (context). The prototype of the DBE_SESSION.SEARCH_CONTEXT function is as follows:
1 2 3 4
DBE_SESSION.SEARCH_CONTEXT ( namespace text, attribute text )returns text;
Table 4 DBE_SESSION.SEARCH_CONTEXT API parameters Parameter
Description
namespace
User-specified context.
attribute
Attribute to be queried.
Example
1 2 3 4 5 |
BEGIN select DBE_SESSION.set_context('test', 'gaussdb', 'one'); -- Set the gaussdb attribute of the test context to one. select DBE_SESSION.search_context('test', 'gaussdb'); select DBE_SESSION.clear_context('test', 'test','gaussdb'); END; |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.