> I'd like to propose some ways to convert DBKEY into a human-readable 
> form but still be able to quickly (without a full table scan) access the 
> record via its human-readable DBKEY.
> 
> Primarily, it could be used to report a unique id of the offending 
> record in error messages allowing users to easily locate that record. 
> But it could be used for other purposes as well.
> 
> So far I can think of two solutions:
> 
> 1) Add two symmetric built-in functions: DBKEY_TO_CHAR and 
> CHAR_TO_DBKEY. The former one would return the predefined hex-encoded 
> textual representation of the DBKEY while the latter one would perform 
> the opposite transformation. So one would need to SELECT 
> DBKEY_TO_CHAR(RDB$DB_KEY) ... (or just copy'n'paste from the error 
> message) and then SELECT ... WHERE RDB$DB_KEY = CHAR_TO_DBKEY(?).
> 
> 2) Add pseudo-column RDB$RECORD_NUMBER which would return rpb_number as 
> BIGINT (can be easily converted from/to text). Modify the engine so that 
> search for RDB$RECORD_NUMBER would work similar to the searching for 
> RDB$DB_KEY i.e. use a fast positioned table access.
> 
> Opinions? Any other suggestions?

    DBKEY is abstraction for end-users and should remain abstract. Therefore my 
vote for (1).

Regards,
Vlad

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to