× 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.



Hello all,

I want to do an SQL delete, but I get an error. 
My select SQL stmt is:
SELECT * 
   FROM LAWDBF7TST/DBAPVEN 
        EXCEPTION JOIN LAWDBF7TST/DBAPAPI
           ON DBVEN_VENDOR = DBAPI_VENDOR
        EXCEPTION JOIN LAWDBF7TST/DBAPVBA 
           ON DBVEN_VENDOR = DBVBA_VENDOR 
                WHERE DBVEN_VENDOR < '   100000'

My delete SQL stmt is:
DELETE FROM LAWDBF7TST/DBAPVEN 
        EXCEPTION JOIN LAWDBF7TST/DBAPAPI
           ON DBVEN_VENDOR = DBAPI_VENDOR
        EXCEPTION JOIN LAWDBF7TST/DBAPVBA 
           ON DBVEN_VENDOR = DBVBA_VENDOR 
                WHERE DBVEN_VENDOR < '   100000'

...and the error I get is:
                         Additional Message Information

 

 Message ID . . . . . . :   SQL0199       Severity . . . . . . . :   30

 Message type . . . . . :   Information

 

 Message . . . . :   Keyword EXCEPTION not expected. Valid tokens:

   <END-OF-STATEMENT>.

 Cause . . . . . :   The keyword EXCEPTION was not expected here.  A syntax

   error was detected at keyword EXCEPTION.  The partial list of valid
tokens   
   is <END-OF-STATEMENT>. This list assumes that the statement is correct up
to 
   the unexpected keyword.  The error may be earlier in the statement but
the   
   syntax of the statement seems to be valid up to this point.

 Recovery  . . . :   Examine the SQL statement in the area of the specified

   keyword.  A colon or SQL delimiter may be missing. SQL requires reserved

   words to be delimited when they are used as a name. Correct the SQL

   statement and try the request again.

Now this is the only way I can delete the data I want to delete. A co-worker
suggested a view, but apparently those are read-only. Does anyone have any
other ideas on how I can select this specific data and delete it. I realize
a program could do this, but I would like to avoid writing a program if
necessary.

As always, any ideas would be appreciated,

Mike Wills
iSeries Programmer

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.