Question: Make sure its giving the result from your side as wellI need Input for my code, the code is running just fine, Please provides me
Make sure its giving the result from your side as wellI need Input for my code, the code is running just fine, Please provides me some input based on my code, Thank You.
The actual code:
CREATE OR REPLACE PROCEDURE generate
job
alerts
v
jobid IN NUMBER,
v
timestamp IN TIMESTAMP
AS
Cursor to find the job post and check if it is active
CURSOR cur
job
post IS
SELECT min
degree, min
years
work
exp, jobid
FROM job
post
WHERE jobid
v
jobid AND j
status
;
Cursor to find job seekers who meet the degree and work experience requirements
CURSOR cur
job
seekers
p
degree NUMBER,
p
experience NUMBER
IS
SELECT js
accid, at
username
Specify table aliases to avoid ambiguity
FROM js
account js
JOIN account
t at ON js
accid
at
accid
WHERE degree
p
degree AND num
yrs
wrk
xp
p
experience;
Variables to hold job requirements
v
min
degree NUMBER;
v
min
years
work
exp NUMBER;
v
job
post
id NUMBER;
Variables for checking skills
v
skill
count NUMBER;
flag INT;
BEGIN
OPEN cur
job
post;
FETCH cur
job
post INTO v
min
degree, v
min
years
work
exp, v
job
post
id;
IF cur
job
post
NOTFOUND THEN
DBMS
OUTPUT.PUT
LINE
Invalid job post ID
;
CLOSE cur
job
post;
RETURN;
END IF;
Loop through all qualified job seekers
FOR r
job
seeker IN cur
job
seekers
v
min
degree, v
min
years
work
exp
LOOP
flag :
;
Check each required skill and level
FOR r
skill IN
SELECT js
skid, js
sklvl
FROM job
skills js
WHERE js
jobid
v
job
post
id
LOOP
SELECT COUNT
INTO v
skill
count
FROM app
skills aps
WHERE aps.accid
r
job
seeker.accid AND aps.skid
r
skill.skid AND aps.sklvl
r
skill.sklvl;
IF v
skill
count
THEN
flag :
;
EXIT;
END IF;
END LOOP;
IF flag
THEN
If all conditions are met, print and insert into message table
DBMS
OUTPUT.PUT
LINE
A job post
v
job
post
id
is available and you are qualified to apply'
;
INSERT INTO message
mid
appid mtime, mbody
VALUES
message
seq.nextval, r
job
seeker.accid, v
timestamp, 'A job post
v
job
post
id
is available and you are qualified to apply',
;
END IF;
END LOOP;
CLOSE cur
job
post;
END;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
