getTransactionByHash view
| Column | Type | Required |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Examples
SELECT * FROM getTransactionByHash WHERE transactionHash = '0x311be6a9b58748717ac0f70eb801d29973661aaf1365960d159e4ec4f4aa2d7f'
Microsoft Excel
This example shows you how to bind a worksheet cell value (a transaction hash returned by querying getBlockByHash) to a SQL query (SELECT * FROM getTransactionByHash WHERE transactionHash = ?)
-
In the Excel Data tab, choose Get Data > From Other Source > Blank Query (or New Query > From Other Source > Blank Query for older versions of Excel).
-
In the Power Query Editor formula bar, enter:
= Odbc.Query("dsn=Ethereum", "SELECT transactions FROM getBlockByHash WHERE hash = '0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35' AND transactionDetailsFlag = false")replace
Ethereumwith the name of your Easysoft ODBC-Ethereum Driver data source. -
Press the tick button.
-
In the Query Settings > Properties > Name field, enter:
getBlockByHash
-
Select the transactions column.
-
Choose Transform > Parse > JSON.
-
Right-click
Listand choose Drill Down. -
Choose Close and Load.
-
Select all the transaction hashes in the worksheet, and then, in the named reference box, above cell
A1, entergetBlockByHash. -
Copy a transaction hash value, it doesn’t matter which one.
-
In the Excel Data tab, choose Get Data > From Other Source > Blank Query (or New Query > From Other Source > Blank Query for older versions of Excel).
-
Choose Home > Manage Parameters > New Parameter.
-
Name the parameter
transactionHash. Set the Type toText. -
In the Current Value box, paste the transaction hash you copied in step 10. Choose OK.
-
Choose Close and Load.
-
In a new worksheet, in the Data tab, choose Get Data > From Other Source > Blank Query (or New Query > From Other Source > Blank Query for older versions of Excel)
-
In the Power Query Editor formula bar, enter:
= Odbc.Query("dsn=Ethereum", "SELECT * FROM getTransactionByHash WHERE transactionHash = '" & transactionHash & "'")Replace Ethereum with the name of your Easysoft ODBC-Ethereum Driver data source.
-
Press the tick button.
-
On the
transactionHashpage, choose Home > Advanced Editor. -
In the Advanced Editor, enter:
let Source = Excel.CurrentWorkbook(){[Name="getBlockByHash"]}[Content], CellValue = Source{1}[getBlockByHash] in CellValueIn this example, the parameter value for the query in step 17 is the first value in the
getBlockByHashnamed range. To use a different cell, alter the number inSource{1}[getBlockByHash]. For example to use the value in the second cell:CellValue = Source{2}[getBlockByHash] -
Choose Close and Load.