Results 1 to 2 of 2

Thread: Help Urgent

  1. #1
    Join Date
    Jun 2007

    Red face Unanswered: Help Urgent

    I am Using DB2 for the first time. My Problem is When i give static results to the query i get the results. But when i am trying to use parameter markers and trying to pass it from Birt Eclipse i am getting the following errors.
    SQL statement does not return a ResultSet object.
    SQL error #1: DB2 SQL error: SQLCODE: -418, SQLSTATE: 42610, SQLERRMC: null
    SQL error #2: DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-418;42610;
    SQL error #3: DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-418;42610;
    I dont why i'm getting this problem. the Query is
    select count(mm.organization_location_id),mm.branch_name from organization_locations oo,
    (select kk.branch_name,kk.report_id,kk.organization_locati on_id,
    max(kk.report_category_datetime) as report_category_datetime from
    (select k.organization_location_id , l.branch_name ,
    j.report_id , j.report_category_datetime from
    report_category j ,
    (select m.case_id,m.organization_location_id from reports m,follow_ups
    where organization_location_id in
    (SELECT b.organization_location_id FROM organizations a ,
    organization_locations b , countries c WHERE
    a.organization_id = b.organization_id and c.country_id =
    and a.organization_id = ? and b.country_id = ?)and p.status_id=? and p.current_status='Y' and p.report_id =
    m.case_id and m.datetime between ? AND ?) k ,
    organization_locations l
    where k.organization_location_id =
    l.organization_location_id and j.report_id = k.case_id and
    locate(?,j.report_category_name ) >= 0 ) kk group
    by kk.report_id,kk.branch_name,kk.organization_locati on_id) mm where mm.organization_location_id =
    oo.organization_location_id group by mm.organization_location_id,mm.branch_name.

    I think the problem is in parameter binding. In birt there is no datatype for varchar ,big int
    so i give string and integer. Is this causing me a problem?
    If yes, then what datatype can i give.

  2. #2
    Join Date
    Dec 2005
    Quote Originally Posted by kalpana_mur
    ... locate(?,j.report_category_name ) ...

    You cannot use a parameter marker as the first parameter of the function locate()

    if you know the length of that string, the workaround:
    ... locate(CAST(? AS CHAR(xxx)) , report_category_name ) ...
    might work
    Last edited by umayer; 06-21-07 at 09:55.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts