FIGURE P8.31 CH08_SALECO2 DATABASE TABLES Database name: Ch08_SaleCo2 Table name: CUSTOMER Dcoor CUUNAME CUAME CUSAL AEACOce cuPHOE CUALANCE| Table name: INVOICE TO 16- 1 16 FO 2 1 1004 1011 17n 10 1 17 100 1014 17 10 15 KON Ound Mm s O Ay 222 000 212 Table name: LINE Table name: PRODUCT 2 2O TER Pwr part, 15Seorze 13 p 14g pc R 038 -17 13-17 13--17 2 15 15 2 S 9 2 2a DO ,n 22e , 22 O coe IG 2 O haner 200-17 12 20 20 12 23 10 2 2oty 10 996 1440 54778-2 e 1006 S77 1 ,2 2 2 1 45 Ih 11 2 wRm 329CHE 1000 Sing, ve, Peh Table name: VENDOR V coe VNAE [VCONTACT |VECOVOEV TATE VE 2 L Png Dee Sth Arder 2 D 2 Geme 2 D Shy 231 Ran ue 200 an OROVA 240 , Deete GA 01 N Bthe Sytew Den 31. Create a trigger named trg_line_total to write the LINE_TOTAL value in the LINI table every time you add a new LINE row. (The LINE_TOTAL value is the produc of the LINE_UNITS and LINE_PRICE values.)

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter13: Views
Section: Chapter Questions
Problem 1MC
icon
Related questions
Question

Why my code cannot run?

FIGURE P8.31 CH08_SALECO2 DATABASE TABLES
Database name: Ch08_SaleCo2
Table name: CUSTOMER
Table name: INVOICE
CUS CooE CuS LNAMECUS PNAME CuS NMAL CUSAREACOCE CU PHONE CuS BALANCE
OIE Rumas
CO1 Dure
W NUNGER | CUS_CO DATE
100 19014 16--1
1001 16Jan-18
TOTAL TA otAL
Ahet
Lre
Kay
544
04-126
000
1070
19012 16n-t
10011 17an-18
10018
153S
0013 Obenki
KCO14 Odundo Myren
COS O
56 76
00
0.00
221 19
16
4-210
222-1
403
2-12
1004
100s
280
7044
James
Gege
1000
10014 17an-18
10017 wane
15
10015 1tlan18
200
00 Fart
210
000
Are
Clate
1001 t
1008
431 de
615
207-00
Table name: LINE
WNUMEES DENUMBERCOCE| LHE UNTS UE PRICE UHE TOTAL
Table name: PRODUCT
1499
149
1001
1DERO Power pairte, 15 pa, Seorz
13-02 per bde
140 900 p e
00
1000
499
130eo-17
140
1000
1.223/OPD
13Nv-17
15a1a
12
1749
000 21344
1000
3 13022
749
14 90
19.00
70.44
207
108 92
1000
1490
19 om H 10n,0
z Y DO gnew. 12n
15-n-1
23
43
199
20e-17
24ec1
1004
1006
22OHE
1 PVCZDRT
1 SM 1077
2 22OTY
9.06
ar
12
22ORD BIO conder I0
20He O hanmer
21LAA Seanner, 12
54778-2 R tie, 1 e
WEO Heu chan saw, 10.
PVCDRT PVC pn, 3Sin, 6
20-n-18
12
1006
10 2125
1006
1006
1006
1000
1007
20--18
23
10
995
109 90
14 40
150ec-17
20
00 2144
1 13COP
29 98
499
2935
2.
1490
2
0S 2400
1 PVCCAT
2 WRSTT
490
68
119 6
1006
S18277 125n eow, 25
SN2E 25A wd. sorew.e
ARSTS Seeiming, t, nesh
12
75
000 21225
000 21201
10 25
1006
1000
100
Table name: VENDOR
VCOE VNAME VCONTACT VAREACODEV PHONE V STATE VORDER
2125 y, e
2126 upeles, he.
21201 DE Seply
21344 Gome B
22T Dome Saphy
23119 Randets u
24004 Brackenan Bros
20 ORDVA, n
44 DAK, he.
20 Darl Suple
2S Rico Syster D
Srathen
Pushing
Singh
Deega
22-3 TN
215-6 FL
616
616
TM
Sath
GA
Ander
Brning
101
615
206-1410
124
TN
Brh
104
22000
FL
Breythe
TN
PL
31. Create a trigger named trg_line_total to write the LINE_TOTAL value in the LINE
table every time you add a new LINE row. (The LINE_TOTAL value is the product
of the LINE_UNITS and LINE_PRICE values.)
Transcribed Image Text:FIGURE P8.31 CH08_SALECO2 DATABASE TABLES Database name: Ch08_SaleCo2 Table name: CUSTOMER Table name: INVOICE CUS CooE CuS LNAMECUS PNAME CuS NMAL CUSAREACOCE CU PHONE CuS BALANCE OIE Rumas CO1 Dure W NUNGER | CUS_CO DATE 100 19014 16--1 1001 16Jan-18 TOTAL TA otAL Ahet Lre Kay 544 04-126 000 1070 19012 16n-t 10011 17an-18 10018 153S 0013 Obenki KCO14 Odundo Myren COS O 56 76 00 0.00 221 19 16 4-210 222-1 403 2-12 1004 100s 280 7044 James Gege 1000 10014 17an-18 10017 wane 15 10015 1tlan18 200 00 Fart 210 000 Are Clate 1001 t 1008 431 de 615 207-00 Table name: LINE WNUMEES DENUMBERCOCE| LHE UNTS UE PRICE UHE TOTAL Table name: PRODUCT 1499 149 1001 1DERO Power pairte, 15 pa, Seorz 13-02 per bde 140 900 p e 00 1000 499 130eo-17 140 1000 1.223/OPD 13Nv-17 15a1a 12 1749 000 21344 1000 3 13022 749 14 90 19.00 70.44 207 108 92 1000 1490 19 om H 10n,0 z Y DO gnew. 12n 15-n-1 23 43 199 20e-17 24ec1 1004 1006 22OHE 1 PVCZDRT 1 SM 1077 2 22OTY 9.06 ar 12 22ORD BIO conder I0 20He O hanmer 21LAA Seanner, 12 54778-2 R tie, 1 e WEO Heu chan saw, 10. PVCDRT PVC pn, 3Sin, 6 20-n-18 12 1006 10 2125 1006 1006 1006 1000 1007 20--18 23 10 995 109 90 14 40 150ec-17 20 00 2144 1 13COP 29 98 499 2935 2. 1490 2 0S 2400 1 PVCCAT 2 WRSTT 490 68 119 6 1006 S18277 125n eow, 25 SN2E 25A wd. sorew.e ARSTS Seeiming, t, nesh 12 75 000 21225 000 21201 10 25 1006 1000 100 Table name: VENDOR VCOE VNAME VCONTACT VAREACODEV PHONE V STATE VORDER 2125 y, e 2126 upeles, he. 21201 DE Seply 21344 Gome B 22T Dome Saphy 23119 Randets u 24004 Brackenan Bros 20 ORDVA, n 44 DAK, he. 20 Darl Suple 2S Rico Syster D Srathen Pushing Singh Deega 22-3 TN 215-6 FL 616 616 TM Sath GA Ander Brning 101 615 206-1410 124 TN Brh 104 22000 FL Breythe TN PL 31. Create a trigger named trg_line_total to write the LINE_TOTAL value in the LINE table every time you add a new LINE row. (The LINE_TOTAL value is the product of the LINE_UNITS and LINE_PRICE values.)
D Server: 127.0.0.1 » O Database: cho8 saleco »
Table: line
Browse
A Structure
U SQL
Search
i Insert
A Export
Import
I Privileges
Operations
O Tracking
% Triggers
Run SQL query/queries on table ch08_saleco.line: e
Columns
1 CREATE OR REPLACE TRIGGER TRG_LINE_TOTAL
INV NUMBER
LINE_NUMBER
P CODE
LINE UNITS
LINE_PRICE
2 BEFORE INSERT ON line
3 FOR EACH ROW
4 BEGIN
5 :NEW.LINE_TOTAL :=:NEW.LINE_UNITS*:NEW.LINE_PRICE;
6 END;
SELECT *
SELECT
INSERT
UPDATE
DELETE
Clear
Format
Get auto-saved query
O Bind parameters e
<<
Bookmark this SQL query:
V Show this query here again O Retain query box O Rollback when finished V Enable foreign key checks
[ Delimiter
Error
SQL query: Copy.
CREATE OR REPLACE TRIGGER TRG_LINE_TOTAL
BEFORE INSERT ON line
FOR EACH ROW
BEGIN
: NEW. LINE_TOTAL :=:NEW.LINE_UNITS*:NEW.LINE_PRICE
MYSQL said: e
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':NEW.LINE_TOTAL :=:NEW.LINE_UNITS*:NEW.LINE_PRICE' at line 5
Transcribed Image Text:D Server: 127.0.0.1 » O Database: cho8 saleco » Table: line Browse A Structure U SQL Search i Insert A Export Import I Privileges Operations O Tracking % Triggers Run SQL query/queries on table ch08_saleco.line: e Columns 1 CREATE OR REPLACE TRIGGER TRG_LINE_TOTAL INV NUMBER LINE_NUMBER P CODE LINE UNITS LINE_PRICE 2 BEFORE INSERT ON line 3 FOR EACH ROW 4 BEGIN 5 :NEW.LINE_TOTAL :=:NEW.LINE_UNITS*:NEW.LINE_PRICE; 6 END; SELECT * SELECT INSERT UPDATE DELETE Clear Format Get auto-saved query O Bind parameters e << Bookmark this SQL query: V Show this query here again O Retain query box O Rollback when finished V Enable foreign key checks [ Delimiter Error SQL query: Copy. CREATE OR REPLACE TRIGGER TRG_LINE_TOTAL BEFORE INSERT ON line FOR EACH ROW BEGIN : NEW. LINE_TOTAL :=:NEW.LINE_UNITS*:NEW.LINE_PRICE MYSQL said: e #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':NEW.LINE_TOTAL :=:NEW.LINE_UNITS*:NEW.LINE_PRICE' at line 5
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Avoiding deadlock
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage