How to: updating VIEWS

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
GC

How to: updating VIEWS

Post by GC » Mon 15 Nov 2004 09:20

Updating VIEWS with SDAC at first seems impossible, but actually is a very easy task.
The problem with updating views comes from OLEDB and is not an issue only of SDAC.

The Solution is to simply create the view with VIEW_METADATA like this:

CREATE VIEW vXXX WITH VIEW_METADATA AS
select * from XXX where ....

After doing this you can simply use this view in a query like an ordinary table and it can be updated. For more information on updateable views check the SQL Books online.
Happy coding :)

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Re: How to: updating VIEWS

Post by Ikar » Tue 16 Nov 2004 09:14

We are planning to add support of updating VIEWs to SDAC but not at the nearest version.

GC

Post by GC » Tue 16 Nov 2004 12:48

The above method works just fine :)

JeePeeTee
Posts: 3
Joined: Thu 29 May 2008 10:04

Re: How to: updating VIEWS

Post by JeePeeTee » Thu 29 May 2008 10:42

Its now half-way 2008. Any plans so far to support updateable views within SDAC?
GC wrote:Updating VIEWS with SDAC at first seems impossible, but actually is a very easy task.
The problem with updating views comes from OLEDB and is not an issue only of SDAC.

The Solution is to simply create the view with VIEW_METADATA like this:

CREATE VIEW vXXX WITH VIEW_METADATA AS
select * from XXX where ....

After doing this you can simply use this view in a query like an ordinary table and it can be updated. For more information on updateable views check the SQL Books online.
Happy coding :)

Post Reply