Jump to content

BIRT Developer Center Download

- - - - -

Callback class for SQL modification (table names in FROM clause changed)

  • Please log in to reply
2 replies to this topic

#1 John Berchmans

John Berchmans


  • Members
  • Pip
  • 3 posts

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;
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);
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.

#2 Birtnewbe



  • Members
  • PipPip
  • 23 posts

Posted 28 March 2012 - 05:24 PM

any inputs on this?

#3 CBR



  • Members
  • 571 posts

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