1

I've tried using the following:

select * from TABLE1 where COLUMN= :VAR
union
select * from TABLE2 where COLUMN= :VAR;

I'm getting the following error message back:

[Teradata Database] [TeraJDBC 14.10.00.26] [Error 3654]
[SQLState HY000] Corresponding select-list expressions are incompatible.

If I just run:

select * from TABLE1 where COLUMN= :VAR;

then it works, but I need to be able to answer one prompt for the same variable that is used across multiple tables. I'm using Oracle SQL Developer Version 4.0.3.16

1

3654 Corresponding select-list expressions are incompatible.

Explanation:

If a query contains a UNION, MINUS, or INTERSECT operator, then the data types for all select-list expressions must be compatible with the corresponding expression in the select-list for the first SELECT in the query. All numeric data types are considered compatible. Character data types are not compatible with numeric data types. Byte data types are only compatible with byte data types. Graphic data types are only compatible with graphic data types.

The datatypes of the columns in TABLE1 and TABLE2 do not match.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.