If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Help Urgent

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-21-07, 08:10
kalpana_mur kalpana_mur is offline
Registered User
 
Join Date: Jun 2007
Posts: 4
Red face 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
p
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 =
b.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.
Reply With Quote
  #2 (permalink)  
Old 06-21-07, 08:46
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
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 08:55.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On