Reports the table’s current logging mode, depending on the session, table and database-wide settings.
object_attr(table_name, string)
dml_logging – returns the DML logging level for the requested object in effect, based on the explicitly set table or database’s DML logging level.
dml_logging for session – returns the DML logging level for the current session, taking into account the user running object_attr, the table’s schema, and rules regarding multistatement transactions, and so on. The return value from this argument can be different for different users, and different for statements or transactions for the same user.
compression – returns the compression type for the requested object.
help – prints a list of supported string arguments.
select object_attr('sysobjects', 'help')
Usage: object_attr('tabname', 'attribute') List of options in attributes table: 0 : help 1 : dml_logging 2 : dml_logging for session 3 : compression
dml_logging reports the statically defined dml_logging level for the object, and dml_logging for session reports the runtime logging level chosen for the object, depending on the database-specific and session settings.
select object_attr("pubs2..authors", "dml_logging") Returns: FULL
select object_attr("pubs2..authors", "dml_logging") Returns: FULL SET DML_LOGGING MINIMAL go select object_attr("pubs2..authors", "dml_logging for session") Returns: MINIMAL
create database testdb WITH DML_LOGGING = FULL go create table non_logged_table (...) WITH DML_LOGGING = MINIMAL go select object_attr("non_logged_table", "dml_logging") Returns: MINIMAL
create database testdb with dml_logging = minimal
create table logged_table(...) with dml_logging = full
set dml_logging minimal
select object_attr("logged_table", "dml_logging for session") --------------------
minimal
create table normal_table
select object_attr("normal_table", "dml_logging") ------------------------- FULL
set dml_logging minimal
select object_attr("normal_table", "dml_logging for session") ----------------------------- minmimal
select object_attr("own_table","dml_logging")
-------------- FULL
select object_attr("mary.other_table", "dml_logging")
-------------- FULL
set dml_logging minimal
select object_attr("own_table", "dml_logging for session")
-------------- MINIMAL
Select object_attr("mary.other_table", "dml_logging for session")
-------------- FULL
set showplan on
set show_exec_info on
set dml_logging minimal select object_attr("logged_table", "dml_logging for session")
delete logged_table
The SAP ASE server reports the table’s logging mode at run-time with show_exec_info parameter.
The return type is a varchar, which appropriately returns the value of the property (for example, on or off) depending on the property queried for.
The logging mode as reported by extensions to showplan output might be affected at run-time, if there are set statements in the same batch, preceding the execution of the DML, which changes the logging mode of the table
The return value is the value NULL (not the string “NULL”) for an unknown property.
A special-type of string parameter, help prints to the session’s output all the currently supported properties for object_attr. This allows you to quickly identify which properties are supported by object_attr.