Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error using a view in report created with Crystal Report report design

Status
Not open for further replies.

benr

Programmer
Aug 23, 1999
13
0
0
CA
Hi All,<br>
<br>
I'm building reports using Crystal Reports that gets its data from Oracle 8.3 through Intersolv ODBC driver. <br>
<br>
I've created a view (fairly complex one) where subqueries and union are involved. When i run the view in Oracle ( select * from view) all is OK. The data appears.<br>
<br>
My problem is when I run the view from Crystal Report. I get the message &quot;ORA-01789:Query block has incorrect number of result columns&quot;. <br>
<br>
I've check number, name and type of columns and they match.<br>
<br>
Am I missing something?<br>
<br>
Thanks for your replies.
 
benr -<br>
I'm not familiar with Crystal Reports, but apparently Oracle Reports will occassionally add a &quot;,&quot; to a view. This creates a null column in one of your queries so that there is a different number of columns in one part of the union then the other. Is it possible Crystal Reports is doing the same thing?
 
Carp,<br>
<br>
That's what I believed but not so.<br>
<br>
I found what the problem was though...<br>
<br>
When using subqueries, alias for tables should all be different otherwise the driver ODBC seems to misread/mix them.<br>
<br>
I fixed that and now it works.<br>
<br>
Weird... :)<br>
<br>
But thanks anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top