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
Write a stored procedure that accepts the post code in which the customer resides as the input parameter. The procedure should then use an explicit cursor to display comprehensive

Effects of NULL for Multiple Assignments - SQL If the row expression given as the source for a multiple assignment evaluates to NULL, then NULL is assigned to each target. If

Why Use Cursor Variables ? Primarily, you use the cursor variables to pass the query result sets between the PL/SQL stored subprograms and different clients. Neither PL/SQL nor

Closing a Cursor Variable The CLOSE statement disables the cursor variable. After that, the related result set is undefined. The syntax for the same is as shown below: CLOS

SQL Is a Database Language: The commands given to a DBMS by an application are written in the database language of the DBMS. The term data sublanguage is sometimes used instea

Biconditional - SQL The biconditional p ↔ q can be expressed in Tutorial D by p = q and the same is true of SQL. The question then arises as to whether, in SQL, p = q is equiv

Cursor FOR Loops In most cases that need an explicit cursor, you can simplify the coding by using a cursor FOR loop rather of the OPEN, FETCH, and CLOSE statements. A cursor FO

Rephrase Conditional Control Statements When computing a logical expression, the PL/SQL uses short-circuit evaluation. That is, the PL/SQL stops evaluating the expression as s

Updating Tables in SQL The topic of updating by describing the assignment operator, ":=" in Tutorial D. SQL uses a different syntax for assignment, using the key word SET and

Avoid the NOT NULL Constraint In the PL/SQL, using the NOT NULL constraint incur a performance cost. Consider the illustration as shown below: PROCEDURE calc_m IS m NUMB