Example of delete - sql, PL-SQL Programming

Example of DELETE - SQL

As with UPDATE, a FOR PORTION OF clause can be specified if the target table has a defined period name, as illustrated in Example.

Example: Deleting a "portion" of the salary history table

DELETE SAL_HISTORY

FOR PORTION OF During

FROM DATE ('2012-01-01') TO DATE ('2012-02-01')

WHERE EmpNo = '123456';

As a result, the row

('123456', 55000, DATE ('2011-09-01'), DATE ('2012-08-01'))

is replaced by the two rows

('123456', 55000, DATE ('2011-09-01'), DATE ('2012-01-01')),

('123456', 55000, DATE ('2012-02-01'), DATE ('2012-08-01'))

and the DELETE statement will have effected an increase in cardinality instead of the usual decrease.

Posted Date: 1/18/2013 11:39:30 PM | Location : United States







Related Discussions:- Example of delete - sql, Assignment Help, Ask Question on Example of delete - sql, Get Answer, Expert's Help, Example of delete - sql Discussions

Write discussion on Example of delete - sql
Your posts are moderated
Related Questions
Using LOCK TABLE You use the LOCK TABLE statement to lock the whole database tables in the specified lock mode so that you can share or deny the access to them. For illustrati

Overloading The PL/SQL overloads the subprogram names. That is, you can use similar name for few different subprograms as long as their formal parameters differ in the number

Using EXCEPTION_INIT To handle unnamed internal exceptions, you should use the OTHERS handler or the pragma EXCEPTION_INIT. The pragma is a compiler directive that can be th

%FOUND Until the SQL data manipulation statement is executed, the %FOUND yields NULL. Afterward, the %FOUND yields TRUE, when an INSERT, UPDATE, or DELETE statement affected o

Assigning and Comparing Collections One collection can be assigned to other by an SELECT, INSERT, UPDATE, or FETCH statement, an assignment statement, or by a subprogram call. A

Change Sql file into CSV for product registration on Magento Project Description: I have a set of files that are in Sql format and could like for a developer to help me with

Overriding Default Locking By default, the Oracle locks the data structures for you automatically. Though, you can request exact data locks on rows or tables when it is to you

Example of NOT EXISTS in SQL Example: Use of NOT EXISTS CREATE ASSERTION Must_be_enrolled_to_take_exam_alternative1 CHECK ( NOT EXISTS (SELECT StudentId, CourseId

Redeclaring Predefined Exceptions Keep in mind that, the PL/SQL declares predefined exceptions globally in the package STANDARD; Therefore you need not declare them yourself.

Aggregate Assignment The %ROWTYPE declaration cannot include an initialization clause. Though, there are two ways to assign values to all fields in a record at once. At First, t