BIRT Exchange Forum: Callback class for SQL modification (table names in FROM clause changed) - BIRT Exchange Forum

Jump to content


 

BIRT Poll: To best make a table fill a pdf page before breaking (PL=page layout, PBI=page break interval) set:

PL: auto, PBI: 0PL: fixed, PBI: 0PL: auto, PBI: 1000000PL: fixed, PBI: 1000000
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Callback class for SQL modification (table names in FROM clause changed) Rate Topic: -----

#1 User is offline   Texican Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 09-August 08


Posted 06 February 2012 - 08:45 PM

I am developing a report getting data from Teradata.
Client says the schema and table names might change in production. So, I use callback class to modify the SQL.
In the SQL data objects in the FROM clause are changed; But column names and datatypes in the SELECT clause remain the same.

Modified SQL executes successfully in a SQL client. But it fails in the report.

Partial code of the callback:
DataSourceCollection dsc = bk.getDataSourceCollection();	
Source[] src = dsc.get();
int position;
if(dsc.hasDataSetCache())
    position=1;
else position = 0;

DataQueryCollection dqc = src[position].getDataQueryCollection();
DataQuery dq[] = dqc.get();
String[] queryNames = dqc.getNames();
DatabaseQuery dbq;

//String sql = null;

for (int i = 0; i< queryNames.length; i++) {
    dbq = (DatabaseQuery) dq[i];
    //sql = dbq.getQuery();

    rptSQL = bindCommonQueryParameters(rptSQL);

    rptSQL = processSchemaTableChange(rptSQL);
    dbq.setQuery(rptSQL,false);
}


I get Not all Queries Executed Successfully error.

I need some help re the classes I have to use in the callback to change the SQL successfully.

Any help is appreciated.
0

#2 User is offline   Birtnewbe Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 23
  • Joined: 29-February 12


Posted 28 March 2012 - 05:24 PM

any inputs on this?
0

#3 User is offline   cbrell Icon

  • Member
  • Group: Members
  • Posts: 523
  • Joined: 17-March 09


Posted 29 March 2012 - 12:37 AM

Can you provide more information like the stack trace?
Without Stack trace is it just finding a needle inside of a haystack
Interested to join BIRT User Group Mannheim (Germany)?
Have a look at: http://www.xing.com/...-group-mannheim or write me an email
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users