View previous topic :: View next topic
|
Author |
Message |
rohanatl
New User
Joined: 21 Oct 2005 Posts: 22
|
|
|
|
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 |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
DISTINT???
or
DISTINCT???
Why INTO clause??? |
|
Back to top |
|
|
rohanatl
New User
Joined: 21 Oct 2005 Posts: 22
|
|
|
|
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: 107 Location: New York
|
|
|
|
Yes.. You can use DISTINCT Clause in the Declare Cursor. |
|
Back to top |
|
|
|