Table Ref

Options
Hi,

I am having a table ref from an entries table linking to a currency table, and when I run the query I get the following error message Invalid cast: "("merchant_transactions"."xdo"->>'currency_iso4217_id')::bigint" is of type:"tableref", but trying to be of type:"json"
[Screenshot 2022-08-29 at 10.31.39.png][Screenshot 2022-08-29 at 10.33.05.png][Screenshot 2022-08-29 at 10.33.44.png][Screenshot 2022-08-29 at 10.34.29.png]
When I check the decoder it finds the correct ID and everything for the currency, but it is somehow not parsing the result into the last of my function stack[Screenshot 2022-08-29 at 10.34.29.png]Hope someone can help getting the right info 

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     it sounds like you might be passing a JSON object as your var: currency value. Since db:merchant_transactions.currency_iso4217_id is a table reference (meaning it's an integer) you will be required to compare an integer to integer. So you'll want to make sure var: currency is only an integer value of the id you wish to grab. One trick to figure out what is in that variable is to implement the stop&debug just after the creation of var:currency and return the value. 
  • Per Thiessen
    Options
    Hi Michael,

    Thanks for the solution on this, it makes perfect sense now!

    Per