Friday, December 05, 2008

ORA-01789: query block has incorrect number of result columns

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.

ORA-01789: query block has incorrect number of result columns
You may see this error in the following situation:

create table test1_1789 (
col_a varchar2(30),
col_b number,
col_c date);

create table test2_1789 (
col_a varchar2(30),
col_c number,
col_b date,
col_d char(1));

select * from test1_1789
union all
select * from test2_1789;

ORA-01789: query block has incorrect number of result columns
Table test2_1789 contains one column too many.

This fact becomes a problem because we are using * as column list specifier and it can be avoided by specifying an explicit list of columns common to both tables.


See message translations for ORA-01789 and search additional resources.

No comments:

yes you can!

Two great ways to help us out with a minimal effort. Click on the Google Plus +1 button above or...
We appreciate your support!

latest articles