Peter Huebschen wrote :
>Hello,
>I don't know what's wrong with my Create View-Statement. I always get "Read
>only view WITH CHECK OPTION not allowed", but I need a updatable view.
>Here's my statement:
>CREATE VIEW "VIEW_DSCOPY"
>AS SELECT tbl_teile.teilenummer,
> tbl_teile.lfd_Anfragenummer,
> tbl_teile.Teilebezeichnung,
> tbl_teile.Maschinen_ID,
> tbl_StaffelTeil.angefr_Volumen,
> tbl_StaffelTeil.lfdNr_Teile,
> tbl_StaffelTeil.Bemerkung_Teilepreis,
> tbl_StaffelTeil.Bemerkung_WKZ_Kosten
>FROM tbl_Teile, tbl_StaffelTeil
>WHERE tbl_Teile.lfdnr_teile = tbl_Staffelteil.lfdnr_Teile WITH CHECK OPTION
>The tables has these constraints:
>CREATE TABLE "ALLUSERS"."TBL_STAFFELTEIL"
>(
> "LFD_STAFFELNR" Integer NOT NULL DEFAULT SERIAL
>(1),
> "ANGEFR_VOLUMEN" Integer,
> "LFDNR_TEILE" Integer,
> "TEILEPREIS_PRO_STCK" Fixed (5,2),
> "BEMERKUNG_TEILEPREIS" Varchar (500) ASCII,
> "WKZ_KOSTEN_GESAMT" Fixed (10,0),
> "EXT_WKZ_KOSTEN" Fixed (10,0),
> "BEMERKUNG_WKZ_KOSTEN" Varchar (4000) ASCII,
> PRIMARY KEY ("LFD_STAFFELNR"),
> FOREIGN KEY "REF_TEIL_STAFFFEL" ("LFDNR_TEILE") REFERENCES
>"ALLUSERS"."TBL_TEILE" ("LFDNR_TEILE") ON DELETE CASCADE
>)
>CREATE TABLE "ALLUSERS"."TBL_TEILE"
>(
> "TEILENUMMER" Varchar (50) ASCII NOT NULL,
> "LFD_ANFRAGENUMMER" Integer NOT NULL,
> "LFDNR_TEILE" Integer NOT NULL DEFAULT SERIAL
>(1),
> "TEILEBEZEICHNUNG" Varchar (50) ASCII,
> "MASCHINEN_ID" Smallint,
> "ANFR_ABSAGE_VOIT_DATUM" Date,
> "ABSAGEGRUND_VOIT_ID" Smallint DEFAULT 0,
> "ANGEBOT_ABGABE_DATUM" Date,
> "AUFTRAG_ABLEHNUNG_KUNDE_DATUM" Date,
> "ABSAGEGRUND_KUNDE_ID" Smallint,
> "BEARBEITER_KUNDE" Integer,
> "AUFTRAG_ERTEILT_DATUM" Date,
> "AUFTRAG_ERTEILT_VON" Integer,
> "VERKNUEPFUNG_ANGEBOT" Varchar (255) ASCII,
> "AENDERUNGSDATUM" Date DEFAULT DATE,
> "STATUS_ID" Smallint DEFAULT 2,
> PRIMARY KEY ("LFDNR_TEILE"),
> FOREIGN KEY "REF_ANFR_TEILE" ("LFD_ANFRAGENUMMER") REFERENCES
>"ALLUSERS"."TBL_ANFRAGE" ("LFD_ANFRAGENUMMER") ON DELETE CASCADE
>)
>Did I miss something in the docs?
You have to include column "ALLUSERS"."TBL_STAFFELTEIL"."LFD_STAFFELNR" as select
column
of your view, because this will become the 'key' of the view.
Regards,
Thomas
--
Thomas Anhaus
SAP DB, SAP Labs Berlin
[EMAIL PROTECTED]
http://www.sapdb.org/
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general