Board index » delphi » How to prevent from deleting record?

How to prevent from deleting record?


2006-01-18 11:56:44 PM
delphi140
I make a view like this
SELECT a.FDDATE, a.FCIDNUMBER, a.FCSTATUS, b.nama, b.bagian
FROM dbo.TCARDRAW a INNER JOIN
dbo.Tdav b ON a.FCIDNUMBER = b.noid
When I delete a record in the view, Why is table "TDAV" (b) also deleted?
How to prevent from deleting record in table "TDAV" (b) ?
 
 

Re:How to prevent from deleting record?

Bpk. Adi Wira Kusuma writes:
Quote
I make a view like this

SELECT a.FDDATE, a.FCIDNUMBER, a.FCSTATUS, b.nama, b.bagian
FROM dbo.TCARDRAW a INNER JOIN
dbo.Tdav b ON a.FCIDNUMBER = b.noid

When I delete a record in the view, Why is table "TDAV" (b) also deleted?
How to prevent from deleting record in table "TDAV" (b) ?
I guess that is how the updatable views work!
What database is this?
Do you really need to delete records from a view results,
especially when the results are from two different tables joined?
Google on "updatable views" to find links like this:
www.oracle.com/oramag/oracle/01-mar/o21o8i.html
 

Re:How to prevent from deleting record?

Sarah writes:
Quote
What database is this?
Never mind! the dbo. indicates you are using SQL Server!
 

Re:How to prevent from deleting record?

Adi,
You may have to create an instead-of trigger for the view. See Books
Online for more information.
Good luck,
krf
"Bpk. Adi Wira Kusuma" <XXXX@XXXXX.COM>writes
Quote
I make a view like this

SELECT a.FDDATE, a.FCIDNUMBER, a.FCSTATUS, b.nama, b.bagian
FROM dbo.TCARDRAW a INNER JOIN
dbo.Tdav b ON a.FCIDNUMBER = b.noid

When I delete a record in the view, Why is table "TDAV" (b) also deleted?
How to prevent from deleting record in table "TDAV" (b) ?