Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Adding fields to database table causes error What is best practice?(Column binding "contactrole" has referred to a data set column "contactrole" which does not exist. )
Adding fields to database table causes error What is best practice? [message #659102] Fri, 11 March 2011 02:05 Go to next message
Chris  is currently offline Chris Friend
Messages: 47
Registered: September 2010
Member
Hi,

I am trying to sort out the best way to solve a common situation where new fields are added to database tables.

I had a working report which had the dataset as
select * from table_a a
join table_b b on a.x=b.x
join table_c c on c.y=b.y

This lists all fields from table_a then all from table_b then all from table_c.

4 new fields were added to table_a and the report now gives the error
Column binding "contactrole" has referred to a data set column "contactrole" which does not exist.

1.What is the best method to fix the problem other than recreating the report?
2. should I not use select * ? my datasets get saved into a library for use in other reports.

I have tried refeshing the dataset and can see the new fields. I have then deleted one by one the fields the give this error whereever they are mentioned in the XML code, and then freshing the data bindings, but this is quite time consuming.

Is there a better way?

Thanks Chris
Re: Adding fields to database table causes error What is best practice? [message #659104 is a reply to message #659102] Fri, 11 March 2011 02:57 Go to previous messageGo to next message
Richard A. Polunsky is currently offline Richard A. PolunskyFriend
Messages: 212
Registered: July 2009
Location: Houston TX
Senior Member

If your table structures are not stable, then you're much better off explicitly listing the columns that you want to appear in your report. Your report will then be insulated against the addition of columns.

That said, the error indicates that an existing table column was either renamed or dropped. You can't protect against that if you want it on your report.

Best practice for what you're doing is to open the report, click the table, go into Bindings, reselect the data set and check to clear existing bindings. That will repopulate the table column list based on the current state of the underlying tables, but you'll still have to manually delete or edit the table fields corresponding to columns that were dropped or renamed.

I wouldn't use Select * when the underlying tables are not stable.
Re: Adding fields to database table causes error What is best practice? [message #659469 is a reply to message #659104] Mon, 14 March 2011 08:21 Go to previous message
Chris  is currently offline Chris Friend
Messages: 47
Registered: September 2010
Member
Thanks Richard,
You have answered my question. I did not know what to do first to correct the problem.

I'm used to Crystal where you just reresh the database and it brings any new fields in. Still causes a problem if the field has gone.

I've changed to not using * when I'm joining tables which should solve most of the issue.

Thanks
Chris
Previous Topic:Turning off BIRT loggin in web.xml
Next Topic:Data Set Computed columns: Percentage
Goto Forum:
  


Current Time: Sat Apr 20 02:07:36 GMT 2024

Powered by FUDForum. Page generated in 0.02968 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top