Please help me resolving the -802 error



IBM's flagship relational database management system

Please help me resolving the -802 error

Postby sathiyendran.erulan » Wed Sep 12, 2012 3:19 pm

One of the field declared as decimal(9,0) called cust_nbr in table abc.
05 l-number-cnt pic s9(4) comp-4.

I need to get first or last four digits matched records from table abc. Example: when the user enters, 1234 , i need to get the cust_nbr which starting with 1234 and also ending with 1234.
Logic:
For getting the starting value, we can set the range that 123400000 to 123499999. This works fine.
For gettitng the ending value, we are using MOD function to match the ending value. MOD(cust_nbr, 10000)=1234

Query used:
select count(*) into l-number-cnt from abc where ( cust_nbr between 123400000 and 123499999
and MOD(cust_nbr, 10000)=1234 )
order by cust_name;

When i execute the query, i am getting -802 error. Reply me if you have any idea on this.
sathiyendran.erulan
 
Posts: 1
Joined: Wed Mar 04, 2009 4:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Please help me resolving the -802 error

Postby Akatsukami » Wed Sep 12, 2012 4:59 pm

Another shotgun posting across multiple boards, eh?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post