Multiple assignment - sql, PL-SQL Programming

Multiple Assignment- SQL

SQL supports multiple assignment to local variables and also applies multiple assignment semantics in SET clauses of UPDATE statements, but does not support multiple assignment in connection with updates on table targets. Thus, SQL has no counterpart to the theory book's Example, simultaneously deleting from both COURSE and IS_ENROLLED_ON. If we assume that there must be at least one enrolment for each course, and that students can enroll only on existing courses, deferred constraint checking has to be used, as shown in Example here.

Example: Withdrawing course C3 and deleting any enrolments on C3

Assume the definition of IS_ENROLLED_ON includes

CONSTRAINT Course_must_exist_for_enrolment

FOREIGN KEY (CourseId) REFERENCES COURSE ON DELETE NO ACTION

and the definition of COURSE includes

CONSTRAINT Enrolment_must_exist_for_course

CHECK ( CourseId IN (SELECT CourseId FROM IS_ENROLLED_ON)

Posted Date: 1/18/2013 11:41:29 PM | Location : United States







Related Discussions:- Multiple assignment - sql, Assignment Help, Ask Question on Multiple assignment - sql, Get Answer, Expert's Help, Multiple assignment - sql Discussions

Write discussion on Multiple assignment - sql
Your posts are moderated
Related Questions
Scoping Within the similar scope, all the declared identifiers should be unique. So, even if their datatypes differ, the variables and parameters cannot share the similar name.

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

Create a procedure named STATUS_SHIP_SP that allows a company to employee in the Shipping Department to update the status of an order to add shipping information. The BB_BASKETSTAT

INSERT Command in SQL Loosely speaking, INSERT takes the rows of a given source table and adds them to the specified target table, retaining all the existing rows in the targ

Complete the following steps to create a procedure to calculate the tax on an order. The BB_TAX table contains the states that require taxes to be submitted for Internet sales. If

Keyword and Parameter Description select_statement: This is a query which returns a result set of the rows. Its syntax is such that of select_ into_statement without the IN

THEO R Y OF PANSPERMIA - Arrhenius (1908) postulated the cosmic panspermia theory that claims that organisms existed throughout the universe, and their spores, etc., could

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

EXIT The EXIT statement forces a loop to done unconditionally. Whenever an EXIT statement is encountered, the loop is done immediately and controls the passes to the next statem

Role of Abstraction in pl/sql: The abstraction is a high-level description or model of a real-world entity. The Abstractions keep our daily lives convenient. They help us ca