|
|
| Author |
Message |
rohanatl
New User
Joined: 21 Oct 2005 Posts: 20
|
|
|
|
Hi All,
EXEC SQL
DECLARE X-CURSOR CURSOR FOR SELECT DISTINT(FILE_NO) INTO :WS-FILE_NO FROM MASTER_TABLE WHERE FILE_PROCESSD='P'
END-EXEC.
Is it possible to decalre a cursor with the distint operator |
|
| Back to top |
|
 |
References
|
Posted: Thu Jun 12, 2008 5:36 pm Post subject: Re: Can we declare a Cursor with distint operator |
 |
|
|
 |
Gnanas SNG
Senior Member
Joined: 06 Sep 2007 Posts: 415 Location: India
|
|
|
|
DISTINT???
or
DISTINCT???
Why INTO clause??? |
|
| Back to top |
|
 |
rohanatl
New User
Joined: 21 Oct 2005 Posts: 20
|
|
|
|
sorry
DISTINCT is the one i need to use...
For EG:
this is the file structure..
File_no FILE_PROCESSD
11111 P
11111 P
11111 P
22222 P
33333 P
44444 P
44444 W
44444 W
44444 W
44444 W
By using the query in my program i want to fetch the file number by eliminating the duplicate values..
If i declare a cursor with out the Distinct function i will get all the records with status ="P" |
|
| Back to top |
|
 |
Suresh Ponnusamy
Active User
Joined: 22 Feb 2008 Posts: 73 Location: New York
|
|
|
|
| Yes.. You can use DISTINCT Clause in the Declare Cursor. |
|
| Back to top |
|
 |
|
|