Use the DBINFO_DBSPACE_RETURN_NULL_FOR_INVALID_PARTNUM environment variable to specify if dbinfo('dbspace', partnum) raises an error -727 or returns NULL when an invalid partition number (partnum) is provided.

1 0
1 1

A partition number is considered invalid if it resolves to a dbspace number which is not a valid dbspace in the instance. This includes the pseudo tables which are having partition numbers that would be associated with dbspace 0 which is not a (real) dbspace in an OneDB instance. This reflects that pseudo tables do not directly have an on-disk representation but rather are state information from (shared) memory which are exposed via SQL.

In case of an invalid partnum the dbinfo('dbspace', partnum) function would result in an error '727: Invalid or NULL TBLspace number given to dbinfo(dbspace).'. When the environment variable DBINFO_DBSPACE_RETURN_NULL_FOR_INVALID_PARTNUM is set to 1, dbinfo() will not result in an error in this case, but rather does return NULL as dbspace name. When setting a value of '0' or not setting the environment variable, the default behavior returns an error -727 for an invalid partnum. In any case a NULL provided as partnum will result in error -727 being raised.

With SET ENVIRONMENT DBINFO_DBSPACE_RETURN_NULL_FOR_INVALID_PARTNUM the variable can be set dynamically at runtime. This overrides the current DBINFO_DBSPACE_RETURN_NULL_FOR_INVALID_PARTNUM value for the current user session only. For more information about the SET ENVIRONMENT DBINFO_DBSPACE_RETURN_NULL_FOR_INVALID_PARTNUM statement of SQL, see the Guide to SQL: Syntax.