Hello, I am having an error and cannot figure out how to solve this question. Could someone please assist? Please be advised, I am using PostgreSQL as that is what was used in class. Thus, I must use...


Hello,


I am having an error and cannot figure out how to solve this question. Could someone please assist?


Please be advised, I am using PostgreSQL as that is what was used in class. Thus, I must use

PLPGSQL




Code


CREATE OR REPLACE FUNCTION Moreno_03_bankTriggerFunction()
RETURNS TRIGGER
LANGUAGE PLPGSQL
AS
$$


CREATE TRIGGER Wise_12_bankTrigger
AFTER DELETE ON account
FOR EACH ROW

EXECUTE PROCEDURE Moreno_15_bankTriggerFunction();


3. Consider the bank database schema given in question (2). Write a SQL trigger to carry<br>out the following action: If an account is deleted, then write a trigger to delete the<br>dependent tuple(s) from the depositor table for every owner of the deleted account. Note<br>that there may be jointly-owned bank accounts. In other words, you are to write a trigger<br>that performs the exact action of an ON DELETE CASCADE clause of a FOREIGN<br>KEY CONSTRAINT. You must submit both your trigger function definition, and your<br>trigger definition. You must name your trigger function:<br><LastName>_<DOB_DayOfMonth>_bankTriggerFunction<br>You must name your trigger:<br><LastName> <DOB DayOfMonth>_bankTrigger<br>Where <LastName> is your last name and <DOB DayofMonth> is the day of the month<br>you were born. Below is an example of how I named my trigger function and trigger,<br>respectively:<br>Morabito_05_bankTriggerFunction ()<br>Morabito 05 bankTrigger<br>

Extracted text: 3. Consider the bank database schema given in question (2). Write a SQL trigger to carry out the following action: If an account is deleted, then write a trigger to delete the dependent tuple(s) from the depositor table for every owner of the deleted account. Note that there may be jointly-owned bank accounts. In other words, you are to write a trigger that performs the exact action of an ON DELETE CASCADE clause of a FOREIGN KEY CONSTRAINT. You must submit both your trigger function definition, and your trigger definition. You must name your trigger function: __bankTriggerFunction You must name your trigger: _bankTrigger Where is your last name and is the day of the month you were born. Below is an example of how I named my trigger function and trigger, respectively: Morabito_05_bankTriggerFunction () Morabito 05 bankTrigger
A Bank/postgres@PostgreSQL 13 v<br>Query Editor<br>Query History<br>CREATE OR REPLACE FUNCTION Moreno_03_bankTriggerFunction()<br>1<br>2<br>RETURNS TRIGGER<br>LANGUAGE PLPGSQL<br>4<br>AS<br>$$<br>7<br>CREATE TRIGGER Wise_l2_bankTrigger<br>8.<br>AFTER DELETE ON account<br>9<br>FOR EACH ROW<br>10<br>EXECUTE PROCEDURE Moreno_15_bankTriggerFunction ();<br>11<br>Data Output<br>Explain<br>Messages<br>Notifications<br>ERROR:<br>unterminated dollar-quoted string at or near

Extracted text: A Bank/postgres@PostgreSQL 13 v Query Editor Query History CREATE OR REPLACE FUNCTION Moreno_03_bankTriggerFunction() 1 2 RETURNS TRIGGER LANGUAGE PLPGSQL 4 AS $$ 7 CREATE TRIGGER Wise_l2_bankTrigger 8. AFTER DELETE ON account 9 FOR EACH ROW 10 EXECUTE PROCEDURE Moreno_15_bankTriggerFunction (); 11 Data Output Explain Messages Notifications ERROR: unterminated dollar-quoted string at or near "$$ CREATE TRIGGER Wise_12_bankTrigger AFTER DELETE ON account FOR EACH ROW EXECUTE PROCEDURE Moreno_15_bankTriggerFunction();" LINE 5: $$ SQL state: 42601 Character: 128
Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here