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
=
1
;
-
-
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 :
=
1
;
-
-
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
=
0
THEN
flag :
=
0
;
EXIT;
END IF;
END LOOP;
IF flag
=
1
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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!