Datawindow error

Posted on 2002-07-08
Last Modified: 2013-12-26
I'm getting an error I have never seen before.

Datawindow error

Select Error: Column lists do not match

I've not seen this error before.

The DW in question had its Owner changed (from DBO), was a Sybase DB, and now is an Oracle 8i Database.

No other properties other than a join and the ownership were changed in the Datawindow,  now this error is poppin up.  On both the native retrieve, and when run through the application.

Any help would be appreciated.
Question by:valiant_at_mci
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +3

Author Comment

ID: 7138737
This is a bit of a hurry if anyone could help please

Expert Comment

ID: 7140930
This is a problem with you select statement. Are you using a union? If so, look that both sideds of the union (all) have the same number of columns and that the column types match in both type and position.

If you can post the Select statement I may be of more help.


Expert Comment

ID: 7141998
Try Export-Import
send DataWindow to me
I will examine it
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 7142614
Have u tested the sql for the datawindow.
Does it works fine.
Please send the sql for DW .

Author Comment

ID: 7146098
I found the problem with the DW, and its not in the SQL or the pull of the DW itself its the use of the MODIFY function to change the SQL behind the scenes.
But the initial problem remains, as the solution I devised did not work.

Before calling the Modify function I changed the single quotes (') to double (") around certain items (listed below), and this actually got past the column error that is a result of a bad Modify call.  The problem that arose from this change is that though the MODIFY function now modifies correctly, the DW gets an invalid Column error with Double "'s.

Catch 22.  Change the SQL to use the modify function, but then the DW wont retrieve properly.

Columns Changing:
Select < Various Coumns>,
To_Number( To_Char(FAST.account_request.requested_date, "mm") ),          
To_Number( To_Char(FAST.account_request.requested_date, "dd") ),          
To_Number( To_Char(FAST.account_request.requested_date, "yy") ),
InStr(FAST.account_request.status, "xndaper")

SQL comes from here:
is_orgselect = dw_list.Describe("DataWindow.Table.Select")

Changes are here:
is_orgselect = replace(is_orgselect, pos(is_orgselect, "'mm'"), 4, "~"mm~"")
is_orgselect = replace(is_orgselect, pos(is_orgselect, "'dd'"), 4, "~"dd~"")
is_orgselect = replace(is_orgselect, pos(is_orgselect, "'yy'"), 4, "~"yy~"")
is_orgselect = replace(is_orgselect, pos(is_orgselect, "'xndaper'"), 9, "~"xndaper~"")

t_modstrg = "DataWindow.Table.Select='"  &
               + is_orgselect + t_where + "'"

The entire SQL of the DW becomes what is below:

SELECT  FAST.ACCOUNT_REQUEST.~"SSO_LOGIN_ID~" ,           ~"FAST~".~"ACCOUNT_REQUEST~".~"CONNECT_ID~" ,           ~"FAST~".~"ACCOUNT_REQUEST~".~"REQUESTED_DATE~" ,           To_Number( To_Char(FAST.account_request.requested_date, "mm") ),           To_Number( To_Char(FAST.account_request.requested_date, "dd") ),           To_Number( To_Char(FAST.account_request.requested_date, "yy") ),           ~"FAST~".~"ACCOUNT_REQUEST~".~"STATUS~" ,           ~"FAST~".~"ACCOUNT_REQUEST~".~"REQUESTOR_LOGIN_ID~" ,           ~"FAST~".~"SSO_USER~".~"LAST_NAME~" ,           ~"FAST~".~"SSO_USER~".~"FIRST_NAME~" ,           ~"FAST~".~"SSO_USER~".~"MIDDLE_NAME~" ,           ~"FAST~".~"SSO_USER~".~"FIN_DEPT_ID~" ,           ~"FAST~".~"ACCOUNT_REQUEST~".~"APPROVER_LOGIN_ID~" ,           ~"FAST~".~"SSO_USER~".~"SU_ID~" ,           ~"FAST~".~"ACCOUNT_REQUEST~".~"STATUS_DATE~" ,           ~"FAST~".~"DEPARTMENT~".~"DEPT_NAME~" ,           ~"FAST~".~"CONNECTION~".~"SHORT_DESC~" ,           InStr(FAST.account_request.status,"xndaper")    FROM ~"FAST~".~"ACCOUNT_REQUEST~" ,           ~"FAST~".~"SSO_USER~" ,           ~"FAST~".~"CONNECTION~" ,           ~"FAST~".~"DEPARTMENT~"     WHERE ( ~"FAST~".~"SSO_USER~".~"FIN_DEPT_ID~" = ~"FAST~".~"DEPARTMENT~".~"DEPT_NUMBER~" (+)) and          ( ~"FAST~".~"ACCOUNT_REQUEST~".~"SSO_LOGIN_ID~" = ~"FAST~".~"SSO_USER~".~"SSO_LOGIN_ID~" ) and          ( ~"FAST~".~"ACCOUNT_REQUEST~".~"CONNECT_ID~" = ~"FAST~".~"CONNECTION~".~"CONNECT_ID~" )    and (FAST.account_request.status in ("r", "e"))'

Author Comment

ID: 7146103
Forgot to mention.  Still seeking some kind of solution to this.  Fixing the initial error produces the DW Invalid Column error (Oracle 8i).  So I am sort of stuck.  Other than making another DW with the modified SQL as a base and switching out the properties on the one displayed.  

Expert Comment

ID: 7147402

Changing the single quotes to double quotes will not fix your problem but just create another. The double quotes identify database objects. The single quotes designate the start and end of strings. This would generate the invalid column error. Oracle would assume "mm", "dd", "yy", "xndaper", "r" and "e" to all be names of columns.

These are the errors in your select SQL

1) To_Number( To_Char(FAST.account_request.requested_date, "mm") ),  
The "mm" should be 'mm'        

2) To_Number( To_Char(FAST.account_request.requested_date, "dd") ),          
The "dd" should be 'dd'        

3) To_Number( To_Char(FAST.account_request.requested_date, "yy") ),          
The "yy" should be 'yy'

4) InStr(FAST.account_request.status,"xndaper")
The "xndaper" should be 'xndaper' though "xndaper" may be a column name.

5) FAST.account_request.status in ("r", "e"))'
The "r", "e" should be 'r', 'e' and the trailing ' should not be there

I think thats it.

A) Why do you think you need to change the single to double quotes?
B) Did you always manipulate the SQL prior to the retrieve?
c) Instr will return a number. Is this what your looking for in the last column expression?


Author Comment

ID: 7164661
The DW actually has no criteria for when it was built (I am not the author).  

Based on who is pulling information (their access level), certain filters are tacked on with a MODIFY command.  The sinlge quotes will not go through the Modify command, and doubles aren't recognized by Oracle.  The singles (along your theme), were the solution by prefacing them with ~~


Accepted Solution

Caseys95 earned 200 total points
ID: 7172894
One last comment:

Check out the Powerbuilder help for 'SetSQLSelect()' There are a few good reasons to use this function over the "Modify()" technique. One being that it is easier to handle special characters such as "'" and '"'.

From the help text

"Modify will not verify the SELECT statement or change the update information, making it faster but more susceptible to user error. Although you can use Modify when arguments are involved, it is not recommended because of the lack of checking.";pt=40235?DwebQuery=setsqlselect

You could also do: = 'Select ... Where ...'
This option is much like the modify() function but you will not have to mess with the tildas.;pt=46477?

Expert Comment

ID: 7394386
Column list defined in the datawindow doesn't match with the select command. The most often reasons:

1) Select contains * (all columns) and table was changed.
2) Select references view, original table was changed, and view was not recreated. The column types are shifted.

Expert Comment

ID: 13347510
Okay I just had the same/similar problem and then read through this.  Based, on Hinks comment from Date: 10/31/2002 02:51PM PST, I derived a solution.

PB version 5. ( Iit old I know but we have a huge application that uses a Framework based on PB 5 that cannot be upgraded.)

My data and SQL ( actually a stored proc ) had both gone through several revisions. However, I did not want to lose all the formatting work in the existing dw.  I never saw the problem while previewing, the dw from PB, only when I ran it from the App. A slight difference for me was my owner did not change....just had a lot of revisions in DW and SP.

Here is what I did.  I decided to build a new temp DW.  And then I compared the columns and data specs from the new one to the old one.  Sure enough, there was a minor difference.  Once I made the old DW match the new DW column specs, It worked fine.

Hope this helps others.


Expert Comment

ID: 13352681
I PB, You don't need to create new datawindow, when datatypes are set wrongly. It is enough to change anything in its SQL select, for example add and a space in the command or deselect any column and select again. When You will return to design, the datatypes are OK.

Expert Comment

ID: 13575852
I did not realize I missed this until I was cleaning out my email.   Thanks hink I will try this net time.



Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question