Question: Please help me fix the error of my SQL code, I will provide my actual code as well as the error I am getting. Thank
Please help me fix the error of my SQL code, I will provide my actual code as well as the error I am getting. Thank You.
Procedure GENERATEJOBALERTS compiled
LINECOL ERROR
PLSQL: SQL Statement ignored
PLSQL: ORA: column ambiguously defined
PLSQL: SQL Statement ignored
PLS: loop index variable RJOBSEEKER' use is invalid
PLSQL: ORA: RJOBSEEKER"."ACCID": invalid identifier
PLSQL: SQL Statement ignored
PLS: loop index variable RJOBSEEKER' use is invalid
PLSQL: ORA: column not allowed here.
The actual code:
CREATE OR REPLACE PROCEDURE generatejobalerts vjobid IN NUMBER, vtimestamp IN TIMESTAMP AS
Cursor to find the job post and check if it is active
CURSOR curjobpost IS
SELECT mindegree, minyearsworkexp, jobid
FROM jobpost
WHERE jobid vjobid AND jstatus ;
Cursor to find job seekers who meet the degree and work experience requirements
CURSOR curjobseekers pdegree NUMBER, pexperience NUMBER IS
SELECT accid, username
FROM jsaccount JOIN accountt ON jsaccount.accid accounttaccid
WHERE degree pdegree AND numyrswrkxp pexperience;
Variables to hold job requirements
vmindegree NUMBER;
vminyearsworkexp NUMBER;
vjobpostid NUMBER;
Variables for checking skills
vskillcount NUMBER;
flag INT;
BEGIN
OPEN curjobpost;
FETCH curjobpost INTO vmindegree, vminyearsworkexp, vjobpostid;
IF curjobpostNOTFOUND THEN
DBMSOUTPUT.PUTLINEInvalid job post ID;
CLOSE curjobpost;
RETURN;
END IF;
Loop through all qualified job seekers
FOR rjobseeker IN curjobseekersvmindegree, vminyearsworkexp LOOP
flag :;
Check each required skill and level
FOR rskill IN SELECT skid, sklvl FROM jobskills WHERE jobid vjobpostid LOOP
SELECT COUNT INTO vskillcount FROM appskills
WHERE accid rjobseeker.accid AND skid rskill.skid AND sklvl rskill.sklvl;
IF vskillcount THEN
flag :;
EXIT;
END IF;
END LOOP;
IF flag THEN
If all conditions are met, print and insert into message table
DBMSOUTPUT.PUTLINEA job post vjobpostid is available and you are qualified to apply';
INSERT INTO message mid appid, mtime, mbody
VALUES messageseq.nextval, rjobseeker.accid, vtimestamp, 'A job post vjobpostid is available and you are qualified to apply';
END IF;
END LOOP;
CLOSE curjobpost;
END;
Errors: check compiler log
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
