This discussion is archived
1 2 Previous Next 16 Replies Latest reply: Mar 28, 2013 1:10 PM by Howard (... in Training) RSS

Query works in sqldeveloper but not apex

ti3r Newbie
Currently Being Moderated
In my APEX application, have a textfield on a page in which user enters a code in the format 111-000-461. The textfield item is called p1_searchmergecode

My query in a report region is this
     
select * from t3_mail_piece
where :P1_searchmergecode BETWEEN start_merge_code and end_merge_code

I have tried using syntax for all the different session states, but no matter what I do, the query returns 'no data' in the apex application.

If I run this query in sqldeveloper it returns a correct result

select * from t3_mail_piece
where '111-000-461' BETWEEN start_merge_code and end_merge_code;

RESULT
302     Travel_Check     American_TAD_Typed_Template     22-APR-13     30-APR-13     555-2424     Scottsdale     1          1350     111-000-461     111-000-465     17                    1                    One Thousand Three Hundred Fifty and 00/100
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points