我想知道是否有办法从报告的列(从特定行)中获取值并将其用作 PL/SQL 语句的变量:
DECLARE
CURSOR cur_PersonnelAutoComplete IS
SELECT TASKS.ID AS TASK_ID, PERSONNEL.ID AS PERS_ID, JOBTYPES.JOB_HOURS AS PERS_WK,
PERSONNEL.DAILY_WAGE AS PERS_DW, PERSONNEL.STAMP AS PERS_STAMP
FROM DAILYWORKS JOIN PERSONNEL ON DAILYWORKS.WORKER_ID=PERSONNEL.ID
JOIN JOBTYPES ON PERSONNEL.JOB_TYPE=JOBTYPES.ID
JOIN TASKS ON DAILYWORKS.WORK_ID = TASKS.ID
WHERE TASKS.ID =:ID --(ID is a column from my report that i want to use -from this row-)
AND PERSONNEL.ID = WORKER_ID; --(WORKER_ID is also a column from my report that i want to use -from this row-)
var_emp cur_PersonnelAutoComplete%ROWTYPE;
BEGIN
OPEN cur_PersonnelAutoComplete;
LOOP
FETCH cur_PersonnelAutoComplete INTO var_emp;
EXIT WHEN cur_PersonnelAutoComplete%NOTFOUND;
UPDATE DAILYWORKS SET DAILY_WAGE = var_emp.PERS_DW, TEMP_EMP_TYPE = var_emp.PERS_WK,
STAMP = var_emp.PERS_STAMP
WHERE WORKER_ID = var_emp.PERS_ID AND WORK_ID =var_emp.TASK_ID;
END LOOP;
CLOSE cur_PersonnelAutoComplete;
END;```
If i run this nothing happens, but if i run the same code with page items, works perfectly!