<p>A tx_out may have a datum_hash, without having an inline_datum_id, since not all datums are inlined. Inline datums were introduced in the Babbage era as an optimization mechanism.</p>
<p>Also, the Tx that you mentioned runs some Plutus scripts. This implies that it consumes and does not necessarily create outputs that have a datum. So you should probably check the tx_in of the tx and not its tx_out.</p>

CC BY-SA 4.0
2023-10-21T13:21:25.747Z
2023-10-21T13:21:25.747Z
Kostas Dermentzis
<p>I'm trying to get the specified transaction's datum value, but it didn't appear in the cardano-db-sync db. Can anyone enlighten me, please?</p>
<p>the transaction: <a href="https://cardanoscan.io/transaction/74b2639cb3bf558545e1bf4f5117d006c093385dadf539f41295153192af0ebf?tab=utxo" rel="nofollow noreferrer">https://cardanoscan.io/transaction/74b2639cb3bf558545e1bf4f5117d006c093385dadf539f41295153192af0ebf?tab=utxo</a></p>
<ol>
<li>Datum and inline_datum_id didn't appear (NULL value) in the tx_out table as the following</li>
</ol>
<pre><code>select 
    address,
    inline_datum_id,
    (select substring(cast(hash as varchar),3) from tx where id = T1.tx_id) txhash,
    (select value from datum where tx_id = T1.tx_id) datum
from tx_out T1 
where tx_id = 75437263

address                                                                                                |inline_datum_id|txhash                                                          |datum|
-------------------------------------------------------------------------------------------------------+---------------+----------------------------------------------------------------+-----+
addr1z8snz7c4974vzdpxu65ruphl3zjdvtxw8strf2c2tmqnxzv34sh40d6k0vud6w4mkqew7gsr3fuw7pu7jerszgghjk0s5xtpcd|               |74b2639cb3bf558545e1bf4f5117d006c093385dadf539f41295153192af0ebf|     |
addr1q9kmkl3xwjm9sxymcppx7jlft8vr4ux6v2wp5c8x49pamdf557v3rld8xnpm79a8h8wcvs7fy78zlth6vae0nxyq7aksnectvv|               |74b2639cb3bf558545e1bf4f5117d006c093385dadf539f41295153192af0ebf|     |
addr1qx7tzh4qen0p50ntefz8yujwgqt7zulef6t6vrf7dq4xa82j2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pqrkj6fh|               |74b2639cb3bf558545e1bf4f5117d006c093385dadf539f41295153192af0ebf|     |

</code></pre>
<ol start="2">
<li>It still appears on cardanoscan.io: <a href="https://cardanoscan.io/transaction/74b2639cb3bf558545e1bf4f5117d006c093385dadf539f41295153192af0ebf?tab=utxo" rel="nofollow noreferrer">https://cardanoscan.io/transaction/74b2639cb3bf558545e1bf4f5117d006c093385dadf539f41295153192af0ebf?tab=utxo</a></li>
</ol>
<p><a href="https://i.sstatic.net/LyZll.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LyZll.png" alt="enter image description here" /></a></p>
<p>Actual datum value: <a href="https://cardanoscan.io/datumInspector?datum=d8799fd8799f4040ffd8799f581ccded41e880c3facb6364e903d9830d52bb12fcf10f6401eda355fbd24653414c4d4f4eff1a0bebc20000d8799fd8799fd8799fd8799f581caafb1196434cb837fd6f21323ca37b302dff6387e8a84b3fa28faf56ffd8799fd8799fd8799f581c52563c5410bff6a0d43ccebb7c37e1f69f5eb260552521adff33b9c2ffffffffd87a80ffffff" rel="nofollow noreferrer">https://cardanoscan.io/datumInspector?datum=d8799fd8799f4040ffd8799f581ccded41e880c3facb6364e903d9830d52bb12fcf10f6401eda355fbd24653414c4d4f4eff1a0bebc20000d8799fd8799fd8799fd8799f581caafb1196434cb837fd6f21323ca37b302dff6387e8a84b3fa28faf56ffd8799fd8799fd8799f581c52563c5410bff6a0d43ccebb7c37e1f69f5eb260552521adff33b9c2ffffffffd87a80ffffff</a></p>
<p>Thank you</p>

CC BY-SA 4.0
2023-10-21T04:14:07.900Z
Because Cardanoscan does lots of processing most of the time to derive the datum value even if it is not part of the output. Thanks
manhdt
<cardano-db-sync>
Missing inline_datum_id in tx_out table
# Missing inline_datum_id in tx_out table

(Asked by: username_0 on 2023-10-20)

I'm trying to get the specified transaction's datum value, but it didn't appear in the cardano-db-sync db. Can anyone enlighten me, please?
the transaction: https://cardanoscan.io/transaction/74b2639cb3bf558545e1bf4f5117d006c093385dadf539f41295153192af0ebf?tab=utxo

Datum and inline_datum_id didn't appear (NULL value) in the tx_out table as the following

select 
    address,
    inline_datum_id,
    (select substring(cast(hash as varchar),3) from tx where id = T1.tx_id) txhash,
    (select value from datum where tx_id = T1.tx_id) datum
from tx_out T1 
where tx_id = 75437263

address                                                                                                |inline_datum_id|txhash                                                          |datum|
-------------------------------------------------------------------------------------------------------+---------------+----------------------------------------------------------------+-----+
addr1z8snz7c4974vzdpxu65ruphl3zjdvtxw8strf2c2tmqnxzv34sh40d6k0vud6w4mkqew7gsr3fuw7pu7jerszgghjk0s5xtpcd|               |74b2639cb3bf558545e1bf4f5117d006c093385dadf539f41295153192af0ebf|     |
addr1q9kmkl3xwjm9sxymcppx7jlft8vr4ux6v2wp5c8x49pamdf557v3rld8xnpm79a8h8wcvs7fy78zlth6vae0nxyq7aksnectvv|               |74b2639cb3bf558545e1bf4f5117d006c093385dadf539f41295153192af0ebf|     |
addr1qx7tzh4qen0p50ntefz8yujwgqt7zulef6t6vrf7dq4xa82j2c79gy9l76sdg0xwhd7r0c0kna0tycz4y5s6mlenh8pqrkj6fh|               |74b2639cb3bf558545e1bf4f5117d006c093385dadf539f41295153192af0ebf|     |



It still appears on cardanoscan.io: https://cardanoscan.io/transaction/74b2639cb3bf558545e1bf4f5117d006c093385dadf539f41295153192af0ebf?tab=utxo


Actual datum value: https://cardanoscan.io/datumInspector?datum=d8799fd8799f4040ffd8799f581ccded41e880c3facb6364e903d9830d52bb12fcf10f6401eda355fbd24653414c4d4f4eff1a0bebc20000d8799fd8799fd8799fd8799f581caafb1196434cb837fd6f21323ca37b302dff6387e8a84b3fa28faf56ffd8799fd8799fd8799f581c52563c5410bff6a0d43ccebb7c37e1f69f5eb260552521adff33b9c2ffffffffd87a80ffffff
Thank you

**Tags:** cardano-db-sync
> **Comments:**
> **username_0**: Because Cardanoscan does lots of processing most of the time to derive the datum value even if it is not part of the output. Thanks  

---

## 1 answers

### Answer by username_1 on 2023-10-21. Score: 2 | Accepted answer

A tx\_out may have a datum\_hash, without having an inline\_datum\_id, since not all datums are inlined. Inline datums were introduced in the Babbage era as an optimization mechanism.

Also, the Tx that you mentioned runs some Plutus scripts. This implies that it consumes and does not necessarily create outputs that have a datum. So you should probably check the tx\_in of the tx and not its tx\_out.


---

