Re: how does this delete work?



On Jul 9, 11:09 am, steph <stepha...@xxxxxxxx> wrote:
Hi,

Recently I came across this delete statement inside a package that I
have to debug:

DELETE FROM
(
SELECT 1
FROM KUNDEN_SOLL ks, KUNDEN k
WHERE ks.ksl_kun_id = k.kun_id
...
)

I must say the syntax is a little uncommon for me. What's the
advantage of doing things that way instead of issuing a plain "delete
from table where ..."?

thanks,
stephan

Stephan, the syntax allows DML, a delete in this case, to be performed
on rows of a key preserved table based on the results of a join
without defining the join view to the database as a permanent view.
Writing the code this way can be more efficient than having to code
the requirements as sub-queries.

See the Applications Developers Guide - Fundamentals, ch 2, Managing
Schema Objects, section Modifying a Join View for limitations of join
views and for information on key preserved tables.

The material in the manual used defined views (create view x) but it
is the same concept in use.

HTH -- Mark D Powell --


.



Relevant Pages

  • how does this delete work?
    ... Recently I came across this delete statement inside a package that I ... have to debug: ... advantage of doing things that way instead of issuing a plain "delete ...
    (comp.databases.oracle.server)
  • Re: LaTeX3 project
    ... command syntax (xparse being the package providing std LaTeX like top-level ... Will this mean that most package writers will need to sit down ... into the programming mode in that language. ... a full featured kernel ...
    (comp.text.tex)
  • Re: Error reading delimited list
    ... COMPILE-FILE conspires in the game, ... Each readtable had an associated "syntax" which is an actual first ... subtlely different and conflicting sets of initial package names ... ... done by having the FIND-PACKAGE function examine the readtable, ...
    (comp.lang.lisp)
  • Re: Vim colour syntax
    ... colour syntax highlighting; ... Vi IMproved - enhanced vi editor - compact version ... This package contains a minimal version of vim compiled with no ... but installing it you will get its additional benefits ...
    (Debian-User)
  • Re: CLisp case sensitivity
    ... >> I had the good fortune to use a Lisp which supported the syntax ... There were only a few minor changes to the package ... would have to hunt down every reference to the old package name in the ...
    (comp.lang.lisp)