Midrange News for the IBM i Community


Posted by: Viking
Information Systems
CA
Delete a record in embedded SQL
has no ratings.
Published: 16 May 2013
Revised: 20 May 2013 - 1494 days ago
Last viewed on: 21 Jun 2017 (2896 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Delete a record in embedded SQL Published by: Viking on 16 May 2013 view comments(10)

The following SQL statement gets me the record I'm interested in. I want to delete that record. How do I properly combine this SELECT statement with the DELETE statement? Does this become the WHERE clause after DELETE FROM MYLIB/MYFILE, or a subselect, or?

SELECT MIN( DATE('20' ||
           trim(CHAR(YY)) || '-' ||
           trim(CHAR(MM)) || '-' ||
           trim(CHAR(DD)))) 
from MYLIB/MYFILE
where PERIOD = '22'

Thanks.

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS