DBE_SESSION
Interface Description
Table 1 provides all interfaces supported by the DBE_SESSION package. DBE_SESSION takes effect at the session level.
Interface |
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. |
Sets the value of an attribute in a specified namespace (context). The DBE_SESSION.SET_CONTEXT function prototype is as follows:
1 2 3 4 5 |
DBE_SESSION.SET_CONTEXT( namespace text, attribute text, value text )returns void; |
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 bytes. If the value exceeds 128 bytes, it will be truncated. |
attribute |
Attribute name. The value contains a maximum of 1024 bytes. If the value exceeds 1024 bytes, it will be truncated. |
value |
Name of the value to be set. The value contains a maximum of 1024 bytes. If the value exceeds 1024 bytes, it will be truncated. |
Clears the value of an attribute in a specified namespace (context). The DBE_SESSION.CLEAR_CONTEXT function prototype is as follows:
1 2 3 4 5 |
DBE_SESSION.CLEAR_CONTEXT ( namespace text, client_identifier text default null, attribute text default null )returns void ; |
Parameter |
Description |
---|---|
namespace |
Context specified by the user. The value contains a maximum of 128 bytes. If the value exceeds 128 bytes, it will be truncated. |
client_identifier |
Client authentication. The default value is null. Generally, you do not need to manually set this parameter. |
attribute |
Attribute to be cleared. The default value is null, indicating that all attributes of the specified context are cleared. The value contains a maximum of 1024 bytes. If the value exceeds 1024 bytes, it will be truncated.
CAUTION:
To ensure forward compatibility, if the parameter value is 'null', all attributes of the specified context are cleared. |
Queries the value of an attribute in a specified namespace (context). The DBE_SESSION.SEARCH_CONTEXT function prototype is:
1 2 3 4 |
DBE_SESSION.SEARCH_CONTEXT ( namespace text, attribute text )returns text; |
Parameter |
Description |
---|---|
namespace |
Context specified by the user. The value contains a maximum of 128 bytes. If the value exceeds 128 bytes, it will be truncated. |
attribute |
Attribute to be searched for. The value contains a maximum of 1024 bytes. If the value exceeds 1024 bytes, it will be truncated. |
Example
1 2 3 4 5 6 |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot