Jump to content
We've recently updated our Privacy Statement, available here ×

How to set db2 schema in ireport?


shazone

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I use DB2 all the time in my iReports, and I just use the name of the schema(s) in my FROM clause, e.g. here I am using the CORE schema:

SELECT
  ACCOUNT.ACCOUNT_NUMBER || ' L ' || LOAN.ID AS ACCT,
  COALESCE(PERSON.LAST_NAME, '') || COALESCE(',' || PERSON.FIRST_NAME, '') AS PERSON_LAST_FIRST,
  LN_TYPE.DESCRIPTION AS LOAN_TYPE,
  LOAN.BALANCE AS LOAN_BALANCE,
FROM
  CORE.ACCOUNT AS ACCOUNT INNER JOIN
  CORE.PERSON AS PERSON ON
    ACCOUNT.PRIMARY_PERSON_SERIAL=PERSON.SERIAL INNER JOIN
  CORE.LOAN AS LOAN ON
    LOAN.PARENT_SERIAL=ACCOUNT.SERIAL INNER JOIN
  CORE.LN_TYPE AS LN_TYPE ON
    LOAN.TYPE_SERIAL=LN_TYPE.SERIAL
WHERE
  LOAN.CLOSE_DATE IS NULL AND
  LOAN.CHARGE_OFF_DATE IS NULL AND
  $X{ IN, LN_TYPE.DESCRIPTION, LoanTypeList }
ORDER BY
  ACCT

Of course, the schema(s) you use have to be defined in the Data Source that your report points to.

Hope that helps.

Carl

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...