Re: SQL RPGLE cursor delete from view? -204
- From: Jonathan Ball <jonball@xxxxxxxxxxxxxx>
- Date: Sun, 16 Jul 2006 04:19:58 GMT
Charles Wilt wrote:
In article <Uk2tc.12022$be.10695@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>, jonball@xxxxxxxxxxxxxx says...
Stan The Man wrote:
this is just a "temporary" file in memory
maybe i dont have my verbage correct
i just want to delete the record in my "selected set" in you will
i could do this in RPG, but i wanted to use SQL and do it all in 1 smooth step
this is just a read-only and print application
Whatever, you just can't delete from a cursor that joins multiple files.
Even if you could do the delete from the cursor, you wouldn't want to since as I read your post you simply want to remove a record from the current result set without affecting the actual data.
I'm not sure he is really only trying to delete from the result set, although it's possible; the language is a little opaque. In any event, a DELETE operation in SQL definitely is the wrong way to do it.
Your suggestion below about populating a temporary table below, then working with its contents as the result set, possibly would work for the original poster.
Deleting via a cursor deletes the row in the underlying table.
A cursor and/or a view is simply a window or an access path into the original table(s).
To do this with SQL, you'll need to do the same thing you'd need to do with RPG....build an actual temporary work file.
Depending on the version of OS/400 you are running:
create table QTEMP/MYWORKFILE <...>
<or>
declare global temporary table <...>
HTH,
CHarles
.
- Follow-Ups:
- Re: SQL RPGLE cursor delete from view? -204
- From: Stan The Man
- Re: SQL RPGLE cursor delete from view? -204
- References:
- SQL RPGLE cursor delete from view? -204
- From: Stan The Man
- Re: SQL RPGLE cursor delete from view? -204
- From: Stan The Man
- Re: SQL RPGLE cursor delete from view? -204
- From: Jonathan Ball
- Re: SQL RPGLE cursor delete from view? -204
- From: Charles Wilt
- SQL RPGLE cursor delete from view? -204
- Prev by Date: Re: SQL RPGLE cursor delete from view? -204
- Next by Date: How to confirm that IBM Software loaded is useable & Fair price of system.
- Previous by thread: Re: SQL RPGLE cursor delete from view? -204
- Next by thread: Re: SQL RPGLE cursor delete from view? -204
- Index(es):
Relevant Pages
|