× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



ais400com               [SkillTap request for community "everyone"]: What 
is the SQL statement to locate a row based on a value?  For example my 
SELECT returns a result set of 1000 rows ORDERED by Item# into a cursor. I 
want to locate the row in my cursor that is Item# ?X1234?.   How do I 
delete a cursor row?
robberendt              If you are using embedded SQL, you should be able 
to do something like delete from myfile where current of cursorname.  Have 
you used cursors?
robberendt              I can show you some sample code with cursors, if 
need be.
ais400com               I have used cursors but never needed to delete a 
row.  Now just to be clear, I want to delete the row form the cursor, not 
the phisical file used in my select statement. 
robberendt              Then DELETE FROM MYFILE WHERE CURRENT OF 
CURSORNAME should work.
robberendt              Or delete from myfile where (your select statement 
here) should also work
robberendt              From the manual:
robberendt              Positioned DELETE: 

>>-DELETE FROM--+-table-name-+--+--------------------+---------->
                '-view-name--'  '-correlation-clause-'
 
>--WHERE CURRENT OF--cursor-name-------------------------------><
robberendt 
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/db2/rbafzmstdelst.htm#Header_833
ais400com               Thank you, that will solve one of my problems. Any 
idea how to locate what row holds value 'XABC'?
robberendt              Assuming that the value 'XABC' is in a field 
called myfield:  delete from myfile where myfield='XABC',   to test this: 
select * from myfile where myfield='XABC'

Rob Berendt
-- 
"They that can give up essential liberty to obtain a little temporary 
safety deserve neither liberty nor safety." 
Benjamin Franklin 




"Smith, Dave" <DSmith@xxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
03/13/2003 02:48 PM
Please respond to Midrange Systems Technical Discussion
 
        To:     <midrange-l@xxxxxxxxxxxx>
        cc: 
        Fax to: 
        Subject:        SQL Cursor Row Locate or DELETE


What is the SQL statement to locate a row based on a value?  For example 
my SELECT returns a result set of 1000 rows ORDERED by Item# into a 
cursor.   I want to locate the row in my cursor that is Item# 'X1234'. 
Second question; How do I delete a Cursor Row? 

_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing 
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.