الانتقال إلى المحتوى

هل يمكن إدخال البيانات عن طريق الـVIEW


abu yousra

Recommended Posts

هل من الممكن أن تستخدم الــVIEW لأدخال البيانات أم أنها لأستعراض نتيجةجملة SQL المؤسسة عليها الفيو فقط؟؟؟
وإذا كان ممكن فهل من شروط لذلك؟؟
جزاكم الله خيرا

رابط هذا التعليق
شارك

A view is a Logical table based on a table or another view. A view contains no data of its own but is like a window through which data from tables can be viewed or changed. The tables on which a view is based are called base tables. The view is stored as a SELECT statement in the data dictionary.



There are two classifications for views: simple and complex. The basic difference is related to the DML (INSERT, UPDATE, and DELETE) operations.

• A simple view is one that:

– Derives data from only one table
– Contains no functions or groups of data
– Can perform DML operations through the view

• A complex view is one that:

– Derives data from many tables
– Contains functions or groups of data
– Does not always allow DML operations through the view
_______________________________________________________

Creating a View

CREATE [OR REPLACE] [FORCE|NOFORCE] VIEW view
[(alias[, alias]...)]
AS subquery
[WITH CHECK OPTION [CONSTRAINT constraint]]
[WITH READ ONLY [CONSTRAINT constraint]];



You can create a view by embedding a subquery within the CREATE VIEW statement.
In the syntax:

OR REPLACE re-creates the view if it already exists
FORCE creates the view regardless of whether or not the base
tables exist
NOFORCE creates the view only if the base tables exist (This is the default.)
view is the name of the view
alias specifies names for the expressions selected by the view’s query
(The number of aliases must match the number of expressions
selected by the view.)
subquery is a complete SELECT statement (You can use aliases for the
columns in the SELECT list.)

WITH CHECK OPTION
specifies that only rows accessible to the view can be inserted or
updated
constraint is the name assigned to the CHECK OPTION constraint

WITH READ ONLY
ensures that no DML operations can be performed on this view

رابط هذا التعليق
شارك

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   تمت استعادة المحتوى السابق الخاص بك.   مسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

جاري التحميل
×
×
  • أضف...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية