We want to have a list of states and our license numbers to work in those states. There is a built in table for states that I thought to use for this purpose. Before even adding license numbers to that table, I tried to supply a state code and get the state name from the table, however something is not working. I have used nested SELECT statements before elsewhere, but it seems to fail here.
The inside Select statement returns what I would expect. A state code from the address ID of the Customer. If I use a different state code that isn’t a select, but just a dummy variable, the outer Select statement returns the state name. But when I put it all together, it seems to fail.
Is anyone able to tell me what I am missing?
Using these arguments: v.Customer_No, v.Ship_Addr_No
SELECT State_Name FROM State_Codes_Tab WHERE State_Code = (SELECT State FROM Customer_Info_Address WHERE (Customer_Id = :Customer_No) AND (Address_Id = :Ship_Addr_No)) AND Country_Code = 'US'