I am trying to join two tables. I am trying to do this in a macro language which allows sql statements to run on files delimited with a | (I think they are called ‘pipe-delimited’)
The trouble is, the field I am tring to join with is stored as different data type in each database. One table it is stored as type char_array, in the other it’s stored as type long. In both it is a seven digit integer (an account number)
Is there any way of performing a type conversion on the join condition before comparing the two?
a sample of the query is thus…
select firstname, lastname acct_nr, balance from db1 left join db2 on db1.acct_nr = db2.acct_nr order by balance
only db1.acct_nr is ‘char_array’ and db2.acct_nr is ‘long’.