Check hidden column for BlockChain Table in Oracle

Blockchain table has hidden column which used to chain the rows, Signature and hash algorithm. It will maintain the blockchain table by linking rows.

Note: Blockchain tables were introduced in 21c.

Check hidden column for block chain table

COL "Data Length" FORMAT 9999
COL "Column Name" FORMAT A24
COL "Data Type" FORMAT A28
SELECT internal_column_id "Col ID", SUBSTR(column_name,1,30) "Column Name", 
SUBSTR(data_type,1,30) "Data Type", data_length "Data Length"
FROM   user_tab_cols       
WHERE  table_name = 'BANK_BLOCKCHAIN' ORDER BY internal_column_id;

Display the value of hidden column

COL "Chain date" FORMAT A17
COL "Chain ID" FORMAT 99999999
COL "Seq Num" FORMAT 99999999
COL "User Num" FORMAT 9999999
COL "Chain HASH" FORMAT 99999999999999
SELECT ORABCTAB_CHAIN_ID$ "Chain ID", ORABCTAB_SEQ_NUM$ "Seq Num",
            to_char(ORABCTAB_CREATION_TIME$,'dd-Mon-YYYY hh-mi') "Chain date",
            ORABCTAB_USER_NUMBER$ "User Num", ORABCTAB_HASH$ "Chain HASH"
     FROM   BANK_BLOCKCHAIN;

Reference:

https://docs.oracle.com/en/database/oracle/oracle-database/21/nfcon/practice-managing-blockchain-tables-and-rows-282450221.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.