It's UWAweek 47

help1402

This forum is provided to promote discussion amongst students enrolled in CITS1402 Relational Database Management Systems.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying the 13 articles in this topic
Showing 13 of 684 articles.
Currently 151 other people reading this forum.


 UWA week 41 (2nd semester, week 11) ↓
SVG not supported

Login to reply

👍?
helpful
11:12am Thu 10th Oct, ANONYMOUS

Hi, In question 3 of lab 5, I have managed to write a code which has correct expected results for 3/4 tests. However, one of the test is: DELETE FROM po_items WHERE job_id = '002' AND po_id = 'HHH'; DELETE FROM pos WHERE job_id = '002' AND po_id = 'HHH'; SELECT * FROM pos WHERE job_id = '002' AND po_id = 'HHH'; Is the first line of code an error, where it is meant to be pos instead of pos_item? The expected result is that no trigger should be evoked however my trigger is evoked for this test. If someone could clarify this it would be great. Thank you.


SVG not supported

Login to reply

👍?
helpful
12:37pm Thu 10th Oct, Kushan J.

Hey, I am getting 2 of the tests wrong. I think there is an issue with the question. I am getting the answer, but the message is not exactly the same with the expected output. I get my output as "Unexpected sqlite3 error: Error: near line 14: " and in the expected output it is "Trigger failed as expected due to related po_items". Because of this it is not working. That is the internal abort error stack coming from sqlite itself, I think. I have attached a screenshot as well. It would be great if the issue is resolved. Regards, Kushan



This article has 1 attachment:

 

SVG not supported

Login to reply

👍?
helpful
12:39pm Thu 10th Oct, Kushan J.

When i tried the same with my local database the trigger works fine.


SVG not supported

Login to reply

👍?
helpful
12:44pm Thu 10th Oct, ANONYMOUS

I was initially getting the question wrong because the actual output of my abort gave a different line number to the abort on the expected output. In my case, the expected line output was 12 while I was initially outputting an error code with line 11. I just added a nonsensical extra line in my trigger to get the question correct


SVG not supported

Login to reply

👍x2
helpful
3:32pm Thu 10th Oct, ANONYMOUS

You're missing a full stop at the end of your error message, not including it creates the unexpected sqlite3 error as the testing system is looking for the full stop. They seem to have not included the full stop in the actual question.


SVG not supported

Login to reply

👍?
helpful
8:34pm Thu 10th Oct, Kushan J.

Adding a full stop worked thanks for that! Cheers


SVG not supported

Login to reply

👍?
helpful
10:00am Sat 12th Oct, ANONYMOUS

RAISE(ABORT, 'Cannot delete pos record with associated po_items.'); i still got the error even i added full stop. i dont know what is wrong



This article has 1 attachment:

 

SVG not supported

Login to reply

👍?
helpful
10:33pm Sun 13th Oct, ANONYMOUS

Maybe I'm reading your screenshot wrong, but to me it looks like they've changed the question to need no full stop. If that still doesn't work, maybe try changing the amount of lines your query is so that the error is on line 12 like how it is expected in the screenshot


SVG not supported

Login to reply

👍?
helpful
11:41pm Sun 13th Oct, ANONYMOUS

I still couldn't solve it. my code is a total 11 lines.. there is no 12 line


SVG not supported

Login to reply

👍?
helpful
11:44pm Sun 13th Oct, ANONYMOUS

i made 1 more line to make 12 lines. but i still got an error.


 UWA week 42 (2nd semester, week 12) ↓
SVG not supported

Login to reply

👍?
helpful
8:20pm Tue 15th Oct, Adam W.

The issue is now being looked into to see if the Python code is to blame, I'll report back on the progress.


SVG not supported

Login to reply

👍?
helpful
8:36pm Tue 15th Oct, Adam W.

The issue should be fixed, removing any reference to line numbers, you should now get: Trigger failed as expected due to related po_items: Cannot delete pos record with associated po_items job_id po_id po_date vendor_id ---------- ---------- ---------- ---------- 002 HHH 1990-06-20 ABC The Python code in the question was not correctly identifying the error message and intercepting it.


SVG not supported

Login to reply

👍?
helpful
4:54pm Wed 16th Oct, Adam W.

I just had a student come to the support session showing that there was still issues with the way the question was checked, and if your instance of the quiz is for some reason using an older version of the question, and does not have the same error message as above (Trigger failed as expected due to related po_items: Cannot delete pos record with associated po_items), but rather has line numbers referenced, but that is the only issue, then i can suggest that you try to adjust the number of lines the trigger takes up, e.g. is the error message displayed compared to the expected is 4 lines off, then shorten the size of the query you submit by 4. you can safely do this by having lines of code that you would normally separate for better visibility all on one line e.g. SELECT * FROM STUDENTS; instead of SELECT * FROM STUDENTS; SQL will ignore the majority of whitespace anyway, and it is primarily for readability and separating the commands.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy